Basic MU* Style Movement

 avatar
c0dezer019
python
a year ago
549 B
8
Indexable
rooms = {
    "Bridge": {
        "aft": "Turbolift",
        "port": "Ready Room"
        },
    "Ready Room": {
        "starboard": "Bridge"
    },
    "Turbolift": {
        "forward": "Bridge"
    }
}

current_loc = rooms['Bridge']


def movement(direction):
    global current_loc

    if direction in current_loc.keys():
        new_loc = current_loc[direction]
        current_loc = rooms[new_loc]

        print(f'you are now in the {new_loc}')
    else:
        print("You are unable to go there.")


move = input('Move: ')
movement(move)
Editor is loading...
Leave a Comment