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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user