On 25/09/2012, at 8:05 AM, Jes=FAs Gabriel y Gal=E1n wrote:

>>=20
>> If there is another way I can reference these objects? If I =
initialize
>> an object like player in the room itself it is again limited to the =
room
>> in question, right?
>=20
> I don't think the Room is the right place to initialize the player
> object. The player object probably belongs to a Game object or such.
> What you can do is pass the appropiate objects where they need to be
> used.


In games, and a lot of other types of program, there is usually a 'god' =
object or controller object that is tasked with 'running' the game.=20

This object initialises everything (builds the rooms from the map, =
initialises the player object) and then enters the game loop.

In the inner game loop the GameController receives input and then =
iterates through the game objects (rooms, player, etc) updating their =
state.

I true MVC style the rooms and the player don't need to know about each =
other. All the interaction is done inside the GameController object.

Henry