Created
October 3, 2017 18:23
-
-
Save Gwith/4411626861ba098538c65cadd86eafe5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from monster_classes import Goblin, Troll | |
class Room: | |
def __init__(self, name, directions, items, monster, description=None): | |
self.name = name | |
self.directions = directions | |
self.items = items | |
self.monsters = monster | |
self.description = description | |
room_info = [ | |
{ | |
'name' : 'Courtyard', | |
'directions' : ['forward', 'backwards'], | |
'items' : ['item1', 'item2'], | |
'monster' : [], | |
'description' : 'This is a entrance', | |
}, | |
{ | |
'name' : 'Entrance', | |
'directions' : ['forward', 'backwards'], | |
'items' : ['item1', 'item2'], | |
'monster' : [#create 2 goblins], | |
'description' : 'This is a entrance', | |
}, | |
{ | |
'name' : 'Corridor', | |
'directions' : ['backwards'], | |
'items' : ['item1', 'item2'], | |
'monster' : [Troll.troll, Troll.troll], | |
'description' : 'This is a entrance', | |
} | |
] | |
rooms = [Room(**info) for info in room_info] | |
print(rooms[1].name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment