diff --git a/Scenes/Map/Map.gd b/Scenes/Map/Map.gd index dba4d3a..0936b36 100644 --- a/Scenes/Map/Map.gd +++ b/Scenes/Map/Map.gd @@ -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) GroundLayer.set_cell.call_deferred(coords, source_id, atlas_coords, alternativeTileId) - + +# full random (absolute nonsense) func _pick_random_tile() -> Vector2i: - # Make all Tiles green - return Vector2i(1, 1) + var atlasSize: Vector2i = _source.get_atlas_grid_size() + 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: # 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; \ No newline at end of file