Explanations.tscn 929 B

12345678910111213141516171819202122
  1. [gd_scene format=3 uid="uid://bywptem1jb35a"]
  2. [node name="Explanations" type="RichTextLabel"]
  3. anchors_preset = 15
  4. anchor_right = 1.0
  5. anchor_bottom = 1.0
  6. offset_left = 10.0
  7. offset_top = -370.0
  8. offset_right = -10.0
  9. offset_bottom = -730.0
  10. size_flags_vertical = 4
  11. mouse_filter = 2
  12. bbcode_enabled = true
  13. text = "This example shows how to apply the State programming pattern in GDscript, including Hierarchical States, and a pushdown automaton.
  14. States are common in games. You can use the pattern to:
  15. 1. Separate each behavior and transitions between behaviors, thus make scripts shorter and easier to manage
  16. 2. Respect the Single Responsibility Principle. Each State object represents one action
  17. 3. Improve your code's structure. Look at the scene tree and FileSystem tab: without looking at the code, you'll know what the Player can or cannot do.
  18. You can read more about States in the excellent Game Programming Patterns ebook."