feat: Add core player entity with movement, race, input, character selection, and multiplayer synchronization, integrating various game managers.

This commit is contained in:
Yogi Wiguna
2026-02-23 15:57:41 +08:00
parent 8a5c25be23
commit 3a5e6ad703
4 changed files with 54 additions and 66 deletions
+3 -2
View File
@@ -1594,13 +1594,14 @@ func _on_global_timer_updated(time_remaining: float):
@rpc("any_peer", "call_local", "reliable")
func sync_game_end_stop_n_go(winner_id: int):
print("[STOP n GO] Game ended! Winner: ", winner_id)
var winner_name = "Player " + str(winner_id)
var player_node = get_node_or_null(str(winner_id))
if player_node:
winner_name = player_node.display_name
# Broadcast win
add_message_to_bar("WINNER", winner_name + " Reached the Finish Line!", MessageType.GOAL)
# Broadcast win (Validation already done in check_win_condition)
add_message_to_bar("MATCH COMPLETE", winner_name + " Wins with 3 Missions!", MessageType.GOAL)
# Stop logic
if stop_n_go_manager:
+5 -4
View File
@@ -1311,10 +1311,11 @@ func start_movement_along_path(path: Array, clear_visual: bool = true):
# This ensures that when interpolation resumes (in _process), it pulls to the correct spot
target_visual_position = grid_to_world(current_position)
# Check if we've reached the finish line (uses lap-aware finish locations)
var current_finish_locs = race_manager.get_current_finish_locations() if race_manager else finish_locations
if current_position in current_finish_locs and can_finish:
finish_race()
# Racing Win Check (Skipped in Stop n Go which uses its own block above)
if LobbyManager.game_mode != "Stop n Go":
var current_finish_locs = race_manager.get_current_finish_locations() if race_manager else finish_locations
if current_position in current_finish_locs and can_finish:
finish_race()
var main = get_tree().get_root().get_node_or_null("Main")