Browse Source

Implement rotation to right

DricomDragon 5 years ago
parent
commit
9bad42a143
1 changed files with 7 additions and 3 deletions
  1. 7 3
      Player.gd

+ 7 - 3
Player.gd

@@ -62,9 +62,13 @@ func _physics_process(delta):
 			is_moving = true
 
 	elif Input.is_action_pressed("ui_right"):
-		dire += 1
-		if dire > 3:
-			dire = 0
+		if !is_moving:
+			dire += 1
+			if dire > 3:
+				dire = 0
+
+			tween.rotate_char(self, rotation_degrees + 90)
+			is_moving = true
 
 	if Input.is_action_pressed("ui_up"):