how do i make the last one explode?

Blitz3D Forums/Blitz3D Beginners Area/how do i make the last one explode?

pls look at above file, when the last invader is shot the animation for the explosion does not display. I know why it doesnt but cant think of a way around it.

Can anyone give me any tips pls?

Thanks
Graham

I'm not exactly sure what problem you are having.
At the moment your program ends as soon as you have shot the last invader because of the check in the 'gameover' function. If you comment out line 142 (I notice you are using protean) then you will see the animation play as you shoot the last one.

well the problem is that i need to check when all the aliens are shot. on the line in the gameover function where the check is, alien=0, when this routine is tested and true the last invader does not explode. How can i run the level to the end until all the invaders have exploded and still run the check for gameover?

I 'think' i know what you mean now......

In the gameover function you are just checking if the aliens=0 but you also need to check if it still exploding.

Something like this should work:
Function gameover()
	
stillexploding=False

For explosion.explosion=Each explosion
	stillexploding=True
Next

	If aliens=0 And (Not stillexploding) Then 
		
		;nextlevel=True
		
		flushmemory()
		End

	End If
	
End Function


that works great now, many thanks

ok, now how do i make the player explode fully when hit by an invaders bullet, say with a 1 second delay before redrawing the player?

at present the frames for the explosion run whilst a new player is drawn and it doesnt quite look right :(

code is updated

thanks

Another problem fixed.

fixed? how?

also how do i get to load the next level. I get an 'image doesnt exist' error when loading level 2 yet when debugging there is an image handle assigned to my image.

I just cant quite figure it out!

code updated

thanks

Press "Ctrl+F" and type "FreeImage." If you've freed the image, then it won't really "exist" anymore.

stillexploding=False

For explosion.explosion=Each explosion
stillexploding=True
Next

If aliens=0 And (Not stillexploding) Then

I think you can do this more succinctly thus:
If aliens=0 And First explosion <> Null Then