Ver Fonte

Implement rotation to right

DricomDragon há 5 anos atrás
pai
commit
9bad42a143
1 ficheiros alterados com 7 adições e 3 exclusões
  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"):