Minor refactor in player code

This commit is contained in:
RealMelwei 2025-10-14 14:45:39 +02:00
parent d9dae634ef
commit 2a346363eb

View file

@ -83,14 +83,14 @@ func _physics_process(delta: float) -> void:
manage_velocity(delta) manage_velocity(delta)
move_and_slide() move_and_slide()
func _process(delta: float) -> void: func _process(_delta: float) -> void:
# All non-velocity management can run without FPS cap # All non-velocity management can run without FPS cap
update_vine_statuses() update_vine_statuses()
manage_movement_options() manage_movement_options()
manage_interaction() manage_interaction()
manage_animation() manage_animation()
if handle_input: if handle_input:
manage_active(delta) manage_active()
manage_attack() manage_attack()
func manage_attack(): func manage_attack():
@ -104,7 +104,7 @@ func manage_attack():
$SwordSwingAudio.play() $SwordSwingAudio.play()
$AttackCooldown.start() $AttackCooldown.start()
func manage_active(_delta : float): func manage_active():
# Activate or remove items. Cooldown + use management is handled by the item. # Activate or remove items. Cooldown + use management is handled by the item.
if(active_item != null and Input.is_action_just_pressed("item") and $ActiveItemCooldown.is_stopped()): if(active_item != null and Input.is_action_just_pressed("item") and $ActiveItemCooldown.is_stopped()):
active_item.trigger_activation() active_item.trigger_activation()