Full random map generation, and testing of some new generation tech.

This commit is contained in:
gdz
2025-12-08 21:55:24 +01:00
parent c57076cd52
commit f8b4ab793c

View File

@@ -76,11 +76,15 @@ func _populate_cell(coords: Vector2i, source_id: int, atlas_coords: Vector2i) ->
# set_cell(coords: Vector2i, source_id: int = -1, atlas_coords: Vector2i = Vector2i(-1, -1), alternative_tile: int = 0) # set_cell(coords: Vector2i, source_id: int = -1, atlas_coords: Vector2i = Vector2i(-1, -1), alternative_tile: int = 0)
GroundLayer.set_cell.call_deferred(coords, source_id, atlas_coords, alternativeTileId) GroundLayer.set_cell.call_deferred(coords, source_id, atlas_coords, alternativeTileId)
# full random (absolute nonsense)
func _pick_random_tile() -> Vector2i: func _pick_random_tile() -> Vector2i:
# Make all Tiles green var atlasSize: Vector2i = _source.get_atlas_grid_size()
return Vector2i(1, 1) var rndX: int = randi_range(0, atlasSize.x)
var rndY: int = randi_range(0, atlasSize.y)
return Vector2i(rndX, rndY)
func _is_empty(pos: Vector2i) -> bool: func _is_empty(pos: Vector2i) -> bool:
# Check if the cell is empty (source_id is -1) # Check if the cell is empty (source_id is -1)
return true if GroundLayer.get_cell_source_id(pos) == -1 else false; return true if GroundLayer.get_cell_source_id(pos) == -1 else false;