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 / Sprite logic help please

Author
Message
Marabas
15
Years of Service
User Offline
Joined: 12th Dec 2010
Location:
Posted: 27th Jun 2012 23:02
I know, 24 hours later and I am back for more help. Sorry but I am really stuck with this. I keep getting an illegal image error even though the image is fine and loads ok in the prior function.

Can anyone tell me what I got wrong. I can post the whole code and resources (2 png's) if you need it.



Signature removed by moderator. Please do not give out the meaning of life in an open forum.
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th Jun 2012 23:07
Could this be your problem?



What is the value of bullet_top?
Fallout
23
Years of Service
User Offline
Joined: 1st Sep 2002
Location: Basingstoke, England
Posted: 27th Jun 2012 23:13
Here's one possible error: for r=bullet to bullet_top (top_bullet?)

Here's a debugging tip for you: if you think the error is in the command:
sprite 20+current, sprite x(player)+300, sprite y(player), bullet

And it's saying the image doesn't exist, replace the whole line for "text 1,1,str$(bullet)" and see what it prints. If that works, try just pasting the image bullet.

Just keep simplifying the code in the problem area, printing variables until you find the problem.

Marabas
15
Years of Service
User Offline
Joined: 12th Dec 2010
Location:
Posted: 27th Jun 2012 23:20 Edited at: 27th Jun 2012 23:28
oh gawd, how dumb am I. That is a retorical question but please feel free to answer.

I forgot to actually CALL the function to setup the bullet, thanks for the suggestions.

As a side note my debugging strategy is usually similar to that stated above i.e. printing var values and simplifying code.

Anyone have a "common sense" methodology

But while I am here, am I right in thinking that I can declare globals inside a function but declaring TYPEs must be done in the main body of the code ???

Signature removed by moderator. Please do not give out the meaning of life in an open forum.

Login to post a reply

Server time is: 2026-07-07 17:08:03
Your offset time is: 2026-07-07 17:08:03