瀏覽代碼

Merge pull request #2150 from brunodantas/master

Naming convention adherence for variable
Nathan Lovato 6 年之前
父節點
當前提交
8a3a087d9d
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      getting_started/step_by_step/your_first_game.rst

+ 4 - 4
getting_started/step_by_step/your_first_game.rst

@@ -163,7 +163,7 @@ Start by declaring the member variables this object will need:
     extends Area2D
 
     export var speed = 400  # How fast the player will move (pixels/sec).
-    var screensize  # Size of the game window.
+    var screen_size  # Size of the game window.
 
  .. code-tab:: csharp
 
@@ -198,7 +198,7 @@ which is a good time to find the size of the game window:
  .. code-tab:: gdscript GDScript
 
     func _ready():
-        screensize = get_viewport_rect().size
+        screen_size = get_viewport_rect().size
 
  .. code-tab:: csharp
 
@@ -317,8 +317,8 @@ to the bottom of the ``_process`` function:
  .. code-tab:: gdscript GDScript
 
         position += velocity * delta
-        position.x = clamp(position.x, 0, screensize.x)
-        position.y = clamp(position.y, 0, screensize.y)
+        position.x = clamp(position.x, 0, screen_size.x)
+        position.y = clamp(position.y, 0, screen_size.y)
 
  .. code-tab:: csharp