how do i make the last one explode?

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

767pilot(Posted 2005) [#1]
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


Dazman(Posted 2005) [#2]
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.


767pilot(Posted 2005) [#3]
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?


Dazman(Posted 2005) [#4]
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:



767pilot(Posted 2005) [#5]
that works great now, many thanks


767pilot(Posted 2005) [#6]
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


wizzlefish(Posted 2005) [#7]
Another problem fixed.


767pilot(Posted 2005) [#8]
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


wizzlefish(Posted 2005) [#9]
Press "Ctrl+F" and type "FreeImage." If you've freed the image, then it won't really "exist" anymore.


mrtricks(Posted 2005) [#10]
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