feat: Add an EnhancedGridMap with advanced generation, randomization, and pathfinding capabilities, and introduce the Stop n Go game mode manager.

This commit is contained in:
Yogi Wiguna
2026-03-05 17:50:21 +08:00
parent 5c4764b082
commit 7d801f1156
2 changed files with 101 additions and 39 deletions
+6 -4
View File
@@ -14,8 +14,8 @@ signal grid_updated
@export var normal_items: Array[int] = [0]
@export var non_walkable_items: Array[int] = [4]
@export var hover_item: int = 1
@export var start_item: int = 2
@export var end_item: int = 3
@export var start_item: int = -1
@export var end_item: int = -1
@export var immutable_items: Array[int] = [1, 2, 3, 4] # Items that cannot be randomized/reset (Start, Safe, Finish, Wall)
var current_mesh_library: MeshLibrary
@@ -583,8 +583,10 @@ func find_path(start: Vector2, end: Vector2, floor_index: int = 0, clear_path_vi
clear_path_visualization()
# Always use Layer 2 for these temporary markers
set_cell_item(Vector3i(start.x, 2, start.y), start_item)
set_cell_item(Vector3i(end.x, 2, end.y), end_item)
if start_item >= 0:
set_cell_item(Vector3i(start.x, 2, start.y), start_item)
if end_item >= 0:
set_cell_item(Vector3i(end.x, 2, end.y), end_item)
for point in path:
if Vector2(point.x, point.y) != start and Vector2(point.x, point.y) != end:
set_cell_item(Vector3i(point.x, 2, point.y), hover_item)