Simple styling of the rooms done.
This commit is contained in:
parent
5cb74151f5
commit
af2947c50a
5 changed files with 16 additions and 6 deletions
|
@ -21,6 +21,16 @@ void big_donut() {
|
|||
// maze.hunt_and_kill({11,11});
|
||||
}
|
||||
|
||||
void WorldBuilder::stylize_rooms() {
|
||||
auto& tiles = $map.tiles();
|
||||
|
||||
for(auto& room : $map.rooms()) {
|
||||
for(matrix::box it{tiles, room.x, room.y, room.width+1, room.height+1}; it.next();) {
|
||||
if(tiles[it.y][it.x] == 1) tiles[it.y][it.x] = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WorldBuilder::generate_map() {
|
||||
maze::Builder maze($map);
|
||||
|
||||
|
@ -37,6 +47,8 @@ void WorldBuilder::generate_map() {
|
|||
|
||||
$map.enclose();
|
||||
$map.init_tiles();
|
||||
|
||||
stylize_rooms();
|
||||
}
|
||||
|
||||
bool WorldBuilder::find_open_spot(Point& pos_out) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue