Browse Source

Fix wrong command line option (-lang) / improve code example (#1243)

* Fix wrong command line option to set locale

* Minor code clean up regarding variable scope

Code example should follow best practices, like using a global variable only when it's necessary.
Xavier Cho 7 years ago
parent
commit
7a57180b05

+ 1 - 2
getting_started/step_by_step/your_first_game.rst

@@ -152,7 +152,6 @@ Start by declaring the member variables this object will need:
     extends Area2D
 
     export (int) var SPEED  # how fast the player will move (pixels/sec)
-    var velocity = Vector2()  # the player's movement vector
     var screensize  # size of the game window
 
 Using the ``export`` keyword on the first variable ``SPEED`` allows us to
@@ -192,7 +191,7 @@ or ``false`` if it isn't.
 ::
 
     func _process(delta):
-        velocity = Vector2()
+        var velocity = Vector2() # the player's movement vector
         if Input.is_action_pressed("ui_right"):
             velocity.x += 1
         if Input.is_action_pressed("ui_left"):

+ 1 - 1
tutorials/misc/internationalizing_games.rst

@@ -91,7 +91,7 @@ supplied:
 
 ::
 
-   c:\MyGame> godot -lang fr
+   c:\MyGame> godot -l fr
 
 Translating the project name
 ----------------------------