Cant get my actor to go through a death sequence before moving back to start.?

TobyToby Member Posts: 478
edited November -1 in Working with GS (Mac)
How do you make your player actor die, go through a brief death cycle animation before re-appearing back at a specific position to start again? I've been fumbling around with this trying to work out how to make my player go through a death cycle animation, the solution eludes me. Tired perhaps....

- When enemy actor touches player actor
- I have a short timer delay of 1 second for the explosion animation to complete (Part I'm having trouble with)
- Then after 1 second change the self X/Y position of the actor to the start location X/Y.

Seems simple enough....

Using a timer seems to be ignored? It just jumps to the XY, and the explosion animation does play.... without the ship.

Arghhhh....

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    So do you have it like this:

    Rule: When collides with enemy
    --Timer: For 1 second: Animate, Run to Completion. (It sees the collision to be true to activate the rules, but the event doesn't stay true if the enemy is destroyed instantaneously)
    --Timer: After 1 second: Change Attributes: X/Y Position Run to Completion.
  • TobyToby Member Posts: 478
    Nope that would not work for me GS just stalled at preview with multiple timers, only thing that worked for me was the following:

    - Created a global game attribute called 'player die' (boolean)

    - Created a rule in the enemy actor, on collision change condition 'player die' to true

    - Created a rule in the player actor, when attribute 'Player Die' is true do the following....
    -- Change velocity to 0
    -- Spawn my explosion animation at 0,0 which is now an actor
    -- Change size to -5 (Shrinks player)

    -- Then create a timer, AFTER 1 second change Attribute X and change Attribute Y to the required co-ordinates.
    -- Change the 'Player Die' Attribute back to false
    -- Change Velocity to 0
    -- Spawn my explosion animation at 0,0 again...
    -- Change attribute width and height back to original size.

    Works really well.

    Hope someone finds this useful.
Sign In or Register to comment.