Skip to content

Commit 373d164

Browse files
committed
Add a reminder on how to group nodes in the editor in Creating the enemy
1 parent ab1ec59 commit 373d164

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

getting_started/first_2d_game/04.creating_the_enemy.rst

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ Click Scene -> New Scene from the top menu and add the following nodes:
2222
- :ref:`VisibleOnScreenNotifier2D <class_VisibleOnScreenNotifier2D>`
2323

2424
Don't forget to set the children so they can't be selected, like you did with
25-
the Player scene.
25+
the Player scene. This is done by selecting the parent node (``RigidBody2D``) in the
26+
Scene tree dock, then using the :button:`Group` button at the top of the 2D editor
27+
(or pressing :kbd:`Ctrl + G`).
2628

2729
Select the ``Mob`` node and set its ``Gravity Scale``
2830
property in the :ref:`RigidBody2D <class_RigidBody2D>`
@@ -102,9 +104,9 @@ First, we get the list of animation names from the AnimatedSprite2D's ``sprite_f
102104
property. This returns an Array containing all three animation names: ``["walk",
103105
"swim", "fly"]``.
104106

105-
In the GDScript code, we use the :ref:`Array.pick_random <class_Array_method_pick_random>` method
106-
to select one of these animation names at random. Meanwhile, in the C# code, we pick a random number
107-
between ``0`` and ``2`` to select one of these names from the list (array indices start at ``0``). The
107+
In the GDScript code, we use the :ref:`Array.pick_random <class_Array_method_pick_random>` method
108+
to select one of these animation names at random. Meanwhile, in the C# code, we pick a random number
109+
between ``0`` and ``2`` to select one of these names from the list (array indices start at ``0``). The
108110
expression ``GD.Randi() % n`` selects a random integer between ``0`` and ``n-1``.
109111

110112
Finally, we call ``play()`` to start playing the chosen animation.

0 commit comments

Comments
 (0)