-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.py
More file actions
165 lines (144 loc) · 5.95 KB
/
run.py
File metadata and controls
165 lines (144 loc) · 5.95 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# Import sleep from time to add delays between strings
import time
import sys
# 'Play again' question to be posed when game is ended
def play_again():
repeat = ['play', 'quit']
repeat = input("\nType 'play' to play again or 'quit' to give up: ")
if repeat == 'play':
choice1_result()
my_game()
if repeat == 'quit':
print('***********Thank you for playing. Goodbye!***********')
sys.exit()
else:
repeat = input("Type 'play' to play again or 'quit' to give up: ")
# Game-over function
def game_over():
print("\nIf only you had made different choices today!")
time.sleep(1)
print("\n*******************GAME OVER*******************\n")
time.sleep(1)
play_again()
# Winning is getting home safe in one piece!
def you_win():
time.sleep(2)
print("\nYou run for home faster than you have ever run before!\n")
time.sleep(2)
print("You fling open the door and kick your runners off with relief.\n")
time.sleep(2)
print("Congratulate yourself for making it through another monthly jog.\n")
time.sleep(2)
print("\n******************YOU SURVIVED******************\n")
time.sleep(2)
play_again()
# Opening intro and input name
def intro():
print("*********Welcome to Your Next Adventure!*********\n")
time.sleep(2)
print("Every decision you make will determine how your story goes.\n")
time.sleep(2)
name1 = input("What shall I call you? ")
# Greeting and first question
print("Hello, " + name1.capitalize() + "! Nice to meet you.")
time.sleep(2)
print("\nGood news! Its time for a monthly guilt-induced run!")
time.sleep(2)
# choice1
def choice1_result():
choice1 = ['no', 'yes']
print("\nPut on your barely worn runners and head for the door.\n")
print("****************Are you ready to go?****************")
# Action taken depending on input for choice1
while True:
if choice1 == 'yes':
print("\nBetter get going before it starts to get dark!\n")
time.sleep(3)
print("\nHead for the quiet county road at the end of your drive.")
time.sleep(3)
print("\nLeft brings you to a hilly road surrounded by fields.")
time.sleep(3)
print("Right brings you from quiet village to the busy main road.")
time.sleep(3)
break
if choice1 == 'no':
print("\n*****Maybe tomorrow. It looks like it might rain.*****\n")
time.sleep(2)
game_over()
else:
choice1 = input("Type 'no' or type 'yes': ")
def my_game():
# Choice lists
choice2 = ['left', 'right']
choice3 = ['run', 'stand', 'jog', 'talk']
# Action dependant on Choice 2 input
choice2 = input("Choose to go 'left' or 'right': ")
while True:
if choice2 == 'left':
print("\nLess cars but more hills-your legs will hurt tomorrow!\n")
time.sleep(2)
print("\nWhen your muscles burn, you stop to catch your breath.")
time.sleep(2)
print("\nJust then, you hear a rustling from the trees nearby.")
time.sleep(2)
print("\n....")
time.sleep(2)
print("\nYour heart pounds-you see a bear lumbering towards you!")
time.sleep(2)
choice3 = input("Type 'run' to run away, or 'stand' to stand: ")
if choice3 == 'run' and choice2 == 'left':
print("You turn and run for home but the hills slow you down.")
time.sleep(3)
print("\nThe bear gains on you with surprising speed!\n")
time.sleep(3)
print("You become the bear's dinner\n")
time.sleep(3)
game_over()
elif choice3 == 'stand' and choice2 == 'left':
print("Every inch of your being screams at you to run.\n")
time.sleep(3)
print("You remember from somewhere that you need to be still.")
time.sleep(3)
print('\n....')
time.sleep(3)
print("\nYou can feel the bear's breath on your neck!\n")
time.sleep(3)
print("You think it's ended for you but the bear ambles off!")
time.sleep(3)
you_win()
else:
choice3 = input("Type 'run' to run away, or 'stand' to stand:")
if choice2 == 'right':
print("\nRight you are! Keep a steady pace.\n")
time.sleep(2)
print("\nAt the end of the sleepy street you reach the main road.")
print("\nCars whizz past as you jog on to the hard shoulder.\n")
time.sleep(3)
print("Suddenly, a white van screeches to a halt in front of you!")
time.sleep(3)
choice3 = input("Type 'jog' to go on or 'talk' to talk to him: ")
if choice3 == 'jog' and choice2 == 'right':
print("You watch too much true crime to get close to the van!")
time.sleep(3)
print("The driver door swings open as you jog past.")
time.sleep(3)
print("A man with a crazed look in his eyes jumps out!")
time.sleep(3)
you_win()
elif choice3 == 'talk' and choice2 == 'right':
print("You approach the driver's door just as it flings open!")
time.sleep(3)
print("You jump back but the driver is too fast for you.")
time.sleep(3)
print("He pulls you into the van with sudden speed!")
time.sleep(3)
print("The homicidal maniac takes you to his murder-house.")
time.sleep(3)
game_over()
else:
choice3 = input("Type 'jog' to go on or 'talk' to talk: ")
else:
choice2 = input("Choose to go 'left' or 'right': ")
intro()
choice1_result()
my_game()