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.

Newcomers DBPro Corner / Pulling my hair out over this code

Author
Message
Linehan
15
Years of Service
User Offline
Joined: 13th Oct 2009
Location: Salem, MA
Posted: 2nd Apr 2010 09:44
I know this has to be some insanely simple thing I am unable to figure out, because I get no errors when I compile, so that means my problem must be in my variables or something. Please help. I have not touched my DBP in a long time, and I am trying to get all the rust out but this is not starting off well.

When I run the program it appears to load and display all of the cards in the deck. Then when it is simply supposed to display two random cards on the screen, I get the error "Runtime Error 302 - Sprite does not exist at line 15".

I have tried doing this in several different algorithms, but I keep getting the same results. This is the first method I tried and keep coming back to.



I just can't shake the feeling I am going to "DOH" soon..

Mark
luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 2nd Apr 2010 15:05
Can you tell me which of above is line 15 or you actually didn`t include it ?

Where there is a will, there is a way.
I often edit my posts, that`s who i am
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 2nd Apr 2010 17:42
Hopefully you have some hair left

Try this, it should help you. If you have any questions, please ask:



I had to make the card images, so obviously you would have to remove that part and load in your images. I also included some code if you wanted to look quickly at all of the cards.

Good luck.

empty
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: 3 boats down from the candy
Posted: 2nd Apr 2010 20:04
The error occurs because of this line:


Whenever you change the resolution, all objects and images (and therefore sprites) will be deleted. Change the display mode before you load any media.

Login to post a reply

Server time is: 2024-11-24 19:08:16
Your offset time is: 2024-11-24 19:08:16