feat: Introduce an EnhancedGridMap with advanced generation, randomization, pathfinding, and data serialization, along with new player, powerup, and portal managers.

This commit is contained in:
Yogi Wiguna
2026-03-04 17:40:10 +08:00
parent 8f03cc15c5
commit cd7881bc3f
12 changed files with 128 additions and 107 deletions
+9 -2
View File
@@ -319,10 +319,17 @@ func _spawn_mission_tiles():
for z in range(gridmap.rows):
# Ensure we don't spawn on obstacles
var base_tile = gridmap.get_cell_item(Vector3i(x, 0, z))
if base_tile == TILE_OBSTACLE:
var current_item = gridmap.get_cell_item(Vector3i(x, 1, z))
# PROTECTED FLOOR CHECK: Don't spawn on walls or void
if base_tile in [TILE_OBSTACLE, -1] or current_item == TILE_OBSTACLE or current_item == 13:
continue
# Spawn tiles with 60% density
if randf() > 0.6:
gridmap.set_cell_item(Vector3i(x, 1, z), -1)
continue
# Spawn tiles on all floors (100% density)
var tile_type = goal_items[randi() % goal_items.size()]
gridmap.set_cell_item(Vector3i(x, 1, z), tile_type)