Skip to content

Instantly share code, notes, and snippets.

@Gwith
Created October 3, 2017 18:23
Show Gist options
  • Save Gwith/4411626861ba098538c65cadd86eafe5 to your computer and use it in GitHub Desktop.
Save Gwith/4411626861ba098538c65cadd86eafe5 to your computer and use it in GitHub Desktop.
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