|
1 | | -[gd_scene load_steps=5 format=2] |
| 1 | +[gd_scene load_steps=6 format=2] |
2 | 2 |
|
3 | 3 | [ext_resource path="res://player/Player.tscn" type="PackedScene" id=1] |
4 | | -[ext_resource path="res://debug/Explanations.tscn" type="PackedScene" id=2] |
| 4 | +[ext_resource path="res://fonts/source_code_pro_explanations.tres" type="DynamicFont" id=2] |
5 | 5 | [ext_resource path="res://debug/StatesStackDiplayer.tscn" type="PackedScene" id=3] |
6 | 6 | [ext_resource path="res://debug/ControlsPanel.tscn" type="PackedScene" id=4] |
| 7 | +[ext_resource path="res://fonts/source_code_pro_explanations_bold.tres" type="DynamicFont" id=5] |
7 | 8 |
|
8 | 9 | [node name="Demo" type="Node"] |
9 | 10 |
|
10 | 11 | [node name="Player" parent="." instance=ExtResource( 1 )] |
| 12 | +position = Vector2( 640, 400 ) |
11 | 13 |
|
12 | | -[node name="Explanations" parent="." instance=ExtResource( 2 )] |
| 14 | +[node name="Explanations" type="RichTextLabel" parent="."] |
| 15 | +anchor_right = 1.0 |
| 16 | +anchor_bottom = 1.0 |
| 17 | +margin_left = 10.0 |
| 18 | +margin_top = -370.0 |
| 19 | +margin_right = -10.0 |
| 20 | +margin_bottom = -730.0 |
| 21 | +rect_clip_content = false |
| 22 | +mouse_filter = 2 |
| 23 | +size_flags_vertical = 4 |
| 24 | +custom_fonts/bold_font = ExtResource( 5 ) |
| 25 | +custom_fonts/normal_font = ExtResource( 2 ) |
| 26 | +bbcode_enabled = true |
| 27 | +bbcode_text = "This example shows how to apply the State programming pattern in GDScript, including Hierarchical States, and a pushdown automaton. |
| 28 | +
|
| 29 | +States are common in games. You can use the pattern to: |
| 30 | +
|
| 31 | +1. Separate each behavior and transitions between behaviors, thus make scripts shorter and easier to manage |
| 32 | +2. Respect the Single Responsibility Principle. Each State object represents [b]one[/b] action |
| 33 | +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. |
| 34 | +
|
| 35 | +You can read more about States in the excellent [url=http://gameprogrammingpatterns.com/state.html]Game Programming Patterns ebook[/url]." |
| 36 | +text = "This example shows how to apply the State programming pattern in GDScript, including Hierarchical States, and a pushdown automaton. |
| 37 | +
|
| 38 | +States are common in games. You can use the pattern to: |
| 39 | +
|
| 40 | +1. Separate each behavior and transitions between behaviors, thus make scripts shorter and easier to manage |
| 41 | +2. Respect the Single Responsibility Principle. Each State object represents one action |
| 42 | +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. |
| 43 | +
|
| 44 | +You can read more about States in the excellent Game Programming Patterns ebook." |
| 45 | +__meta__ = { |
| 46 | +"_edit_lock_": true |
| 47 | +} |
13 | 48 |
|
14 | 49 | [node name="Control" type="Control" parent="."] |
15 | 50 | anchor_right = 1.0 |
|
0 commit comments