Advertisement
Guest User

physics

a guest
Jun 26th, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.39 KB | None | 0 0
  1. func _physics_process(delta):
  2.     current_animation = state_machine.get_current_node()
  3.     fall(delta)
  4.     walk()
  5.     jump()
  6.     if movement.y < 0:
  7.         state_machine.travel("jump")
  8.     elif movement.x != 0 and movement.y == 0 :
  9.         state_machine.travel("walk")
  10.     elif movement.y > 0:
  11.         state_machine.travel("fall")
  12.     elif movement.x == 0:
  13.         state_machine.travel("idle")
  14.     hit()
  15.    
  16.     move_and_slide(movement, UP)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement