From 8916cbd4b2e8661288a3e7a180f7608bc25ee627 Mon Sep 17 00:00:00 2001 From: skyace65 Date: Sun, 10 Mar 2024 11:30:30 -0400 Subject: [PATCH] Unify C# naming notes and comments --- .../first_2d_game/03.coding_the_player.rst | 1 + .../first_2d_game/04.creating_the_enemy.rst | 1 + .../first_2d_game/05.the_main_game_scene.rst | 3 +++ .../first_2d_game/06.heads_up_display.rst | 2 ++ .../first_3d_game/03.player_movement_code.rst | 11 +++++++++++ getting_started/first_3d_game/04.mob_scene.rst | 4 ++-- getting_started/first_3d_game/05.spawning_mobs.rst | 2 +- .../first_3d_game/07.killing_player.rst | 4 ++-- getting_started/step_by_step/signals.rst | 14 ++++++++++++++ 9 files changed, 37 insertions(+), 5 deletions(-) diff --git a/getting_started/first_2d_game/03.coding_the_player.rst b/getting_started/first_2d_game/03.coding_the_player.rst index a28ef816b5b..adcb9e5e9e8 100644 --- a/getting_started/first_2d_game/03.coding_the_player.rst +++ b/getting_started/first_2d_game/03.coding_the_player.rst @@ -407,6 +407,7 @@ Next, add this code to the function: .. code-tab:: csharp + // We also specified this function name in PascalCase in the editor's connection window. private void OnBodyEntered(Node2D body) { Hide(); // Player disappears after being hit. diff --git a/getting_started/first_2d_game/04.creating_the_enemy.rst b/getting_started/first_2d_game/04.creating_the_enemy.rst index e336bd1136a..72355e85d34 100644 --- a/getting_started/first_2d_game/04.creating_the_enemy.rst +++ b/getting_started/first_2d_game/04.creating_the_enemy.rst @@ -117,6 +117,7 @@ to the ``Mob`` and add this code: .. code-tab:: csharp + // We also specified this function name in PascalCase in the editor's connection window. private void OnVisibleOnScreenNotifier2DScreenExited() { QueueFree(); 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 5df4c279caf..a450ad2f8cb 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 @@ -168,11 +168,13 @@ the other two timers. ``ScoreTimer`` will increment the score by 1. .. code-tab:: csharp + // We also specified this function name in PascalCase in the editor's connection window. private void OnScoreTimerTimeout() { _score++; } + // We also specified this function name in PascalCase in the editor's connection window. private void OnStartTimerTimeout() { GetNode("MobTimer").Start(); @@ -219,6 +221,7 @@ Note that a new instance must be added to the scene using ``add_child()``. .. code-tab:: csharp + // We also specified this function name in PascalCase in the editor's connection window. private void OnMobTimerTimeout() { // Note: Normally it is best to use explicit types rather than the `var` diff --git a/getting_started/first_2d_game/06.heads_up_display.rst b/getting_started/first_2d_game/06.heads_up_display.rst index f94e58a06e6..35ce6bd6cca 100644 --- a/getting_started/first_2d_game/06.heads_up_display.rst +++ b/getting_started/first_2d_game/06.heads_up_display.rst @@ -199,12 +199,14 @@ signal of ``MessageTimer``, and add the following code to the new functions: .. code-tab:: csharp + // We also specified this function name in PascalCase in the editor's connection window. private void OnStartButtonPressed() { GetNode