Playing with maze gen again.
This commit is contained in:
parent
c97648ab3a
commit
33cd490ed3
8 changed files with 164 additions and 36 deletions
15
map.cpp
15
map.cpp
|
@ -165,21 +165,6 @@ void Map::expand() {
|
|||
}
|
||||
|
||||
void Map::add_room(Room &room) {
|
||||
room.x++;
|
||||
room.y++;
|
||||
room.width--;
|
||||
room.height--;
|
||||
|
||||
if(room.x + room.width >= $width) {
|
||||
// fix the width
|
||||
room.x--;
|
||||
}
|
||||
|
||||
if(room.y + room.height >= $height) {
|
||||
// fix the height
|
||||
room.y--;
|
||||
}
|
||||
|
||||
$rooms.push_back(room);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue