Hi guys. I'm creating a simple text adventure using Python to learn the language and get more accustomed to OOP.
How would I go about adding characters that enter a room? I have the rooms created and put into a dictionary when the game is started. The players/characters are then synched with the room(verified by instance id's). Now, in order for the characters to interact with each other, I figured, I will need a dictionary and whenever someone enters the room, an event handler for the room class would add the player that entered into the dictionary.
If this is true, how would I go about creating an event handler so that the room automatically adds characters that enters the room to the room's dictionary of characters. If there's a better/easier way of doing this, please let me know.