animation after killing enemy, before destorying
Hi,
I have an enemy-actor, which is animated. So if the actor was hit by a shot-actor, there should be played another animation for explosion and at the same time, there should be displayed a point-text. After 1,5 sec the actor should then be destorey.
It works only for half by me. The problem is, that the animation after hitting the actor will be played a piece of a second and then the normal animation will be played again. But after 1,5 sec it will be destoryed. What is there wrong?
I have an enemy-actor, which is animated. So if the actor was hit by a shot-actor, there should be played another animation for explosion and at the same time, there should be displayed a point-text. After 1,5 sec the actor should then be destorey.
It works only for half by me. The problem is, that the animation after hitting the actor will be played a piece of a second and then the normal animation will be played again. But after 1,5 sec it will be destoryed. What is there wrong?
Comments
Jamie
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
hmm. There must be still an error inside.
Currently I have change to the idea of UPTIMISTIK:
If actor collide with shot
- Change Attribute Score +100
- Timer 1 sec
- Animation (explosion; without loop & without restore...), Check the run to completion box)
- Display Text
- Timer 1 sec
- Destroy actor
So now, if the shot hits the actor, the text will be shown very short and the actor does have in change the old animation and then the explosion animation and then the old and so on.
when the enemy actor is hit by whatever kills him, change self.attribute "dead" to true.
then put the normal animation within a rule, make the condition of that rule "if self.dead is false"
then put the death animation in the "otherwise" of that rule.
If I'm reading right, the problem is that GS is trying to play both animations at the same time
Thank you for now.
You do not ever, EVER, want to use timers if you don't absolutely have to.
They are resource hogs.
Timers are for Chumps
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left