From 3706e3e998a67775eababc3fc310cbc985f3f100 Mon Sep 17 00:00:00 2001 From: David Briscoe <43559+idbrii@users.noreply.github.com> Date: Tue, 17 Oct 2023 17:53:17 -0700 Subject: [PATCH] Map attack to gamepad X, revise text in Finite State Machine demo (#937) --- 2d/finite_state_machine/Demo.tscn | 4 ++-- 2d/finite_state_machine/debug/StatesStackDiplayer.tscn | 2 +- 2d/finite_state_machine/project.godot | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/2d/finite_state_machine/Demo.tscn b/2d/finite_state_machine/Demo.tscn index fd5ab0c5..ca5d6efc 100644 --- a/2d/finite_state_machine/Demo.tscn +++ b/2d/finite_state_machine/Demo.tscn @@ -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." diff --git a/2d/finite_state_machine/debug/StatesStackDiplayer.tscn b/2d/finite_state_machine/debug/StatesStackDiplayer.tscn index 6148761d..d4a90490 100644 --- a/2d/finite_state_machine/debug/StatesStackDiplayer.tscn +++ b/2d/finite_state_machine/debug/StatesStackDiplayer.tscn @@ -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"] diff --git a/2d/finite_state_machine/project.godot b/2d/finite_state_machine/project.godot index 6dbede2b..3a6aee45 100644 --- a/2d/finite_state_machine/project.godot +++ b/2d/finite_state_machine/project.godot @@ -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) ] }