feat: introduce core player logic with manager integration and power-up inventory UI.

This commit is contained in:
Yogi Wiguna
2026-03-04 15:56:03 +08:00
parent a78acd12b8
commit 8f03cc15c5
5 changed files with 123 additions and 174 deletions
+10 -18
View File
@@ -95,24 +95,16 @@ func handle_unhandled_input(event):
if event is InputEventKey and event.pressed and not event.echo:
match event.keycode:
KEY_KP_1, KEY_1, KEY_KP_2, KEY_2, KEY_KP_3, KEY_3, KEY_KP_4, KEY_4:
var mode = LobbyManager.get_game_mode()
var is_restricted = GameMode.is_restricted(mode)
if is_restricted:
match event.keycode:
KEY_KP_1, KEY_1:
player.activate_powerup(0) # FASTER_SPEED
KEY_KP_2, KEY_2:
player.activate_powerup(3) # INVISIBLE_MODE (Ghost is now 2)
else:
match event.keycode:
KEY_KP_1, KEY_1:
player.activate_powerup(0) # FASTER_SPEED
KEY_KP_2, KEY_2:
player.activate_powerup(2) # BLOCK_FLOOR
KEY_KP_3, KEY_3:
player.activate_powerup(1) # AREA_FREEZE
KEY_KP_4, KEY_4:
player.activate_powerup(3) # INVISIBLE_MODE
# Unified Mapping for all modes: 1-Speed, 2-Wall, 3-Freeze, 4-Ghost
match event.keycode:
KEY_KP_1, KEY_1:
player.activate_powerup(0) # FASTER_SPEED
KEY_KP_2, KEY_2:
player.activate_powerup(2) # BLOCK_FLOOR
KEY_KP_3, KEY_3:
player.activate_powerup(1) # AREA_FREEZE
KEY_KP_4, KEY_4:
player.activate_powerup(3) # INVISIBLE_MODE
# KEY_R:
# player.auto_put_item()
KEY_Q: