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.

DarkBASIC Professional Discussion / whats wrong with my code?!

Author
Message
TheCodeHasEyes
15
Years of Service
User Offline
Joined: 21st Oct 2010
Location:
Posted: 21st Oct 2010 16:36



ok so theres the code... now, my prolem is when i hit run i get a error message saying "Runtime error 501 image number illegal at line 12"

any help, be very thankful.

thanks.
The Slayer
Forum Vice President
16
Years of Service
User Offline
Joined: 9th Nov 2009
Playing: (Hide and) Seek and Destroy on my guitar!
Posted: 21st Oct 2010 20:16 Edited at: 21st Oct 2010 20:18
Well, there's more than one thing wrong with your code.
Firstly, you need to give a number to the image(s) that you're loading. Like this:


Secondly, you've set two times the sprite number to 1 (which you cannot do - you cannot assign the same number for different sprites or objects), and you've set the image number on the 'second' sprite to 2, which you can't, because you have only loaded one image (wich in this case didn't even have a number).
And, the third issue, is that you've set the variable spr to 2, which gives another error, because that sprite doesn't exist.

Slayer rules!!! Yeaaah, man!
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 21st Oct 2010 22:13
... and fourthly, he's loaded a bitmap, not an image

Utility plug-ins (26-JUL-2010)
I'm applying terms of use that require you to wear a red nose and honk a horn whenever you use the Internet
baxslash
Valued Member
Bronze Codemaster
19
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 22nd Oct 2010 12:17 Edited at: 22nd Oct 2010 12:18
I'm still trying to work out what you are trying to do...

Try putting comments in as you code so people don't have to guess. It'll make it easier for you too when you come back to old code and think "What was I trying to do here?"



Login to post a reply

Server time is: 2026-07-22 03:51:34
Your offset time is: 2026-07-22 03:51:34