forked from codinggrace/text_based_adventure_game
-
Notifications
You must be signed in to change notification settings - Fork 0
/
game_03.py
33 lines (27 loc) · 1.05 KB
/
game_03.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
def start_adventure():
'''
This function starts the adventure by allowing two options for
players to choose from: red or blue door
Chosen option will print out the door chosen.
'''
print("You enter a room, and you see a red door to your left and a blue door to your right.")
door_picked = input("Do you pick the red door or blue door? > ")
# IF STATEMENTS
# door_picked variable contains whatever the player types in.
if door_picked == "red":
print("You picked the red door")
elif door_picked == "blue":
print("You picked the blue door")
else:
print("Sorry, it's either 'red' or 'blue' as the answer. You're the weakest link, goodbye!")
# Run the program a few times testing out the different answers.
def main():
'''
Gets the players name, print it out and starts the adventure.
'''
player_name = input("What's your name? >")
print(f"Your name is {player_name}")
# Calls another function, declare it above.
start_adventure()
if __name__ == '__main__':
main()