Full random map generation, and testing of some new generation tech.
This commit is contained in:
@@ -77,9 +77,13 @@ func _populate_cell(coords: Vector2i, source_id: int, atlas_coords: Vector2i) ->
|
|||||||
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user