S
Steve Potts
Guest
Hi guys I have 2 problems I`m stuck with.
1) I have a cannon moving across the screen which fires at random.
The sprite is made up of 9 frames and I need frame 0 when not firing and to run the animation when it fires once. All I can do is have the cannon on frame 0 all the time or run the animation all the time.
2) When a missile hits the player the player, the player and the missile are destroyed and an explosion animation is played , I want to lose a life and restart the level if you have any lives left.
If I run the following code:
instance_destroy() ;
with other instance_destroy () ;
instance_create_layer(x-60,y,"Instances",obj_big_explosion) ;
lives = lives -1 ;
if lives > 0 then room_restart() ;
All is destroyed and the player is respawned but the explosion animation does not play.
If I rem out: if lives > 0 the room_restart() ;
then the explosion plays but obviously the level does not restart.
Any help most appreciated.
1) I have a cannon moving across the screen which fires at random.
The sprite is made up of 9 frames and I need frame 0 when not firing and to run the animation when it fires once. All I can do is have the cannon on frame 0 all the time or run the animation all the time.
2) When a missile hits the player the player, the player and the missile are destroyed and an explosion animation is played , I want to lose a life and restart the level if you have any lives left.
If I run the following code:
instance_destroy() ;
with other instance_destroy () ;
instance_create_layer(x-60,y,"Instances",obj_big_explosion) ;
lives = lives -1 ;
if lives > 0 then room_restart() ;
All is destroyed and the player is respawned but the explosion animation does not play.
If I rem out: if lives > 0 the room_restart() ;
then the explosion plays but obviously the level does not restart.
Any help most appreciated.