Skip to content

Instantly share code, notes, and snippets.

@Gwith
Created October 30, 2017 22:18
Show Gist options
  • Save Gwith/46129dd4382f58b7dfe85df34b6535e7 to your computer and use it in GitHub Desktop.
Save Gwith/46129dd4382f58b7dfe85df34b6535e7 to your computer and use it in GitHub Desktop.
from dialogue_menus import *
from rooms import *
courtyard = Room(
'This is a courtyard',
{'North':'Entrance'},
['item1', 'item2'],
['monster1', 'monster2']
)
entrance = Room(
'This is the entrance',
{'North':'Corridor', 'South':'Courtyard'},
['item1', 'item2'],
['monster1', 'monster2']
)
corridor = Room(
'This is corridor',
{'South':'Entrance'},
['item1', 'item2'],
['monster1', 'monster2']
)
all_rooms = {
'Entrance': entrance,
'Corridor': corridor,
'Courtyard': courtyard
}
def play():
current_room = all_rooms['Courtyard']
game_running = True
while game_running:
direction = current_room.interact()
current_room = all_rooms[direction]
if __name__ == "__main__":
code = play()
sys.exit(code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment