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
+4 -10
View File
@@ -105,7 +105,7 @@ func highlight_empty_adjacent_cells():
var current_cell = Vector3i(player.current_position.x, 1, player.current_position.y)
if enhanced_gridmap.get_cell_item(current_cell) == -1:
highlighted_cells.append(player.current_position)
enhanced_gridmap.set_cell_item(Vector3i(player.current_position.x, 0, player.current_position.y),
enhanced_gridmap.set_cell_item(Vector3i(player.current_position.x, 2, player.current_position.y),
enhanced_gridmap.hover_item)
print("Highlighted current position: ", player.current_position)
@@ -117,7 +117,7 @@ func highlight_empty_adjacent_cells():
var cell = Vector3i(cell_pos.x, 1, cell_pos.y)
if enhanced_gridmap.get_cell_item(cell) == -1: # Check if cell is empty
highlighted_cells.append(cell_pos)
enhanced_gridmap.set_cell_item(Vector3i(cell_pos.x, 0, cell_pos.y),
enhanced_gridmap.set_cell_item(Vector3i(cell_pos.x, 2, cell_pos.y),
enhanced_gridmap.hover_item)
print("Highlighted adjacent cell: ", cell_pos)
@@ -132,7 +132,7 @@ func highlight_random_valid_cells():
var current_item = enhanced_gridmap.get_cell_item(current_cell)
if current_item != -1:
highlighted_cells.append(player.current_position)
enhanced_gridmap.set_cell_item(Vector3i(player.current_position.x, 0, player.current_position.y),
enhanced_gridmap.set_cell_item(Vector3i(player.current_position.x, 2, player.current_position.y),
enhanced_gridmap.hover_item)
# Then check all adjacent cells for items
@@ -143,7 +143,7 @@ func highlight_random_valid_cells():
var cell = Vector3i(cell_pos.x, 1, cell_pos.y)
if enhanced_gridmap.get_cell_item(cell) != -1: # Only highlight cells with items
highlighted_cells.append(cell_pos)
enhanced_gridmap.set_cell_item(Vector3i(cell_pos.x, 0, cell_pos.y),
enhanced_gridmap.set_cell_item(Vector3i(cell_pos.x, 2, cell_pos.y),
enhanced_gridmap.hover_item)
func highlight_occupied_playerboard_slots():
@@ -196,12 +196,6 @@ func clear_highlights():
# Safest is to check against hover_id or typical highlight IDs.
if l2_item != -1:
enhanced_gridmap.set_cell_item(l2_pos, -1)
# Check Layer 0 (Floor Highlight)
var l0_pos = Vector3i(cell.x, 0, cell.y)
var l0_item = enhanced_gridmap.get_cell_item(l0_pos)
if l0_item == hover_id:
enhanced_gridmap.set_cell_item(l0_pos, enhanced_gridmap.normal_items[0])
highlighted_cells.clear()