juniper-wright / UtopianEngine

The Simple Text Adventure Game Engine
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Room Layout Update #2

Closed juniper-wright closed 11 years ago

juniper-wright commented 11 years ago

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).

juniper-wright commented 11 years ago

Come up with a solution that would allow for a prime number of rooms (other than, of course, 1x17, etc).

juniper-wright commented 11 years ago

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.