Animate an actor before destroying it

sebmacflysebmacfly Member Posts: 1,018
edited November -1 in Working with GS (Mac)
Hi there!

Anybody know how to animate an actor before destroying it and restart the scene?
For exemple, i want to do an explode animation on my actor if he hit a special wall... and after that animation, i want to restart the scene or restart to the previous checkpoint....

Thanks in advance,
Have a good day all!

Comments

  • synthesissynthesis Member Posts: 1,693
    when actorIsDead=true
    animate
    timer : after X seconds
    gameOver=true

    then you have a full screen gameOver overlay graphic that arrives when gameOver=true...
    in that graphic have a "Tap Screen to Play Again" instruction in it.

    when gameOver graphic is released:
    change Scene (to the same scene or to the main menu...whatever you like)

    Its a few more elements than the easy solution but this kind of sequencing makes the game play experience better.

    You can also have the game over graphic spawn buttons to allow the game play to select what to do at that point...with each button execute a different function (btn1=mainmenu, btn2=checkpoint, etc.)
  • netdzynrnetdzynr Member Posts: 296
    What's the best way to handle the overlay image in this case, if the player stays in the same scene? Destroy the overlay, move it off screen, set its alpha to 0 and disable its interaction, or something else?
  • synthesissynthesis Member Posts: 1,693
    if it is an overlay that has a "button" effect attached to it...move it off screen (alpha=0 still allows touch UI)...otherwise alpha=0 is good. Don't destroy unless you never need it again.

    Just remember...when you reload the scene (or change scenes)...everything returns to its defaults. So it may be irrelevant in some cases.
  • sebmacflysebmacfly Member Posts: 1,018
    @synthesis :

    I have to create a rule in my actor?
    How to use "when actorIsDead=true" ?

    i thank you
Sign In or Register to comment.