mirror of
https://github.com/godotengine/godot-demo-projects.git
synced 2026-01-04 15:00:09 +01:00
This also improves visuals in the Voxel and Dynamic Split Screen demos, and fixes splitscreen mode in the Platformer 2D demo. Most demos (other than physics tests) have also had their physics FPS increased to 120. This is done consistency with 4.x, but also for the benefits it still provides when interpolation are enabled (lower input lag, more stable simulation).
58 lines
2.5 KiB
Plaintext
58 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/bold_font = ExtResource( 5 )
|
|
custom_fonts/normal_font = ExtResource( 2 )
|
|
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
|
|
|
|
[node name="StatesStackDiplayer" parent="Control" instance=ExtResource( 3 )]
|
|
|
|
[node name="ControlsPanel" parent="Control" instance=ExtResource( 4 )]
|
|
|
|
[editable path="Player"]
|