I think it boils down to the data structure you have.
I would have a Tile class which stores what occupies it & what type of terrain it is (Wall, Grass, Mud, Tunnel etc), A room is a 2d array of Tiles, and a GameMap is a std::list of Rooms.
When the player occupies a tile that is a tunnel, the next room loads and the player's position is updated to the appropriate position in the new room.
I am not sure whether you you know about classes or not.
I imagine the game being like Tomb Raider where all these things are lying around to be acquired by players.
I would also use polymorphism to help with this. By that I mean there is a class hierarchy with GamePiece as the base class. Under that there are classes for all different kinds of Players, Enemies & resources such as weapons, treasure, relics, medi-packs etc. A Tile can be occupied by a GamePiece, which is reflected in the definition of the Tile Class member:
GamePiece *OccupiedBy;
and the member function that sets a Tile:
1 2 3
|
void setOccupied(GamePiece * ThePiece) {
OccupiedBy = ThePiece;
}
|
But when the function called:
1 2 3 4
|
Room[5][8]->setOccupied(pDiamonds);
Room[4][7]->setOccupied(pRaptor);
Room[2][9]->setOccupied(pHero);
Room[3][9]->setOccupied(pHeroine);
|
This works because a pointer to a derived class object is a valid pointer to a base class.
Hope all goes well.
I am going out now - it's Friday night here - so I may be able to answer until tomorrow.