Crates.io | map-gen-2d |
lib.rs | map-gen-2d |
version | 0.1.15 |
source | src |
created_at | 2023-01-16 07:37:43.215921 |
updated_at | 2023-01-17 02:38:22.242051 |
description | 2D map generation algorithms implementaion |
homepage | https://github.com/theseatoad/map-gen-2d |
repository | https://github.com/theseatoad/map-gen-2d |
max_upload_size | |
id | 759943 |
size | 35,826 |
Recursively divides the map into rooms.
Example:
$ cargo run --example bsp-map
Code example:
// BSPMap::new(position, size, min_room_size, max_room_size)
BSPMap::new(Point::new(20,50), SeedableRng::seed_from_u64(1), Point::new(2,5), Point::new(10,15))
Credit to https://gamedevelopment.tutsplus.com/tutorials/how-to-use-bsp-trees-to-generate-game-maps--gamedev-12268 and https://github.com/whostolemyhat/dungeon for algorithm and rust implementation help.