Map attack to gamepad X, revise text in Finite State Machine demo (#937)

This commit is contained in:
David Briscoe
2023-10-17 17:53:17 -07:00
committed by GitHub
parent e2abd0e7fb
commit 3706e3e998
3 changed files with 4 additions and 4 deletions

View File

@@ -60,8 +60,8 @@ text = "This example shows how to apply the State programming pattern in GDScrip
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
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."

View File

@@ -17,7 +17,7 @@ grow_vertical = 2
[node name="Title" type="Label" parent="VBoxContainer"]
layout_mode = 2
text = "Pushown"
text = "StateStack"
uppercase = true
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]

View File

@@ -87,7 +87,7 @@ simulate_damage={
attack={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":70,"physical_keycode":0,"key_label":0,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":6,"pressure":0.0,"pressed":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":2,"pressure":0.0,"pressed":true,"script":null)
]
}