Death animation

Game Editor comments and discussion.

Death animation

Postby hunter84 » Wed May 22, 2013 6:27 pm

I'm back again and working on a new game. I set up a death animation for my character but you can move and it will cancel the animation. How can I freeze his movement so he does the animation before dieing without him moving. Thanks.
If two wrongs don't make a right, try three.
Work in progress:
viewtopic.php?f=4&t=12888

Finished work:
Space Adventures- Lost In Space viewtopic.php?f=4&t=12587
User avatar
hunter84
 
Posts: 133
Joined: Thu Nov 10, 2011 12:13 am
Location: Yukon, Canada
Score: 3 Give a positive score

Re: Death animation

Postby skydereign » Wed May 22, 2013 6:58 pm

Probably the easiest way to do this is to disable keydown events for the actor.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Death animation

Postby Lokaar » Thu Jun 06, 2013 12:38 am

you could try making player states like

int playerState=0

if(playerState==0)
{
idle state in here
put switches and cases for each button that has function while the player is in the idle state, same for each other player state
example, pushing a button while idle would begin switching over to walking state, play the roll-up anim, some slight movement, then:
playerState=1; //this would switch to the walking state from within the idle state, which means the next state would take over handling
}
if(playerState==1)
{
walking state in here
movement when pushing a button
}
if(playerState==2)
{
jumping state in here
}
if(playerState==3)
{
dead state in here
no movement defined
}

etc

also allows you to have things happen before switching to another state and when entering another state (such as animations to go from idle to walking before switching to walking state, and from walking to idle when switching back to idle state)
then, all you have to do is playerState=3; to make them die
this doesn't only have to be used for the player
User avatar
Lokaar
 
Posts: 15
Joined: Wed May 22, 2013 7:26 am
Score: 1 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest