Advertisement
otorp2

statemachine esau

Dec 25th, 2016
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. extends Node2D
  2.  
  3. var PLAYERSTATE_PREV = ""
  4. var PLAYERSTATE = ""
  5. var PLAYERSTATE_NEXT = "ground"
  6.  
  7. func _ready():
  8. set_process(true)
  9. pass
  10. func _process(delta):
  11. PLAYERSTATE_PREV = PLAYERSTATE
  12. PLAYERSTATE = PLAYERSTATE_NEXT
  13.  
  14. if PLAYERSTATE == "ground":
  15. ground_state(delta)
  16. elif PLAYERSTATE =="air":
  17. air_state(delta)
  18.  
  19. func ground_state(delta):
  20. print("i'm on the ground")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement