STMG/Player.gd

19 lines
319 B
GDScript3
Raw Normal View History

2020-11-20 06:32:05 +00:00
extends KinematicBody2D
var motion = Vector2()
func _physics_process(delta):
2020-11-21 02:59:52 +00:00
if Input.is_action_pressed("dp_right"):
motion.x = 100
elif Input.is_action_pressed("dp_left"):
2020-11-20 06:32:05 +00:00
motion.x = -100
2020-11-21 02:59:52 +00:00
else:
motion.x = 0
if Input.is_action_just_pressed("select"):
get_tree().quit()
2020-11-20 06:32:05 +00:00
move_and_slide(motion)
2020-11-21 02:59:52 +00:00
pass