瀏覽代碼

Fix missing indentation in State design pattern (#3878)

Added missing indent for Input Code in persistance_state.gd
Anilforextra 5 年之前
父節點
當前提交
9252df6dfd
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      tutorials/misc/state_design_pattern.rst

+ 4 - 4
tutorials/misc/state_design_pattern.rst

@@ -207,10 +207,10 @@ will not change it makes sense to call this new script ``persistent_state.gd``.
 
         # Input code was placed here for tutorial purposes.
         func _process(_delta):
-        if Input.is_action_pressed("ui_left"):
-            move_left()
-        elif Input.is_action_pressed("ui_right"):
-            move_right()
+            if Input.is_action_pressed("ui_left"):
+                move_left()
+            elif Input.is_action_pressed("ui_right"):
+                move_right()
 
         func move_left():
             state.move_left()