From cf428866820896906a3d843ab32d23950f768d17 Mon Sep 17 00:00:00 2001 From: Diego De la Viuda Llorente Date: Fri, 16 Oct 2026 12:47:27 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9E=95ADD:=20botones=20para=20los=20ataques?= =?UTF-8?q?=20especiales?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/mobile_controls/mobile_controls.gd | 6 ++++ ui/mobile_controls/mobile_controls.tscn | 48 +++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/ui/mobile_controls/mobile_controls.gd b/ui/mobile_controls/mobile_controls.gd index f783b4c..c3f03f5 100644 --- a/ui/mobile_controls/mobile_controls.gd +++ b/ui/mobile_controls/mobile_controls.gd @@ -18,6 +18,8 @@ extends CanvasLayer @onready var move_right_button: Button = $Controls/MoveRight @onready var jump_button: Button = $Controls/Jump @onready var attack_button: Button = $Controls/Attack +@onready var ground_pound_button: Button = $Controls/GroundPound +@onready var special_attack_button: Button = $Controls/SpecialAttack var direction_touch_index: int = -1 @@ -25,6 +27,8 @@ var direction_touch_index: int = -1 func _ready() -> void: _bind_button(jump_button, &"jump") _bind_button(attack_button, &"attack") + _bind_button(ground_pound_button, &"ground_pound") + _bind_button(special_attack_button, &"special_attack") func _input(event: InputEvent) -> void: @@ -53,6 +57,8 @@ func _exit_tree() -> void: Input.action_release(&"move_right") Input.action_release(&"jump") Input.action_release(&"attack") + Input.action_release(&"ground_pound") + Input.action_release(&"special_attack") func _direction_at(position: Vector2) -> StringName: diff --git a/ui/mobile_controls/mobile_controls.tscn b/ui/mobile_controls/mobile_controls.tscn index 84794ba..910d765 100644 --- a/ui/mobile_controls/mobile_controls.tscn +++ b/ui/mobile_controls/mobile_controls.tscn @@ -132,3 +132,51 @@ theme_override_styles/pressed = SubResource("ButtonPressed") icon = ExtResource("5_attack") expand_icon = true icon_max_width = 48 + +[node name="GroundPound" type="Button" parent="Controls"] +layout_mode = 0 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -264.0 +offset_top = -200.0 +offset_right = -154.0 +offset_bottom = -100.0 +grow_horizontal = 0 +grow_vertical = 0 +focus_mode = 0 +keep_pressed_outside = true +theme_override_colors/font_color = Color(1, 1, 1, 0.95) +theme_override_colors/font_pressed_color = Color(1, 1, 1, 1) +theme_override_font_sizes/font_size = 18 +theme_override_styles/normal = SubResource("ButtonNormal") +theme_override_styles/hover = SubResource("ButtonNormal") +theme_override_styles/pressed = SubResource("ButtonPressed") +text = "GP" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="SpecialAttack" type="Button" parent="Controls"] +layout_mode = 0 +anchor_left = 1.0 +anchor_top = 1.0 +anchor_right = 1.0 +anchor_bottom = 1.0 +offset_left = -138.0 +offset_top = -200.0 +offset_right = -28.0 +offset_bottom = -100.0 +grow_horizontal = 0 +grow_vertical = 0 +focus_mode = 0 +keep_pressed_outside = true +theme_override_colors/font_color = Color(1, 1, 1, 0.95) +theme_override_colors/font_pressed_color = Color(1, 1, 1, 1) +theme_override_font_sizes/font_size = 18 +theme_override_styles/normal = SubResource("ButtonNormal") +theme_override_styles/hover = SubResource("ButtonNormal") +theme_override_styles/pressed = SubResource("ButtonPressed") +text = "SP" +horizontal_alignment = 1 +vertical_alignment = 1