Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. extends Sprite
  2.  
  3. export var MovingSpeed = 100
  4.  
  5. func _process(delta):
  6.  
  7. if Input.is_key_pressed(KEY_LEFT):
  8. self.position.x -= MovingSpeed * delta
  9.  
  10. if Input.is_key_pressed(KEY_RIGHT):
  11. self.position.x += MovingSpeed * delta
  12.  
  13. if Input.is_key_pressed(KEY_UP):
  14. self.position.y -= MovingSpeed * delta
  15.  
  16. if Input.is_key_pressed(KEY_DOWN):
  17. self.position.y += MovingSpeed * delta
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement