Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extends Sprite
- export var MovingSpeed = 100
- func _process(delta):
- if Input.is_key_pressed(KEY_LEFT):
- self.position.x -= MovingSpeed * delta
- if Input.is_key_pressed(KEY_RIGHT):
- self.position.x += MovingSpeed * delta
- if Input.is_key_pressed(KEY_UP):
- self.position.y -= MovingSpeed * delta
- if Input.is_key_pressed(KEY_DOWN):
- self.position.y += MovingSpeed * delta
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement