Advertisement
otorp2

working grid move input eent

Nov 7th, 2015
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. extends Area2D
  2.  
  3. # member variables here, example:
  4. # var a=2
  5.  
  6. var player_grid = Vector2(64,0)
  7. var player_act = Vector2(64,0)
  8.  
  9. func _ready():
  10.  
  11. set_process_input(true)
  12. pass
  13.  
  14. func _input(event):
  15.  
  16. if Input.is_action_pressed("ui_left"):
  17. set_pos(get_pos() - player_grid)
  18. if Input.is_action_pressed("ui_right"):
  19. set_pos(get_pos() + player_grid)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement