Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualwarnexus

Posted 03 June 2014 - 05:25 PM

It highly depends on more parts of your code (those few lines are really not useful, it's just one line of code and an enum), but since you're working with states you must define what state transitions are valid and what triggers them. When you press the "jump" key check if the state is a valid state to trasition to jumping.

 

Also... that enum doesn't have a JUMPING element, is that your actual code?

Strange. I can use ActionState.JUMPING even though I did not define it in my ActionState class. Well I added the JUMPING to the ActionState class now.

 

Thanks. The problem has been fixed!


#2warnexus

Posted 03 June 2014 - 04:44 PM

It highly depends on more parts of your code (those few lines are really not useful, it's just one line of code and an enum), but since you're working with states you must define what state transitions are valid and what triggers them. When you press the "jump" key check if the state is a valid state to trasition to jumping.

 

Also... that enum doesn't have a JUMPING element, is that your actual code?

Strange. I can use ActionState.JUMPING even though I did not define it in my ActionState class. Well I added the JUMPING to the ActionState class now.


#1warnexus

Posted 03 June 2014 - 04:41 PM

It highly depends on more parts of your code (those few lines are really not useful, it's just one line of code and an enum), but since you're working with states you must define what state transitions are valid and what triggers them. When you press the "jump" key check if the state is a valid state to trasition to jumping.

 

Also... that enum doesn't have a JUMPING element, is that your actual code?

Strange. I can use ActionState.JUMPING even though I did not define it in my ActionState class. 


PARTNERS