The Daily Click ::. Forums ::. Klik Coding Help ::. Player dying effect.
 

Post Reply  Post Oekaki 
 

Posted By Message

eyeangle



Registered
  12/06/2003
Points
  1683
9th January, 2008 at 01:06:52 -

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.

 
theonecardgame.com

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
9th January, 2008 at 03:04:13 -

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?

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

JetpackLover



Registered
  01/03/2007
Points
  212
9th January, 2008 at 05:02:29 -

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.

I suck at explaining things

 
http://www.invincibletime.com/

Devlog for HD MMF Game Omulus. Check it out because it's gonna be awesome. http://omulus.tumblr.com/

Follow me on the twitters https://twitter.com/JetpackLover


eyeangle



Registered
  12/06/2003
Points
  1683
9th January, 2008 at 07:12:47 -

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.

 
theonecardgame.com

Noyb



Registered
  31/05/2004
Points
  1117

VIP Member
9th January, 2008 at 07:18:56 -

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

\/\/olf

Creative Genius

Registered
  06/08/2005
Points
  76

VIP Member
9th January, 2008 at 21:19:13 -

exactly my point. just cut and paste the code into a group.

 
Image

www.OldMansTale.net
Sign the Petition! Go go Go!!

eyeangle



Registered
  12/06/2003
Points
  1683
9th January, 2008 at 22:26:53 -

Thanks guys, deactivating the animations events and reactivating them worked perfectly. I was able to suss it out in 3 events.

 
theonecardgame.com

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
9th January, 2008 at 23:03:29 -

EDIT: I can't read posts apparently, sorry haha.

Image Edited by the Author.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!
   

Post Reply



 



Advertisement

Worth A Click