Closed juniper-wright closed 11 years ago
Come up with a solution that would allow for a prime number of rooms (other than, of course, 1x17, etc).
So, the developer can specify any size dungeon (probably need to impose some limit). When creating a room, they specify its X and Y coordinates. If two rooms have the same coordinates, pitch a fit and quit the game.
When making the rooms array, initialize them with default-constructor rooms.
Add a function to the room class:
public boolean canTravel()
{
return _canTravel;
}
Add a member variable to the Room class boolean _canTravel
. Default constructor sets it to false, other constructor sets it to true.
Instead of specifying the width of the dungeon, specify the height and width. Then throw errors if they don't fill out the entire space. (This, of course, demands that dungeons cannot have a prime number of rooms).