Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / need help with sprites in blackjack game

Author
Message
Joshthefoolish
22
Years of Service
User Offline
Joined: 15th Oct 2003
Location:
Posted: 27th Apr 2004 18:12
well hey im' trying to get this dumb game to work. and it works just fine until the deck reshuffles then it stops deleting sprites.
zenassem
23
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 27th Apr 2004 19:59
I haven't looked thoroughly at your code, but I think that the problem is being caused because you are possibly forgetting that arrays start at 0. when you dim an array dim array(52) you are essentially creating a 52 element array with indexes 0 to 51.

To fix your code either dim the array as 53 (hence ignoring element 0) or you would have to change all of your loops to begin at 0 and end at 51. I'll check the rest of your code after work to see if I am missing something else.

Pincho Paxton
23
Years of Service
User Offline
Joined: 8th Dec 2002
Location:
Posted: 27th Apr 2004 21:46
It's not easy for me to test DBPro code because I don't have it, but this If Endif has a goto in the middle. Somehow I think that the program may get confused by not reaching the Endif.

if a=>40
for x=1 to 52
usedcards(x)=0
next x
goto restart
endif

try

if a=>40
for x=1 to 52
usedcards(x)=0
next x
start = 1
endif

If start = 1 then start = 0: goto Restart


Although Goto is best avoided in programming.

Peter H
22
Years of Service
User Offline
Joined: 20th Feb 2004
Location: Witness Protection Program
Posted: 27th Apr 2004 22:48
Quote: "Although Goto is best avoided in programming."

yes "goto" is a taboo in "structered programming"


Formerly known as "DarkWing Duck"
Flashing Blade
23
Years of Service
User Offline
Joined: 19th Oct 2002
Location: United Kingdom
Posted: 28th Apr 2004 00:20 Edited at: 28th Apr 2004 00:29
This may also be a problem:

if a=>40
for x=1 to 52
usedcards(x)=0
next x
goto restart
endif
a=0

This bit of code means a will reach 40 once and never be reset so every loop program will jump to restart.

Change to this:

if a=>40
for x=1 to 52
usedcards(x)=0
next x
a=0
goto restart
endif

*edit*
oops just realised that will mean a is reset to 0 every time a<40 - what I said is probably of no use - sorry


Joshthefoolish
22
Years of Service
User Offline
Joined: 15th Oct 2003
Location:
Posted: 28th Apr 2004 17:42
well thanks for ya'lls help guys but unfortunately none of it could get this dumb thing working.

Login to post a reply

Server time is: 2026-06-09 13:55:47
Your offset time is: 2026-06-09 13:55:47