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