Cant get my actor to go through a death sequence before moving back to start.?
Toby
Member Posts: 478
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....
- 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
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.
- 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.