I have an animated player sprite that moves into a different animation when it dies. I am using the W key as a forward movement and angle is locked to the mouse. The problem I am having is when the player sprite dies if I am moving when the death happens the sprite immediately resets to the movement animation assigned to the W is down action. I need it so that when the player sprite dies it no longer sees the W is down action until after the death animation and the player sprite is created again.
Any help would be appreciated.
Also how do I get it to stop recognizing the left mouse button press for firing....it looks lame that the dead dragon can still fire fireballs.....lol
scirra.com/tutorials/37/beginners-guide-to-construct-2/page-6
Use instance variables like this to dictate phases of your character.
For example if character phase variable =1 movement is allowed, set at default numbers
The character "dies" set the variable to 2. While the variable is 2 this could decrease character speed to 0 etc.
You can use Groups for that.
put all of your player controls to a group ie. "player" (activate)
and the when player dies set group "player" to deactivate.
Thank you for your reply. I'm sorry i'm a noob at this. I created the group Player and placed all of the movement events in there. Now how do I deactivate the group within the death and destroy scenario?
In events under System you have an option to set group active, deactivate the group from there.
Post a capx, it's easier for poeple to grasp what you are trying to do and you will get the answers you're looking for quicker.
lewispcservice.com/downloads/dragonrage.capx
Develop games in your browser. Powerful, performant & highly capable.
You will see that when one of the enemies (jittery flying rocks) hits the player the player goes into a death animation. If you are moving when the player gets hit by the enemy you don't see the death animation because it registers the pressing of the W key and plays the moving animation. The death animation works fine if you sit still and wait for an enemy to hit you. The other issue is when you are lying dead on the ground you can still shoot. But I assume both issues can be fixed with the same process.
dl.dropbox.com/u/14087254/dragonrage.capx
an important lesson for every body. Groups and Functions are your best friends.. I hope you have 117.
You capx was a super easy fix :)
dragonrage_fixed.capx
Thank you for the reply....i appreciate the help.....I am sure it was an easy fix for someone beyond the status of noob :).....I am updating to 117 in Steam right now so I can take a look at these.
Yes that is exactly what I was looking for. Thank you so much. I really do appreciate the help. You taught me something new today....kudos!