STMG/Player.gd

19 lines
319 B
GDScript

extends KinematicBody2D
var motion = Vector2()
func _physics_process(delta):
if Input.is_action_pressed("dp_right"):
motion.x = 100
elif Input.is_action_pressed("dp_left"):
motion.x = -100
else:
motion.x = 0
if Input.is_action_just_pressed("select"):
get_tree().quit()
move_and_slide(motion)
pass