feat: Introduce an enhanced gridmap addon with procedural generation, pathfinding, and initial core game scripts and assets.
This commit is contained in:
+15
-1
@@ -444,7 +444,11 @@ func _setup_client_game():
|
||||
print("Client setup - my peer ID: ", my_id)
|
||||
|
||||
# INITIALIZE ARENA SIZE for Stop n Go locally to prevent out-of-bounds before sync arrives
|
||||
if LobbyManager.game_mode == "Stop n Go" and stop_n_go_manager:
|
||||
if LobbyManager.game_mode == "Stop n Go":
|
||||
if not stop_n_go_manager:
|
||||
stop_n_go_manager = load("res://scripts/managers/stop_n_go_manager.gd").new()
|
||||
stop_n_go_manager.name = "StopNGoManager"
|
||||
add_child(stop_n_go_manager)
|
||||
stop_n_go_manager._apply_arena_setup()
|
||||
|
||||
# Pre-spawn ALL players known from LobbyManager (including Host ID 1)
|
||||
@@ -1503,9 +1507,19 @@ func sync_full_grid_data(data: PackedInt32Array):
|
||||
if not enhanced_gridmap:
|
||||
print("[Main] Error: EnhancedGridMap not found!")
|
||||
return
|
||||
|
||||
# Reapply deterministic Floor 0 before syncing Floor 1 items
|
||||
if LobbyManager.game_mode == "Stop n Go":
|
||||
if not stop_n_go_manager:
|
||||
stop_n_go_manager = load("res://scripts/managers/stop_n_go_manager.gd").new()
|
||||
stop_n_go_manager.name = "StopNGoManager"
|
||||
add_child(stop_n_go_manager)
|
||||
stop_n_go_manager._apply_arena_setup()
|
||||
|
||||
# Apply the synced data to Floor 1
|
||||
enhanced_gridmap.set_floor_data(1, data)
|
||||
enhanced_gridmap.update_grid_data()
|
||||
enhanced_gridmap.initialize_astar()
|
||||
print("[Main] Grid sync complete.")
|
||||
|
||||
|
||||
|
||||
+9
-9
@@ -559,9 +559,10 @@ func receive_spawn_positions_update(occupied_positions: Array):
|
||||
if pos in occupied_positions:
|
||||
highlighted_spawn_points.erase(pos)
|
||||
if enhanced_gridmap:
|
||||
# Clear the highlight from Layer 2 (Overlay) instead of overwriting Floor 0
|
||||
enhanced_gridmap.set_cell_item(
|
||||
Vector3i(pos.x, 0, pos.y),
|
||||
enhanced_gridmap.normal_items[0]
|
||||
Vector3i(pos.x, 2, pos.y),
|
||||
-1
|
||||
)
|
||||
|
||||
# Now highlight available positions
|
||||
@@ -1141,11 +1142,10 @@ func clear_spawn_highlights():
|
||||
# Clear the highlighted spawn points array
|
||||
for spawn_pos in highlighted_spawn_points:
|
||||
if enhanced_gridmap:
|
||||
# Reset the cell to its original state
|
||||
var cell_item = enhanced_gridmap.get_cell_item(Vector3i(spawn_pos.x, 1, spawn_pos.y))
|
||||
# Clear Layer 2 (Overlay Highlight) instead of potentially overwriting Layer 0
|
||||
enhanced_gridmap.set_cell_item(
|
||||
Vector3i(spawn_pos.x, 0, spawn_pos.y),
|
||||
enhanced_gridmap.normal_items[0] if cell_item != -1 else -1
|
||||
Vector3i(spawn_pos.x, 2, spawn_pos.y),
|
||||
-1
|
||||
)
|
||||
|
||||
# Clear the array
|
||||
@@ -1662,11 +1662,11 @@ func notify_spawn_selected(spawn_pos: Vector2i):
|
||||
if spawn_pos in highlighted_spawn_points:
|
||||
highlighted_spawn_points.erase(spawn_pos)
|
||||
|
||||
# Clear highlight for the selected position
|
||||
# Clear highlight for the selected position on Layer 2 (Overlay)
|
||||
if enhanced_gridmap:
|
||||
enhanced_gridmap.set_cell_item(
|
||||
Vector3i(spawn_pos.x, 0, spawn_pos.y),
|
||||
enhanced_gridmap.normal_items[0]
|
||||
Vector3i(spawn_pos.x, 2, spawn_pos.y),
|
||||
-1
|
||||
)
|
||||
|
||||
# Disabled, auto put activated
|
||||
|
||||
Reference in New Issue
Block a user