Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualwarnexus

Posted 03 June 2014 - 04:41 PM

Ignore the title: the actual title is here. How to prevent the character from jumping again if it is already in a "jumping state"?

if(spacePressed)
{
state = ActionState.JUMPING;
}

public enum ActionState {
 
RUNNING,
JUMPING 
}

Code is in Java


#14warnexus

Posted 03 June 2014 - 04:39 PM

Ignore the title: the actual title is here. How to prevent the character from jumping again if it is already in a "jumping state"?

if(spacePressed)
{
state = ActionState.JUMPING;
}

public enum ActionState {
 
RUNNING,
IDLE,
HEALING,
ATTACKING, 
HIT,
JUMPING 
}

Code is in Java


#13warnexus

Posted 03 June 2014 - 04:15 PM

Ignore the title: the actual title is here. How to prevent the character from jumping again if it is already in a "jumping state"?

if(spacePressed)
{
state = ActionState.JUMPING;
}

public enum ActionState {
 
RUNNING,
IDLE,
HEALING,
ATTACKING, 
HIT,
 
}

Code is in Java


#12warnexus

Posted 03 June 2014 - 04:15 PM

Ignore the title: the actual title is here. How to prevent the character from jumping again if it is already in a "jumping state"?

if(spacePressed)
{
state = ActionState.JUMPING;
}

public enum ActionState {
 
RUNNING,
IDLE,
HEALING,
ATTACKING, 
HIT,
 
}

#11warnexus

Posted 03 June 2014 - 04:14 PM

Ignore the title: the actual title is here. How to prevent the character from jumping again if it is already in a "jumping state"?

if(spacePressed)
{
state = ActionState.JUMPING;
}

#10warnexus

Posted 03 June 2014 - 04:11 PM

Ignore the title: the actual title is here. How to prevent the character from jumping again if it is already in a "jumping state"?

 

if(spacePressed && state != ActionState.JUMPING)
{
state = ActionState.JUMPING;
}

PARTNERS