-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathAdventureGame.py
118 lines (109 loc) · 3.95 KB
/
AdventureGame.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
weapon = False
def strangeCreature():
actions = ["fight","flee"]
global weapon
print("A strange goul-like creature has appeared. You can either run or fight it. What would you like to do?")
userInput = ""
while userInput not in actions:
print("Options: flee/fight")
userInput = input()
if userInput == "fight":
if weapon:
print("You kill the goul with the knife you found earlier. After moving forward, you find one of the exits. Congats!")
else:
print("The goul-like creature has killed you.")
quit()
elif userInput == "flee":
showSkeletons()
else:
print("Please enter a valid option.")
def showSkeletons():
directions = ["backward","forward"]
global weapon
print("You see a wall of skeletons as you walk into the room. Someone is watching you. Where would you like to go?")
userInput = ""
while userInput not in directions:
print("Options: left/backward/forward")
userInput = input()
if userInput == "left":
print("You find that this door opens into a wall. You open some of the drywall to discover a knife.")
weapon = True
elif userInput == "backward":
introScene()
elif userInput == "forward":
strangeCreature()
else:
print("Please enter a valid option.")
def hauntedRoom():
directions = ["right","left","backward"]
print("You hear strange voices. You think you have awoken some of the dead. Where would you like to go?")
userInput = ""
while userInput not in directions:
print("Options: right/left/backward")
userInput = input()
if userInput == "right":
print("Multiple goul-like creatures start emerging as you enter the room. You are killed.")
quit()
elif userInput == "left":
print("You made it! You've found an exit.")
quit()
elif userInput == "backward":
introScene()
else:
print("Please enter a valid option.")
def cameraScene():
directions = ["forward","backward"]
print("You see a camera that has been dropped on the ground. Someone has been here recently. Where would you like to go?")
userInput = ""
while userInput not in directions:
print("Options: forward/backward")
userInput = input()
if userInput == "forward":
print("You made it! You've found an exit.")
quit()
elif userInput == "backward":
showShadowFigure()
else:
print("Please enter a valid option.")
def showShadowFigure():
directions = ["right","backward"]
print("You see a dark shadowy figure appear in the distance. You are creeped out. Where would you like to go?")
userInput = ""
while userInput not in directions:
print("Options: right/left/backward")
userInput = input()
if userInput == "right":
cameraScene()
elif userInput == "left":
print("You find that this door opens into a wall.")
elif userInput == "backward":
introScene()
else:
print("Please enter a valid option.")
def introScene():
directions = ["left","right","forward"]
print("You are at a crossroads, and you can choose to go down any of the four hallways. Where would you like to go?")
userInput = ""
while userInput not in directions:
print("Options: left/right/backward/forward")
userInput = input()
if userInput == "left":
showShadowFigure()
elif userInput == "right":
showSkeletons()
elif userInput == "forward":
hauntedRoom()
elif userInput == "backward":
print("You find that this door opens into a wall.")
else:
print("Please enter a valid option.")
if __name__ == "__main__":
while True:
print("Welcome to the Adventure Game!")
print("As an avid traveller, you have decided to visit the Catacombs of Paris.")
print("However, during your exploration, you find yourself lost.")
print("You can choose to walk in multiple directions to find a way out.")
print("Let's start with your name: ")
name = input()
print("Good luck, " +name+ ".")
introScene()