local help

BlitzMax Forums/BlitzMax Beginners Area/local help

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Further, you might want to separate your frame update code from the actual hit event, otherwise each time a hit registers, your game is going to waste 13 loop cycles (since it's increasing your frame variable by .5 and the loop will only exit once it's at 6.5), and nothing else will be updated (the explosion essentially pauses the game briefly.)

Instead of handling the animation right then, you could just create an object that represents your explosion, add it to a list, and then every frame call Update on everything in the list. THen your update function can draw the object each frame , increase the objects internal frame counter and test to see if the animation is over and the object should be destroyed.