feat: Introduce an enhanced gridmap addon with procedural generation, pathfinding, and initial core game scripts and assets.

This commit is contained in:
Yogi Wiguna
2026-02-23 12:31:42 +08:00
parent f72f641332
commit 92fd76f4b8
7 changed files with 67 additions and 39 deletions
+9 -9
View File
@@ -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