Hey,
I'm programming a space invaders like game and tried to add in an explosion animation. It doesn't work right though, it blinks onto the screen really fast then dissapears. I need help! The animation (obiously) appears when you destroy an enemy ship. I put the function itself, which is activated in the part of the code where there is the collision detection with the player's bullet and the enemy ship. All types have been defined.
I'm programming a space invaders like game and tried to add in an explosion animation. It doesn't work right though, it blinks onto the screen really fast then dissapears. I need help! The animation (obiously) appears when you destroy an enemy ship. I put the function itself, which is activated in the part of the code where there is the collision detection with the player's bullet and the enemy ship. All types have been defined.
Function CreateExplosion(e.typenemy) xp.typexplosion = New typexplosion xp\x = e\x xp\y = e\y xp\currentframe = 0 xp\frames = 12 xp\img = ani_explosion For xp.typexplosion = Each typexplosion DrawImage xp\img,xp\x,xp\y,xp\currentframe currentframe = currentframe + 0.01 If xp\currentframe => xp\frames Then Delete xp Next End Function