feat: Implement core game systems including settings management, player input, and initial gameplay mechanics with associated UI.

This commit is contained in:
Yogi Wiguna
2026-03-12 10:35:26 +08:00
parent 4f6783b468
commit 93eda69ad6
10 changed files with 218 additions and 155 deletions
+14 -8
View File
@@ -1012,6 +1012,20 @@ func activate_powerup(effect_id: int):
if st_manager:
st_manager.activate_effect(effect_id)
func activate_held_powerup():
"""Finds whichever powerup is currently held and activates it."""
var active_effect = -1
if special_tiles_manager:
for effect_key in special_tiles_manager.inventory:
if special_tiles_manager.inventory[effect_key]:
active_effect = effect_key
break
if active_effect != -1:
activate_powerup(active_effect)
else:
print("[Player] No powerup currently held to activate.")
func _process(delta):
# Failsafe: Ensure player is visible if spawn point is selected and random spawn is active
@@ -1118,14 +1132,6 @@ func _physics_process(delta):
# --------------------------------------------------------------------
func _unhandled_input(event):
# Handle power-up usage
if event.is_action_pressed("use_powerup") and is_multiplayer_authority():
if is_frozen or is_stop_frozen:
return
if powerup_manager and powerup_manager.can_use_special():
powerup_manager.use_special_effect()
return
if input_manager:
input_manager.handle_unhandled_input(event)