浏览代码

Implement rotation to right

DricomDragon 5 年之前
父节点
当前提交
9bad42a143
共有 1 个文件被更改,包括 7 次插入3 次删除
  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"):