Crashing

BlitzPlus Forums/BlitzPlus Programming/Crashing

DI(Posted 2012) [#1]
I'm trying to add a bullet but when I run the code it crashes.
Here's the code:
http://pastebin.com/v5qXNm7K
Thanks for any help.


indietom(Posted 2012) [#2]
Probably typed some variable wrong... or drawing it wrong...


indietom(Posted 2012) [#3]
Probably typed some variable wrong... or drawing it wrong...


Floyd(Posted 2012) [#4]
Run with Debug Enabled.


DI(Posted 2012) [#5]
already done that. I get the message "Invalid Image handle".


indietom(Posted 2012) [#6]
I knew it had something to do with the drawing!


DI(Posted 2012) [#7]
how should I fix it?

DrawImage(bulletImage,bulletXpos,bulletYpos)


Floyd(Posted 2012) [#8]
The image did not load successfully. The most common reason is that the program can't find the image file. As a temporary fix try using the full path and file name.

The easiest way to get the full path is probably to navigate to where you have the image, right click on the file, select Properties and then copy the location.


DI(Posted 2012) [#9]
nope, doesn't work.


indietom(Posted 2012) [#10]
Send us the current code.


DI(Posted 2012) [#11]
http://pastebin.com/VtbMJkhr

Here you go!


Addi(Posted 2012) [#12]
Use DebugLog after you have loaded the pic to check if it has been loaded successfully:
If Not bulletImage Then DebugLog "pic not loaded"


DI(Posted 2012) [#13]
The debug doesn't say anything and I get the same error, "Invalid Image handle".


DI(Posted 2012) [#14]
DrawImage(bulletImage,50,50)

This is the line that is highlighted in the debug and is apparently wrong.


DI(Posted 2012) [#15]
http://pastebin.com/REJ2P62v

code updated.


indietom(Posted 2012) [#16]
I fixed it, because we're talking over skype. Also because I'm so smart.


DI(Posted 2012) [#17]
Thanks Tom!!


Addi(Posted 2012) [#18]
How have you fixed it?

Last edited 2012


indietom(Posted 2012) [#19]
There was something with the image, and as I said I told DI this and he didn't belive me and then I fixed it.