feat: implement a player movement manager handling grid-based movement, rotation, and push interactions.
This commit is contained in:
@@ -62,6 +62,11 @@ func simple_move_to(grid_position: Vector2i) -> bool:
|
||||
print("[Move] Failed: Player is frozen")
|
||||
return false
|
||||
|
||||
# BLOCK MOVEMENT IF MATCH NOT ACTIVE (Countdown)
|
||||
var main = player.get_tree().root.get_node_or_null("Main")
|
||||
if main and main.goals_cycle_manager and not main.goals_cycle_manager.is_match_active:
|
||||
return false
|
||||
|
||||
|
||||
var distance: int
|
||||
if use_diagonal_movement:
|
||||
@@ -248,6 +253,11 @@ func move_to_clicked_position(grid_position: Vector2i) -> bool:
|
||||
# Check if player is frozen
|
||||
if player.get("is_frozen") or player.get("is_stop_frozen"):
|
||||
return false
|
||||
|
||||
# BLOCK MOVEMENT IF MATCH NOT ACTIVE (Countdown)
|
||||
var main = player.get_tree().root.get_node_or_null("Main")
|
||||
if main and main.goals_cycle_manager and not main.goals_cycle_manager.is_match_active:
|
||||
return false
|
||||
|
||||
# Validate grid position is within bounds
|
||||
if not enhanced_gridmap.is_position_valid(grid_position):
|
||||
|
||||
Reference in New Issue
Block a user