Browse Source

Edit the 3D tutorial series

Co-authored-by: Aaron Franke <[email protected]>
Co-authored-by: PiOverFour <[email protected]>
Nathan Lovato 4 years ago
parent
commit
3bd0ac9dc2

+ 2 - 2
getting_started/first_3d_game/01.game_setup.rst

@@ -49,7 +49,7 @@ Save the scene as ``Main.tscn`` by pressing Ctrl s (Cmd s on MacOS).
 
 
 We'll start by adding a floor that'll prevent the characters from falling. To
 We'll start by adding a floor that'll prevent the characters from falling. To
 create static colliders like the floor, walls, or ceilings, you can use
 create static colliders like the floor, walls, or ceilings, you can use
-*StaticBody* nodes. They require a *CollisionShape* node as their child to
+*StaticBody* nodes. They require *CollisionShape* child nodes to
 define the collision area. With the *Main* node selected, add a *StaticBody*
 define the collision area. With the *Main* node selected, add a *StaticBody*
 node, then a *CollisionShape*. Rename the *StaticBody* as *Ground*.
 node, then a *CollisionShape*. Rename the *StaticBody* as *Ground*.
 
 
@@ -95,7 +95,7 @@ resource to create a visible cube.
 |image11|
 |image11|
 
 
 Once again, it's too small by default. Click the cube icon to expand the
 Once again, it's too small by default. Click the cube icon to expand the
-resource and set its *Size* to ``60``, ``2`` ``, and ``60``. As the cube
+resource and set its *Size* to ``60``, ``2``, and ``60``. As the cube
 resource works with a size rather than extents, we need to use these values so
 resource works with a size rather than extents, we need to use these values so
 it matches our collision shape.
 it matches our collision shape.
 
 

+ 2 - 2
getting_started/first_3d_game/02.player_input.rst

@@ -133,13 +133,13 @@ press the *Add* button.
 |image14|
 |image14|
 
 
 Do the same for the other input actions. For example, bind the right arrow, D,
 Do the same for the other input actions. For example, bind the right arrow, D,
-and The left joystick's right axis to ``move_right``. After binding all keys,
+and the left joystick's right axis to ``move_right``. After binding all keys,
 your interface should look like this.
 your interface should look like this.
 
 
 |image15|
 |image15|
 
 
 We have the ``jump`` action left to set up. Bind the Space key and the gamepad's
 We have the ``jump`` action left to set up. Bind the Space key and the gamepad's
-A button. To bind a gamepad's button, select the joy button option in the menu.
+A button. To bind a gamepad's button, select the *Joy Button* option in the menu.
 
 
 |image16|
 |image16|
 
 

+ 2 - 2
getting_started/first_3d_game/03.player_movement_code.rst

@@ -29,7 +29,7 @@ character.
 
 
 These are common properties for a moving body. The ``velocity`` is a 3D vector
 These are common properties for a moving body. The ``velocity`` is a 3D vector
 combining a speed with a direction. Here, we define it as a property because
 combining a speed with a direction. Here, we define it as a property because
-we're going to build upon its value frame after frame.
+we want to update and reuse its value across frames.
 
 
 .. note::
 .. note::
 
 
@@ -130,7 +130,7 @@ shorthand for ``variable = variable - ...``.
 
 
 This line of code will cause our character to fall in every frame. This may seem
 This line of code will cause our character to fall in every frame. This may seem
 strange if it's already on the floor. But we have to do this for the character
 strange if it's already on the floor. But we have to do this for the character
-to collide with the ground every.
+to collide with the ground every frame.
 
 
 The physics engine can only detect interactions with walls, the floor, or other
 The physics engine can only detect interactions with walls, the floor, or other
 bodies during a given frame if movement and collisions happen. We will use this
 bodies during a given frame if movement and collisions happen. We will use this

+ 12 - 12
getting_started/first_3d_game/04.mob_scene.rst

@@ -11,7 +11,7 @@ to be similar to the *Player* scene.
 
 
 Create a scene with, once again, a *KinematicBody* node as its root. Name it
 Create a scene with, once again, a *KinematicBody* node as its root. Name it
 *Mob*. Add a *Spatial* node as a child of it, name it *Pivot*. And drag and drop
 *Mob*. Add a *Spatial* node as a child of it, name it *Pivot*. And drag and drop
-the file "mob.glb "from the *FileSystem* dock onto the *Pivot* to add the
+the file ``mob.glb`` from the *FileSystem* dock onto the *Pivot* to add the
 monster's 3D model to the scene. You can rename the newly created *mob* node
 monster's 3D model to the scene. You can rename the newly created *mob* node
 into *Character*.
 into *Character*.
 
 
@@ -93,9 +93,9 @@ Attach a script to the *Mob*.
 
 
 |image7|
 |image7|
 
 
-Here's the movement code to start with. We define two properties, "min_speed "
-and "max_speed ", to define a random speed range. We then define and initialize
-the "velocity ".
+Here's the movement code to start with. We define two properties, ``min_speed``
+and ``max_speed``, to define a random speed range. We then define and initialize
+the ``velocity``.
 
 
 ::
 ::
 
 
@@ -114,18 +114,18 @@ the "velocity ".
 
 
 Similarly to the player, we move the mob every frame by calling
 Similarly to the player, we move the mob every frame by calling
 ``KinematicBody``\ 's ``move_and_slide()`` method. This time, we don't update
 ``KinematicBody``\ 's ``move_and_slide()`` method. This time, we don't update
-the "velocity "every frame: we want the monster to move at a constant speed
+the ``velocity`` every frame: we want the monster to move at a constant speed
 and leave the screen, even if it were to hit an obstacle.
 and leave the screen, even if it were to hit an obstacle.
 
 
 We need to define another function to calculate the start velocity. This
 We need to define another function to calculate the start velocity. This
 function will turn the monster towards the player and randomize both its angle
 function will turn the monster towards the player and randomize both its angle
 of motion and its velocity.
 of motion and its velocity.
 
 
-The function will take a "start_position ", the mob's spawn position, and the
-"player_position "as its arguments.
+The function will take a ``start_position``, the mob's spawn position, and the
+``player_position`` as its arguments.
 
 
-We first position the mob at "start_position ". Then, we turn it towards the
-player using the "look_at() "method and randomize the angle by rotating a
+We first position the mob at ``start_position``. Then, we turn it towards the
+player using the ``look_at()`` method and randomize the angle by rotating a
 random amount around the Y axis. Below, ``rand_range()`` outputs a random value
 random amount around the Y axis. Below, ``rand_range()`` outputs a random value
 between ``-PI / 4`` radians and ``PI / 4`` radians.
 between ``-PI / 4`` radians and ``PI / 4`` radians.
 
 
@@ -139,11 +139,11 @@ between ``-PI / 4`` radians and ``PI / 4`` radians.
        # And rotate it randomly so it doesn't move exactly toward the player.
        # And rotate it randomly so it doesn't move exactly toward the player.
        rotate_y(rand_range(-PI / 4, PI / 4))
        rotate_y(rand_range(-PI / 4, PI / 4))
 
 
-We then calculate a random speed using "rand_range() "once again and we use it
+We then calculate a random speed using ``rand_range()`` once again and we use it
 to calculate the velocity.
 to calculate the velocity.
 
 
 We start by creating a 3D vector pointing forward, multiply it by our
 We start by creating a 3D vector pointing forward, multiply it by our
-"random_speed ", and finally rotate it using the "Vector3 "class's
+``random_speed``, and finally rotate it using the ``Vector3`` class's
 ``rotated()`` method.
 ``rotated()`` method.
 
 
 ::
 ::
@@ -188,7 +188,7 @@ leaves the screen.
 Our monster is ready to enter the game! In the next part, you will spawn
 Our monster is ready to enter the game! In the next part, you will spawn
 monsters in the game level.
 monsters in the game level.
 
 
-Here is the complete "Mob.gd "script for reference.
+Here is the complete ``Mob.gd`` script for reference.
 
 
 ::
 ::
 
 

+ 1 - 1
getting_started/first_3d_game/07.killing_player.rst

@@ -124,7 +124,7 @@ Starting with ``Main.gd``.
 
 
    extends Node
    extends Node
 
 
-   export (PackedScene) var mob_scene
+   export(PackedScene) var mob_scene
 
 
 
 
    func _ready():
    func _ready():

+ 4 - 4
getting_started/first_3d_game/08.score_and_replay.rst

@@ -27,7 +27,7 @@ tint the text.
 
 
 |image2|
 |image2|
 
 
-Pick a dark tone to it contrasts well with the 3D scene.
+Pick a dark tone so it contrasts well with the 3D scene.
 
 
 |image3|
 |image3|
 
 
@@ -77,7 +77,7 @@ In the *FileSystem* dock, Expand the ``fonts`` directory and click and drag the
 ``Montserrat-Medium.ttf`` file we included in the project onto the *Font Data*.
 ``Montserrat-Medium.ttf`` file we included in the project onto the *Font Data*.
 The text will reappear in the theme preview.
 The text will reappear in the theme preview.
 
 
-The text's a bit small. Set the *Settings -> Size* to ``22`` pixels to increase
+The text is a bit small. Set the *Settings -> Size* to ``22`` pixels to increase
 the text's size.
 the text's size.
 
 
 |image9|
 |image9|
@@ -133,7 +133,7 @@ There, we increment the score and update the displayed text.
        score += 1
        score += 1
        text = "Score: %s" % score
        text = "Score: %s" % score
 
 
-The second line uses the value of the' score' variable to replace the
+The second line uses the value of the ``score`` variable to replace the
 placeholder ``%s``. When using this feature, Godot automatically converts values
 placeholder ``%s``. When using this feature, Godot automatically converts values
 to text, which is convenient to output text in labels or using the ``print()``
 to text, which is convenient to output text in labels or using the ``print()``
 function.
 function.
@@ -228,7 +228,7 @@ Then, when the player gets hit, we show the overlay.
        $UserInterface/Retry.show()
        $UserInterface/Retry.show()
 
 
 Finally, when the *Retry* node is visible, we need to listen to the player's
 Finally, when the *Retry* node is visible, we need to listen to the player's
-input and restart the game if they press enter. To do this, we use the build-in
+input and restart the game if they press enter. To do this, we use the built-in
 ``_unhandled_input()`` callback.
 ``_unhandled_input()`` callback.
 
 
 If the player pressed the predefined ``ui_accept`` input action and *Retry* is
 If the player pressed the predefined ``ui_accept`` input action and *Retry* is