Skip to content

Commit 3bacda4

Browse files
authored
Merge pull request #10667 from dapayne1/patch-1
Add Needed Signal Connection Steps for Timers
2 parents 70def63 + beb9e8a commit 3bacda4

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

getting_started/first_2d_game/05.the_main_game_scene.rst

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,24 @@ everything up for a new game:
152152
GetNode<Timer>("StartTimer").Start();
153153
}
154154

155-
Now connect the ``timeout()`` signal of each of the Timer nodes (``StartTimer``,
156-
``ScoreTimer``, and ``MobTimer``) to the main script. ``StartTimer`` will start
157-
the other two timers. ``ScoreTimer`` will increment the score by 1.
155+
Now we'll connect the ``timeout()`` signal of each Timer node (``StartTimer``,
156+
``ScoreTimer``, and ``MobTimer``) to the main script. For each of the three
157+
timers, select the timer in the Scene dock, open the Signals tab of the Node
158+
dock, then double-click the ``timeout()`` signal in the list. This will open a new
159+
signal connection dialog. The default settings in this dialog should be fine, so
160+
select **Connect** to create a new signal connection.
161+
162+
Once all three timers have this set up, you should be able to see each timer
163+
have a Signal connection for their respective ``timeout()`` signal, showing in
164+
green, within their respective Signals tabs:
165+
166+
- (For MobTimer): ``_on_mob_timer_timeout()``
167+
- (For ScoreTimer): ``_on_score_timer_timeout()``
168+
- (For StartTimer): ``_on_start_timer_timeout()``
169+
170+
Now we define how each of these timers operate by adding the code below. Notice
171+
that ``StartTimer`` will start the other two timers, and that ``ScoreTimer``
172+
will increment the score by 1.
158173

159174
.. tabs::
160175
.. code-tab:: gdscript GDScript

0 commit comments

Comments
 (0)