feat: Implement player movement, rotation, and advanced push mechanics with new PlayerMovementManager, StopNGoManager, and player scene script.

This commit is contained in:
Yogi Wiguna
2026-02-23 12:55:02 +08:00
parent 92fd76f4b8
commit c8e7be8c6a
3 changed files with 15 additions and 13 deletions
+11
View File
@@ -1257,6 +1257,17 @@ func move_player_to_clicked_position(grid_position: Vector2i):
@rpc("any_peer", "call_local")
func start_movement_along_path(path: Array, clear_visual: bool = true):
# SERVER-SIDE VIOLATION CHECK (for Stop n Go)
if multiplayer.is_server() and LobbyManager.game_mode == "Stop n Go":
var main = get_tree().root.get_node_or_null("Main")
if main:
var sng_manager = main.get_node_or_null("StopNGoManager")
if sng_manager and sng_manager.has_method("check_movement_violation"):
# Check if the START of this movement is a violation
# We use current_position as the 'from' point.
var target_pos = Vector2i(path[0].x, path[0].y) if path.size() > 0 else current_position
sng_manager.check_movement_violation(name.to_int(), current_position, target_pos)
is_player_moving = true
if path.size() > 0:
target_position = Vector2i(path[-1].x, path[-1].y)