コード例 #1
0
    'You reach a grasslands area at the foot of a hill to the south. To the north there is a castle.'
)

abandoned_castle_front = Place(
    'Castle Front',
    'You are at the front of what appears to be a ruined castle. The castle has 4 major towers the nearest ones - those to the southeast and the southwest - are in tatters. The northern towers still appear relatively intact.'
)
abandoned_castle_corner_se = Place(
    'Castle SE tower',
    'A tower (in shambles) rises upon this corner of the castle.')
abandoned_castle_corner_sw = Place(
    'Castle SW tower',
    'A ruined tower rests above. Moss covers the stones still standing. A few large stones are scattered around the area.'
)
swarshy_swamp = Place('Swarshy Swamp',
                      'Muck and vines lather the faces of the trees.')
granite_obelisk = Place(
    'Obelisk of the Lathenheim Fiends',
    'A shiny black and red tower rises into the swirling purple sky.')

# Set player's initial location
initial_location = hill

# Wire together all of the places
hill.north = grasslands
grasslands.north = abandoned_castle_front
abandoned_castle_front.east = abandoned_castle_corner_se
abandoned_castle_front.west = abandoned_castle_corner_sw
grasslands.east = swarshy_swamp
swarshy_swamp.east = granite_obelisk
コード例 #2
0
from Place import Place, Door
from Item import Item

intro_text = ('You wake up, sprawled on the floor in a small space. You don\'t '
'feel too good and your brain feels foggy.')

closet = Place(name='Closet', description='You appear to be in a storage closet '
        'of some kind.', door_north=Door(description='A simple wooden door.',
            key_id='closet_door'))
hallway1 = Place(name='Hallway', description='You are standing in a hallway.')
hallway2 = Place(name='Hallway', description='You are standing in a hallway.')

closet.north = hallway1
hallway1.east = hallway2

initial_location = closet