Merge branch 'master' into 3.2

This commit is contained in:
Rémi Verschelde
2020-09-28 15:43:06 +02:00
17 changed files with 280 additions and 48 deletions

View File

@@ -61,7 +61,7 @@ Dock in the lower left corner:
Player scene
------------
The first scene we will make defines the ``Player`` object. One of the benefits
The first scene will define the ``Player`` object. One of the benefits
of creating a separate Player scene is that we can test it separately, even
before we've created other parts of the game.
@@ -669,7 +669,8 @@ Main scene
----------
Now it's time to bring it all together. Create a new scene and add a
:ref:`Node <class_Node>` named ``Main``. Click the "Instance" button and select your
:ref:`Node <class_Node>` named ``Main``. Ensure you create a Node, **not** a
Node2D. Click the "Instance" button and select your
saved ``Player.tscn``.
.. image:: img/instance_scene.png
@@ -898,11 +899,11 @@ Note that a new instance must be added to the scene using ``add_child()``.
mobInstance.Position = mobSpawnLocation.Position;
// Add some randomness to the direction.
direction += GD.RandRange(-Mathf.Pi / 4, Mathf.Pi / 4);
direction += RandRange(-Mathf.Pi / 4, Mathf.Pi / 4);
mobInstance.Rotation = direction;
// Choose the velocity.
mobInstance.LinearVelocity = new Vector2(GD.RandRange(150f, 250f), 0).Rotated(direction);
mobInstance.LinearVelocity = new Vector2(RandRange(150f, 250f), 0).Rotated(direction);
}
.. important:: Why ``PI``? In functions requiring angles, GDScript uses *radians*,

View File

@@ -360,6 +360,8 @@ In inherited scenes, the only limitations for modifications are:
Other than that, everything is allowed!
.. _doc_importing_scenes_import_hints:
Import hints
------------
@@ -433,6 +435,11 @@ reliability.
on collision empties and set some distinct color for them in Blender's
**User Preferences > Themes > 3D View > Empty**.
.. seealso::
See :ref:`doc_collision_shapes_3d` for a comprehensive overview of collision
shapes.
Create navigation (-navmesh)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -329,7 +329,7 @@ accesses:
child.set_visible(false)
# Dynamic lookup, checks for method existence first.
if child.has("set_visible"):
if child.has_method("set_visible"):
child.set_visible(false)
# Cast check, followed by dynamic lookup
@@ -344,7 +344,7 @@ accesses:
# If one does not wish to fail these checks without notifying users, one
# can use an assert instead. These will trigger runtime errors
# immediately if not true.
assert(child.has("set_visible"))
assert(child.has_method("set_visible"))
assert(child.is_in_group("offer"))
assert(child is CanvasItem)

View File

@@ -101,6 +101,8 @@ option in the editor:
.. image:: img/exptemp.png
.. _doc_exporting_projects_export_mode:
Export mode
~~~~~~~~~~~

View File

@@ -90,6 +90,8 @@ using the ``load()`` and ``preload()`` methods.
Ignoring a folder will also automatically hide it from the FileSystem dock,
which can be useful to reduce clutter.
.. _doc_project_organization_case_sensitivity:
Case sensitivity
----------------