Explorar o código

Fix random double turn

Deal with input only once for each keystroke.
DricomDragon %!s(int64=5) %!d(string=hai) anos
pai
achega
18d4274786
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      Player.gd

+ 2 - 2
Player.gd

@@ -42,9 +42,9 @@ func _ready():
 
 func _physics_process(delta):
 
-	if Input.is_action_pressed("ui_left"):
+	if Input.is_action_just_pressed("ui_left"):
 		dire_delta = -1
-	elif Input.is_action_pressed("ui_right"):
+	elif Input.is_action_just_pressed("ui_right"):
 		dire_delta = 1
 	
 	if is_moving: