feat: Introduce modular player system with dedicated managers for movement, race, input, playerboard, actions, special tiles, and powerups, along with a new main scene and documentation.
This commit is contained in:
@@ -55,8 +55,19 @@ func start_cycle():
|
||||
emit_signal("cycle_started")
|
||||
|
||||
if multiplayer.is_server():
|
||||
# Initialize scores for all connected players
|
||||
_initialize_player_scores()
|
||||
rpc("sync_cycle_start")
|
||||
|
||||
func _initialize_player_scores():
|
||||
"""Initialize scores for all connected players to 0."""
|
||||
var all_players = get_tree().get_nodes_in_group("Players")
|
||||
for player in all_players:
|
||||
var peer_id = player.get_multiplayer_authority()
|
||||
if not player_scores.has(peer_id):
|
||||
player_scores[peer_id] = 0
|
||||
_update_leaderboard()
|
||||
|
||||
@rpc("authority", "call_local", "reliable")
|
||||
func sync_cycle_start():
|
||||
current_cycle_timer = CYCLE_DURATION
|
||||
|
||||
Reference in New Issue
Block a user