pandemonium_demo_projects/2d/finite_state_machine/Demo.tscn

61 lines
2.5 KiB
Plaintext

[gd_scene load_steps=6 format=2]
[ext_resource path="res://player/Player.tscn" type="PackedScene" id=1]
[ext_resource path="res://fonts/source_code_pro_explanations.tres" type="DynamicFont" id=2]
[ext_resource path="res://debug/StatesStackDiplayer.tscn" type="PackedScene" id=3]
[ext_resource path="res://debug/ControlsPanel.tscn" type="PackedScene" id=4]
[ext_resource path="res://fonts/source_code_pro_explanations_bold.tres" type="DynamicFont" id=5]
[node name="Demo" type="Node"]
[node name="Player" parent="." instance=ExtResource( 1 )]
position = Vector2( 640, 400 )
[node name="Explanations" type="RichTextLabel" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 10.0
margin_top = -370.0
margin_right = -10.0
margin_bottom = -730.0
rect_clip_content = false
mouse_filter = 2
size_flags_vertical = 4
custom_fonts/normal_font = ExtResource( 2 )
custom_fonts/bold_font = ExtResource( 5 )
bbcode_enabled = true
bbcode_text = "This example shows how to apply the State programming pattern in GDScript, including Hierarchical States, and a pushdown automaton.
States are common in games. You can use the pattern to:
1. Separate each behavior and transitions between behaviors, thus make scripts shorter and easier to manage
2. Respect the Single Responsibility Principle. Each State object represents [b]one[/b] action
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.
You can read more about States in the excellent [url=http://gameprogrammingpatterns.com/state.html]Game Programming Patterns ebook[/url]."
text = "This example shows how to apply the State programming pattern in GDScript, including Hierarchical States, and a pushdown automaton.
States are common in games. You can use the pattern to:
1. Separate each behavior and transitions between behaviors, thus make scripts shorter and easier to manage
2. Respect the Single Responsibility Principle. Each State object represents one action
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.
You can read more about States in the excellent Game Programming Patterns ebook."
__meta__ = {
"_edit_lock_": true
}
[node name="Control" type="Control" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="StatesStackDiplayer" parent="Control" instance=ExtResource( 3 )]
[node name="ControlsPanel" parent="Control" instance=ExtResource( 4 )]
[editable path="Player"]