Mr Inquisitive,
The problem lies within the piece of code which checks for collision of sprites 24 and 4. Once the sprites collide for their first time they are both then deleted. Though, they become deleted, your code is still setup to check if they collide. This is what is giving you a
runtime error. A
BOB is a
SPRITE, and if you check collision for a sprite that no longer exists, you are given the runtime error.
So, to fix this problem, take your section of code which checks for collision, and enwrap it in a blanket of code which first checks if the two sprites exist anymore. Try this:
if sprite exist(24) and sprite exist(4)
if sprite collision(24,4) = 1
delete sprite 4
delete sprite 24
endif
endif
This will keep you from that nasty ol' runtime error. You will not recieve a runtime error for checking if the sprite exists. However, you will recieve a runtime error for trying to use or manipulate a sprite which does not or no longer exists.
+NanoBrain+