diff --git a/learning/step_by_step/files/ui_code_life_bar.zip b/learning/step_by_step/files/ui_code_life_bar.zip index 9a6de659f..6c6b3b7d4 100644 Binary files a/learning/step_by_step/files/ui_code_life_bar.zip and b/learning/step_by_step/files/ui_code_life_bar.zip differ diff --git a/learning/step_by_step/files/ui_gui_design.zip b/learning/step_by_step/files/ui_gui_design.zip index 6a4616efc..065f19399 100644 Binary files a/learning/step_by_step/files/ui_gui_design.zip and b/learning/step_by_step/files/ui_gui_design.zip differ diff --git a/learning/step_by_step/files/ui_main_menu_design.zip b/learning/step_by_step/files/ui_main_menu_design.zip index e5531cc0b..f734dd5b3 100644 Binary files a/learning/step_by_step/files/ui_main_menu_design.zip and b/learning/step_by_step/files/ui_main_menu_design.zip differ diff --git a/learning/step_by_step/ui_code_a_life_bar.rst b/learning/step_by_step/ui_code_a_life_bar.rst index 3986d2cef..cf81c8613 100644 --- a/learning/step_by_step/ui_code_a_life_bar.rst +++ b/learning/step_by_step/ui_code_a_life_bar.rst @@ -53,7 +53,7 @@ To do this, we will use **signals**. .. note:: Signals are Godot's version of the Observer pattern. They allow us to send out some message. Other nodes can connect to the object that **emits** the signal and receive the information. It's a powerful tool we use a lot for User Interface and achievement systems. You don't want to use them everywhere though. Connecting two nodes adds some coupling between them. When there's a lot of connections, they become hard to manage. - For more information on check out the [ signals video tutorial ](https://youtu.be/l0BkQxF7X3E) on GDquest. + For more information on check out the `signals video tutorial `_ on GDquest. Download and explore the start project -------------------------------------- @@ -193,8 +193,8 @@ of information. And you will update the state of your connected node .. note:: The Observer pattern, that signals derive from, still adds a bit of coupling between node branches. But it's generally lighter and more secure than accessing nodes directly to communicate between two separate classes. It can be okay for a parent node to get values from its children. But you'll want to favor signals if you're working with two separate branches. - Read Game Programming Patterns for more information on the [ Observer pattern ](http://gameprogrammingpatterns.com/observer.html). - The [ full book ](http://gameprogrammingpatterns.com/contents.html) is available online for free. + Read Game Programming Patterns for more information on the `Observer pattern `_. + The `full book `_ is available online for free. With this in mind let's connect the ``GUI`` to the ``Player``. Click on the ``Player`` node in the scene dock to select it. Head down to the @@ -240,7 +240,7 @@ at the bottom of the window. Godot creates the method inside the ``GUI`` node. The script editor opens with the cursor inside a new ``_on_player_health_changed`` function. -.. note:: +.. note:: When you connect nodes from the editor, Godot generates a method name with the following pattern: ``_on_EmitterName_signal_name``. @@ -294,7 +294,7 @@ This method needs to: number_label.text = str(new_value) bar.value = new_value -.. tip:: +.. tip:: ``str`` is a built-in function that converts about any value to text. ``Number``'s ``text`` property requires a string so we can't