I don't know how to go about making my player die.
It might sound pretty simple but I can't have a dying animation in the same active object as all the other animations because they are all used up and there is too many events telling the (sprite) active object what to do.
It's a platform game and during the scolling levels I want my sprite (when hitting a spike or killing object) to appear at the start of the level after the dying animation has taken place.
I've tried all sorts of things but they all create their own individual problem. I've tried to create another sprite dying oject when I die but it just stays on the first frame a flashes. And the (moving object) the player, can just keep jumping around. And the camera object is another issue because as the dying sprite is dying the screen is already moving back to the start of the level.
So basically I want, after hitting a spike, to have the player animation play and the gravity of the player = 0. And then after the animation finishes re-position player to the start of the level.
Thanks, if you need any more infomation on what I'm talking about, please ask.
Well, if you're using a custom movement engine, you should make all your events have the "Animation disappearing not playing" with it. OR you can set an alt value (life) to the player. Say, he dies when its below 0 so you can now instead put "alt value is greater than 0" with all the events that dictate movement or animations.
Better yet, you can just make groups and disable movement/animation groups whenever disappearing is playing or alt value is below 0.
And then, when the alt value (LIFE) is zero, have a counter run to 100 by adding one to itself and then when it reaches 100, set the coutner to zero, the alt value (LIFE) to anything more than zero (whatever the max life of your character is) and set x,y pos of your character at the start of the frame. Oh, and also, enable the movement/animation groups. It should work that way.
The counter runs to 100 to provide adequate time for your dying (disappearing) animation. If you find that it runs to 100 too quickly and the dying animation has not yet finished yet, then increase set it to 200 or something instead of 100.
As for running out of animations, are you using mmf or tgf?
well think about it logically, i bet you have animations like this "Standing on ground" "Is not moving" > play Stopped, or While left is pressed down> user moves right, etc.
Well if you play your dying animation you are contradicting your previous code. So just negate every animation that would currently be playing when you actually die. So if he dies and he is stopped, then the animation will only flash unless you put in the code...something like this "Player object has 0 health" "animation stopped is not playing" > change animation to dying. Or negate whatever animation would be contradicting that one.
Yeah it is custom movement. I was just hopeing there was an eaiser way. I did the 47 animations event ages ago. It's gonna be a killer going back through them all just to add a simple dying effect.
Maybe you could try putting your movement, scrolling, and animation code into a group that you can disable when the player dies and enable when he respawns?
"Omg. Where did they get the idea to not use army guys? Are they taking drugs?" --Tim Schafer on originality in videogames