Advertisement
Guest User

Untitled

a guest
Dec 10th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. func update_sprite():
  2. var aux = ((velocity.x * 3) + velocity.y) +15000
  3. var directions = {15000: "right", 20000: "right", 1: "nothing"}
  4. var facing = directions[aux]
  5. #match aux:
  6. # 15000:
  7. # facing = "right"
  8. # 2,-1:
  9. # facing = "up"
  10. # -4,-3:
  11. # facing = "left"
  12. # -2,1:
  13. # facing = "down"
  14.  
  15. var state = "idle_"
  16. if velocity.x !=0 || velocity.y !=0:
  17. state = "walk_"
  18.  
  19. #emit_signal(state + directions[aux])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement