Add minimum jump height, fire rate configuration, and improve throw input handling

This commit is contained in:
2025-05-29 01:33:54 +02:00
parent 9b6a4f38bd
commit df154a786c
5 changed files with 9 additions and 2 deletions

View File

@@ -284,6 +284,7 @@ script = ExtResource("38_o1ihh")
health_component = NodePath("../HealthComponent") health_component = NodePath("../HealthComponent")
sprite = NodePath("../Graphics/Root/Base") sprite = NodePath("../Graphics/Root/Base")
platform_movement = NodePath("../Movements/PlatformMovement") platform_movement = NodePath("../Movements/PlatformMovement")
min_jump_height = 100.0
jump_reduction_percentage = 0.15 jump_reduction_percentage = 0.15
[connection signal="on_death" from="HealthComponent" to="PlayerDeathComponent" method="_on_health_component_on_death"] [connection signal="on_death" from="HealthComponent" to="PlayerDeathComponent" method="_on_health_component_on_death"]

View File

@@ -11,6 +11,7 @@ name = "BRICK_POWER"
description = "BRICK_POWER_DESCRIPTION" description = "BRICK_POWER_DESCRIPTION"
node = ExtResource("1_5gnea") node = ExtResource("1_5gnea")
config = { config = {
"fire_rate": 0.6,
"player_controller": NodePath("."), "player_controller": NodePath("."),
"throw_input_behavior": ExtResource("1_xwijh"), "throw_input_behavior": ExtResource("1_xwijh"),
"timer": NodePath("ThrowTimer") "timer": NodePath("ThrowTimer")

View File

@@ -40,6 +40,9 @@ func on_timer_timeout() -> void:
func throw_brick(power_multiplier: float = 1.0) -> void: func throw_brick(power_multiplier: float = 1.0) -> void:
if not can_throw:
return
var instance: Node2D = brick_scene.instantiate() var instance: Node2D = brick_scene.instantiate()
var init := instance.get_node_or_null("ProjectileInitComponent") as ProjectileInitComponent var init := instance.get_node_or_null("ProjectileInitComponent") as ProjectileInitComponent
if init and player_controller.current_movement is PlatformMovement: if init and player_controller.current_movement is PlatformMovement:

View File

@@ -1,6 +1,6 @@
class_name TapThrowInputResource class_name TapThrowInputResource
extends ThrowInputResource extends ThrowInputResource
func process_input(event: InputEvent) -> void: func update(_delta: float) -> void:
if event.is_action_pressed("attack"): if Input.is_action_pressed("attack"):
throw_requested.emit(1.0) throw_requested.emit(1.0)

View File

@@ -32,6 +32,8 @@ func _ready() -> void:
else: else:
continue_button.disabled = false continue_button.disabled = false
continue_button.grab_focus()
func _on_new_game_button_pressed() -> void: func _on_new_game_button_pressed() -> void:
if gm: if gm: