feat: Implement player input and movement managers for grid-based interaction and movement.
This commit is contained in:
@@ -102,7 +102,15 @@ func handle_unhandled_input(event):
|
||||
KEY_Q:
|
||||
if player.powerup_manager:
|
||||
# Attack Mode (formerly Special)
|
||||
# Now we want "Straight to Attack Mode" style
|
||||
|
||||
player.powerup_manager.use_special_effect()
|
||||
|
||||
# Force visual update / mutual exclusivity manually if powerup manager doesn't do it yet
|
||||
if player.is_attack_mode and player.has_method("enter_attack_mode"):
|
||||
# Re-triggering enter_attack_mode might be redundant but safely ensures visuals/Knock=False
|
||||
player.enter_attack_mode()
|
||||
|
||||
KEY_E:
|
||||
if player.powerup_manager:
|
||||
# Spawn Boost
|
||||
@@ -117,7 +125,10 @@ func handle_unhandled_input(event):
|
||||
else:
|
||||
player.grab_tekton()
|
||||
KEY_B:
|
||||
player.knock_tekton()
|
||||
if player.has_method("enter_knock_mode"):
|
||||
player.enter_knock_mode()
|
||||
else:
|
||||
player.knock_tekton()
|
||||
|
||||
# Handle spawn point selection if not yet selected
|
||||
|
||||
|
||||
@@ -81,6 +81,18 @@ func simple_move_to(grid_position: Vector2i) -> bool:
|
||||
var push_dir = grid_position - player.current_position
|
||||
if not try_push(grid_position, push_dir):
|
||||
return false
|
||||
|
||||
# Check for Tekton interaction (Knock Mode)
|
||||
# If moving into a Tekton's space while in Knock Mode, trigger knock
|
||||
if player.get("is_knock_mode"):
|
||||
# Find Tekton at grid_position
|
||||
var tektons = player.get_tree().get_nodes_in_group("Tektons")
|
||||
for t in tektons:
|
||||
if t.current_position == grid_position and not t.is_carried:
|
||||
# Trigger Knock
|
||||
player.knock_tekton()
|
||||
return false # Don't move into the tile, just knock
|
||||
|
||||
|
||||
rotate_towards_target(grid_position)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user