feat: Add core player input, movement, and special ability management systems with new UI components.

This commit is contained in:
Yogi Wiguna
2026-03-11 17:40:45 +08:00
parent 18c3dbecd6
commit 650d241a72
6 changed files with 104 additions and 90 deletions
+21 -14
View File
@@ -114,22 +114,29 @@ func handle_unhandled_input(event):
# Unified check for PowerUp keys
if ek == key_p1:
player.activate_powerup(0) # FASTER_SPEED
elif ek == key_p2:
if is_sng:
player.activate_powerup(3) # Ghost for SNG P2
else:
player.activate_powerup(2) # Wall for Normal P2
elif ek == key_p3 and not is_sng:
player.activate_powerup(1) # AREA_FREEZE
elif ek == key_p4 and not is_sng:
player.activate_powerup(3) # INVISIBLE_MODE
# Single Slot Logic: Find whatever powerup is currently set to 'true' and activate it
var active_effect = -1
if player.special_tiles_manager:
for effect_key in player.special_tiles_manager.inventory:
if player.special_tiles_manager.inventory[effect_key]:
active_effect = effect_key
break
# Non-Remappable variants (Numpad) - Optional fallback
if active_effect != -1:
player.activate_powerup(active_effect)
else:
print("No powerup in slot 1 to activate.")
# KP Fallback
elif ek == KEY_KP_1:
player.activate_powerup(0)
elif ek == KEY_KP_2:
player.activate_powerup(3 if is_sng else 2)
var active_effect = -1
if player.special_tiles_manager:
for effect_key in player.special_tiles_manager.inventory:
if player.special_tiles_manager.inventory[effect_key]:
active_effect = effect_key
break
if active_effect != -1:
player.activate_powerup(active_effect)
# Action Buttons (Remappable)
elif ek == SettingsManager.get_control_keycode("attack_mode"):