feat: implement main game scene logic, including manager initialization, UI setup, networking, and message bar functionality.
This commit is contained in:
+9
-5
@@ -361,11 +361,8 @@ func _setup_host_game():
|
|||||||
# 1. PVT: Pre-calculate Static Tekton positions so we know where NOT to spawn players
|
# 1. PVT: Pre-calculate Static Tekton positions so we know where NOT to spawn players
|
||||||
_precalculate_static_positions()
|
_precalculate_static_positions()
|
||||||
|
|
||||||
# IMMEDIATELY assign random spawn positions before any player _ready() completes
|
# Delay spawn assignment until ALL players (including bots) are spawned
|
||||||
# Player _ready() has 0.1s await, so we assign before that completes
|
# Moved _assign_random_spawn_positions() to after bot loop
|
||||||
# IMMEDIATELY assign spawn positions (Fixed or Random)
|
|
||||||
# Always run this to ensure players don't spawn at (0,0) overlap
|
|
||||||
_assign_random_spawn_positions()
|
|
||||||
|
|
||||||
# Wait for players to be fully ready (player.gd has 0.1s await in _ready before managers init)
|
# Wait for players to be fully ready (player.gd has 0.1s await in _ready before managers init)
|
||||||
await get_tree().create_timer(0.3).timeout
|
await get_tree().create_timer(0.3).timeout
|
||||||
@@ -401,6 +398,13 @@ func _setup_host_game():
|
|||||||
for i in range(current_players + 1, GameStateManager.max_players + 1):
|
for i in range(current_players + 1, GameStateManager.max_players + 1):
|
||||||
_add_bot(i)
|
_add_bot(i)
|
||||||
|
|
||||||
|
# Ensure Bots are in the tree before assigning positions
|
||||||
|
await get_tree().process_frame
|
||||||
|
|
||||||
|
# NOW assign random spawn positions for EVERYONE (Host, Client, Bots)
|
||||||
|
# This ensures we respect the static tekton reserved zones for all characters
|
||||||
|
_assign_random_spawn_positions()
|
||||||
|
|
||||||
_start_game()
|
_start_game()
|
||||||
|
|
||||||
func _spawn_lobby_client_sync(peer_id: int):
|
func _spawn_lobby_client_sync(peer_id: int):
|
||||||
|
|||||||
Reference in New Issue
Block a user