From b68b06802d140d9ca26f6114055851ba54ee3eeb Mon Sep 17 00:00:00 2001 From: David Payne <764161+dapayne1@users.noreply.github.com> Date: Mon, 10 Feb 2025 19:38:11 -0500 Subject: [PATCH 1/5] Add needed signal connection steps for timers --- .../first_2d_game/05.the_main_game_scene.rst | 23 ++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/getting_started/first_2d_game/05.the_main_game_scene.rst b/getting_started/first_2d_game/05.the_main_game_scene.rst index 2087cd474..baa8b9310 100644 --- a/getting_started/first_2d_game/05.the_main_game_scene.rst +++ b/getting_started/first_2d_game/05.the_main_game_scene.rst @@ -152,9 +152,26 @@ everything up for a new game: GetNode("StartTimer").Start(); } -Now connect the ``timeout()`` signal of each of the Timer nodes (``StartTimer``, -``ScoreTimer``, and ``MobTimer``) to the main script. ``StartTimer`` will start -the other two timers. ``ScoreTimer`` will increment the score by 1. +Now to connect the ``timeout()`` signal of each Timer node (``StartTimer``, +``ScoreTimer``, and ``MobTimer``) to the main script. For each of the three +timers, select the timer within the Main node in the Scene dock, and then +access the Node dock on the sidebar, making to have the Signals tab selected +in the Node dock, then find and double-click the ``timeout`` signal in the +list (or right-click and select "Connect..."). This will open a new signal +connection dialog. The default settings in this dialog should be fine, so +select 'Connect' to resolve the dialog box and make a new signal connection. + +Once all three timers have this set up, you should be able to see each timer +have a Signal connection for their respective ``timeout`` signal, showing in +green, within their respective Signals tabs: + +- (For MobTimer): ``_on_mob_timer_timeout()`` +- (For ScoreTimer): ``_on_score_timer_timeout()`` +- (For StartTimer): ``_on_start_timer_timeout()`` + +Now we define how each of these timers operate by adding the code below. Notice +that ``StartTimer`` will start the other two timers, and that ``ScoreTimer`` +will increment the score by 1. .. tabs:: .. code-tab:: gdscript GDScript From 5ed94a696cc60cb03dd15cb12fd38da2a689e54c Mon Sep 17 00:00:00 2001 From: David Payne <764161+dapayne1@users.noreply.github.com> Date: Tue, 11 Feb 2025 14:16:23 -0500 Subject: [PATCH 2/5] [trivial] Add a word --- .../first_2d_game/05.the_main_game_scene.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/getting_started/first_2d_game/05.the_main_game_scene.rst b/getting_started/first_2d_game/05.the_main_game_scene.rst index baa8b9310..b9c1771eb 100644 --- a/getting_started/first_2d_game/05.the_main_game_scene.rst +++ b/getting_started/first_2d_game/05.the_main_game_scene.rst @@ -155,11 +155,12 @@ everything up for a new game: Now to connect the ``timeout()`` signal of each Timer node (``StartTimer``, ``ScoreTimer``, and ``MobTimer``) to the main script. For each of the three timers, select the timer within the Main node in the Scene dock, and then -access the Node dock on the sidebar, making to have the Signals tab selected -in the Node dock, then find and double-click the ``timeout`` signal in the -list (or right-click and select "Connect..."). This will open a new signal -connection dialog. The default settings in this dialog should be fine, so -select 'Connect' to resolve the dialog box and make a new signal connection. +access the Node dock on the sidebar, making sure to have the Signals tab +selected in the Node dock, then find and double-click the ``timeout`` signal +in the list (or right-click and select "Connect..."). This will open a new +signal connection dialog. The default settings in this dialog should be fine, +so select 'Connect' to resolve the dialog box and create a new signal +connection. Once all three timers have this set up, you should be able to see each timer have a Signal connection for their respective ``timeout`` signal, showing in From e9c2533d05288f4556cd42f11fbd8384e4fe2c36 Mon Sep 17 00:00:00 2001 From: David Payne <764161+dapayne1@users.noreply.github.com> Date: Wed, 12 Feb 2025 19:20:11 -0500 Subject: [PATCH 3/5] Update getting_started/first_2d_game/05.the_main_game_scene.rst Co-authored-by: tetrapod <145553014+tetrapod00@users.noreply.github.com> --- getting_started/first_2d_game/05.the_main_game_scene.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/getting_started/first_2d_game/05.the_main_game_scene.rst b/getting_started/first_2d_game/05.the_main_game_scene.rst index b9c1771eb..79da51346 100644 --- a/getting_started/first_2d_game/05.the_main_game_scene.rst +++ b/getting_started/first_2d_game/05.the_main_game_scene.rst @@ -163,7 +163,7 @@ so select 'Connect' to resolve the dialog box and create a new signal connection. Once all three timers have this set up, you should be able to see each timer -have a Signal connection for their respective ``timeout`` signal, showing in +have a Signal connection for their respective ``timeout()`` signal, showing in green, within their respective Signals tabs: - (For MobTimer): ``_on_mob_timer_timeout()`` From ebc1bf3b1a5d39ae905491ab188abd5a23abb867 Mon Sep 17 00:00:00 2001 From: David Payne <764161+dapayne1@users.noreply.github.com> Date: Wed, 12 Feb 2025 19:20:17 -0500 Subject: [PATCH 4/5] Update getting_started/first_2d_game/05.the_main_game_scene.rst Co-authored-by: tetrapod <145553014+tetrapod00@users.noreply.github.com> --- .../first_2d_game/05.the_main_game_scene.rst | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/getting_started/first_2d_game/05.the_main_game_scene.rst b/getting_started/first_2d_game/05.the_main_game_scene.rst index 79da51346..24ea40784 100644 --- a/getting_started/first_2d_game/05.the_main_game_scene.rst +++ b/getting_started/first_2d_game/05.the_main_game_scene.rst @@ -154,13 +154,10 @@ everything up for a new game: Now to connect the ``timeout()`` signal of each Timer node (``StartTimer``, ``ScoreTimer``, and ``MobTimer``) to the main script. For each of the three -timers, select the timer within the Main node in the Scene dock, and then -access the Node dock on the sidebar, making sure to have the Signals tab -selected in the Node dock, then find and double-click the ``timeout`` signal -in the list (or right-click and select "Connect..."). This will open a new -signal connection dialog. The default settings in this dialog should be fine, -so select 'Connect' to resolve the dialog box and create a new signal -connection. +timers, select the timer in the Scene dock, open the Signals tab of the Node +dock, then double-click the ``timeout()`` signal in the list. This will open a new +signal connection dialog. The default settings in this dialog should be fine, so +select **Connect** to create a new signal connection. Once all three timers have this set up, you should be able to see each timer have a Signal connection for their respective ``timeout()`` signal, showing in From beb9e8af1eb44ab159aeaf22b4c451b4bb40e58a Mon Sep 17 00:00:00 2001 From: David Payne <764161+dapayne1@users.noreply.github.com> Date: Wed, 12 Feb 2025 20:22:30 -0500 Subject: [PATCH 5/5] [trivial] Fix flow with 'we' --- getting_started/first_2d_game/05.the_main_game_scene.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/getting_started/first_2d_game/05.the_main_game_scene.rst b/getting_started/first_2d_game/05.the_main_game_scene.rst index 24ea40784..763cf7fcc 100644 --- a/getting_started/first_2d_game/05.the_main_game_scene.rst +++ b/getting_started/first_2d_game/05.the_main_game_scene.rst @@ -152,7 +152,7 @@ everything up for a new game: GetNode("StartTimer").Start(); } -Now to connect the ``timeout()`` signal of each Timer node (``StartTimer``, +Now we'll connect the ``timeout()`` signal of each Timer node (``StartTimer``, ``ScoreTimer``, and ``MobTimer``) to the main script. For each of the three timers, select the timer in the Scene dock, open the Signals tab of the Node dock, then double-click the ``timeout()`` signal in the list. This will open a new