Implements basic map generation

Adds a simple map generation system.

The generator creates a path from the bottom row to the top row,
with random horizontal movements and a configurable probability of moving up.

The map is then printed to the console for debugging and visualization.
This commit is contained in:
Dan Baker 2025-04-29 19:08:47 +01:00
parent 02b3be35b0
commit bf09402bc5
3 changed files with 170 additions and 0 deletions

View file

@ -25,3 +25,14 @@ func _ready() -> void:
var perimeter_cells : Array = CoordUtil.perimeter_cells(Vector2i(0, 0), Vector2i(map_width, map_height), false, 2)
walls.set_cells_terrain_connect(perimeter_cells, 0, 0, false)
# walls.set_cells_terrain_connect(cells, 0, 0, true)
#var map_generator = load("res://utility/MapGenerator.gd")
var map_generator = MapGenerator.new()
# Generate a new map
map_generator.generate_map()
# Print the map to console
map_generator.print_map()
# Get the generated map data for use in your game
# var map_data = map_generator.get_map()