feat: Create player input and powerup managers to handle player interactions, movement, actions, targeting, and boost meter mechanics.

This commit is contained in:
Yogi Wiguna
2026-03-05 14:29:34 +08:00
parent ebfa8f99a7
commit fb6d9df5db
7 changed files with 51 additions and 48 deletions
+9 -3
View File
@@ -156,6 +156,11 @@ func use_special_effect() -> bool:
if not can_use_special():
return false
# Restriction: Cannot use attack mode while carrying a Tekton
if player.is_carrying_tekton:
NotificationManager.send_message(player, "Cannot enter Attack Mode while carrying a Tekton!", NotificationManager.MessageType.WARNING)
return false
# Enable Attack Mode explicitly
player.is_attack_mode = true
# Do NOT consume boost here. Boost acts as "fuel" for the attacks.
@@ -183,14 +188,15 @@ func spawn_boost_reward() -> bool:
return false
if player.special_tiles_manager and player.special_tiles_manager.has_method("spawn_powerups_around"):
# Spawn only common tiles (7-10) with 100% density
player.special_tiles_manager.spawn_powerups_around(player.current_position, true, true, true)
# Spawn tiles (Stop N Go gets only common, Free Mode gets 60/40 ratio)
player.special_tiles_manager.spawn_powerups_around(player.current_position, true, false, true)
# Drop the Tekton after spawning
if player.has_method("drop_tekton"):
player.drop_tekton()
print("[PowerUp] %s used Tekton to SPAWN TILES (100%% Density Common)." % player.name)
reset_boost()
print("[PowerUp] %s used Tekton to SPAWN TILES and consumed Boost." % player.name)
return true
return false