feat: Add core player input, movement, and special ability management systems with new UI components.
This commit is contained in:
@@ -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"):
|
||||
|
||||
Reference in New Issue
Block a user