Example #1
0
def initialisation():
    write(
        tkintermaker.text, '''Welcome to the desert island game
Are you ready??
You slowly awaken to a dazzling bright light.
It's the sun.
Aduh!
Haven't you played these games before?
Point is you’re stuck on a desert island.
The smell of salt is on the air.
Above you, seagulls circle in the sky like vultures,
looking for their next meal... Yeah, you should
probably get away from here
You see a shelf of rock to the east,
To the west, the beach stretches out of sight.
The jungle is to the north of you and the ocean the south.
The sun blazes on above you.
If you are unsure what to do, type 'help' or press the help button,
(and read it carefully!).
Try 'look'-ing!''')

    InitTuple = collections.namedtuple('InitTuple', ['turn_no'])
    tkintermaker.much('beach1')
    roomreset()
    global turn_no
    turn_no = 0
    return InitTuple(turn_no)
Example #2
0
def cheat_ending2(character):
    character.loc = [3.5, 3]
    chooseroom(character)
    bach(character)
    much(character)
    write(text, character.room['setting'])
    character.status = 'end2'
Example #3
0
def exit_command(character):
    if character.room in [clearing1, house1, cave1]:
        write(text, 'You exit the ' + character.room['locname'])
        character.loc[0] = character.loc[0] - 0.5
        chooseroom(character)
        bach(character)
        much(character)
        noreplace_write(text, character.room['setting'])
Example #4
0
def teleport_command(character, cmd):
    for i in roomslist:
        if i['locname'] == cmd.item:
            write(text, 'Success! You have teleported to the ' + i['locname'])
            character.loc = i['location']
            chooseroom(character)
            bach(character)
            much(character)
Example #5
0
def continue2_command(character):
    write(
        text, '''Ok. I'll just drop you off at the waterfall. Hey, why don't
you head over to the village? Maybe that'll help you out. Bye!''')
    character.loc = [3, 3]
    chooseroom(character)
    bach(character)
    much(character)
    noreplace_write(text, character.room['setting'])
Example #6
0
def south_command(character):
    if character.room in [mountain1, waterfall1, jungle1, hill1]:
        write(text, 'You walk to the south.')
        character.loc[0] = character.loc[0] - 1
        chooseroom(character)
        bach(character)
        much(character)
        noreplace_write(text,
                        'You are now at the ' + character.room['locname'])
        noreplace_write(text, character.room['setting'])
        character.health = character.health - 2
    else:
        write(text, 'You can\'t go that way!')
Example #7
0
def north_command(character):
    if character.room in [beach1, jungle1, hill1, cliff1]:
        write(text, 'You walk to the north.')
        character.loc[0] = character.loc[0] + 1
        chooseroom(character)
        bach(character)
        much(character)
        noreplace_write(text,
                        'You are now at the ' + character.room['locname'])
        noreplace_write(text, character.room['setting'])
        character.health = character.health - 2
    else:
        write(text, 'You can\'t go that way!')
Example #8
0
def east_command(character):
    if character.room in [mountain1, village1, rocks1]:
        write(text, 'You walk to the east.')
        character.loc[1] = character.loc[1] + 1
        chooseroom(character)
        bach(character)
        much(character)
        noreplace_write(text,
                        'You are now at the ' + character.room['locname'])
        noreplace_write(text, character.room['setting'])
        character.health = character.health - 2
    else:
        write(text, 'You can\'t go that way!')
Example #9
0
def west_command(character):
    if character.room in [waterfall1, jungle1, beach1]:
        write(text, 'You walk to the west.')
        character.loc[1] = character.loc[1] - 1
        chooseroom(character)
        bach(character)
        much(character)
        noreplace_write(text,
                        'You are now at the ' + character.room['locname'])
        noreplace_write(text, character.room['setting'])
        character.health = character.health - 2
    else:
        write(text, 'You can\'t go that way!')
Example #10
0
def enter_command(character):
    if character.room in [jungle1, village1, waterfall1]:
        character.loc[0] = character.loc[0] + 0.5
        chooseroom(character)
        if character.room == cave1:
            write(text, 'You step through the waterfall....')
        else:
            write(text, '')
        bach(character)
        much(character)
        noreplace_write(text, 'You enter the ' + character.room['locname'])
        noreplace_write(text, character.room['setting'])
        if character.room == cave1:
            character.status = 'end2'