-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTTA.py
257 lines (232 loc) · 8.26 KB
/
TTA.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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
# Main file which should handle all the input and display for now
# Nothing really will be split up until much later
# Most of the questions and such that you see will be filler for now.
# I'll probably also forget to delete the above statement once the story starts
# Written by Moomasterq :)
from basicfunc import *
import time
import sys
from random import *
from maze import *
#Sleep countdown timers, change to 0 for testing
sleepn1 = -1
sleep1 = 0
sleep3 = 0
sleep5 = 5
sleep10 = 10
sleep20 = 20
#Passcode var
pc = "0"
#Defines blank variable for no reason other than caution
blank = "doesn't matter"
#Attempt at starting a menu (going to be a long one, going to be a lot of things)
#Nothing is really going to change until I try to get my ideas written
print"Welcome to Turtle-Text-Adventure"
#Defines blank variable for no reason other than caution
blank = "doesn't matter"
menu_correct = False
print" "
#Starts menu module
#Dom rewrote menu function, and added some spacing
while not menu_correct:
print"What would you like to do?"
print" "
menu = raw_input("Your options are: 'start game' and 'how to play': ")
if menufunc(menu) == "starting game":
print" "
print"The game is now starting......."
print" "
menu_correct = True
time.sleep(sleep1)
elif menufunc(menu) == "how to play":
print" "
print"You simply respond to statements and questions with one of the options in the parentheses."
print"If the question/statement is \"Which way do you choose? (left or right)\" you would respond with either 'left' or 'right (without parenthesis)"
print" "
print"You will be told if your answer is right or wrong with a short story that will either end the game if its wrong or continue it if it is correct"
print" "
print"There are short timers that will allow for you to read the wrong answers before closing and error messages"
print" "
print" "
#Variable that is random that will wait for enter to continue
menu_correct = True
blank = raw_input("Press enter to continue to game start... ")
print" "
elif menufunc(menu) == "passcode":
pc = raw_input("Enter passcode here: ")
stringit(pc)
print" "
menu_correct = True
#Error message, game continues.
else:
print"You did not enter a valid menu choice. Please choose again."
print" "
time.sleep(sleep3)
#Starts the story and asks for name
name = raw_input("What is your name? ")
##Uses the stringit function which makes the variable a string, which in this case is a name
stringit(name)
print"Hello " + name + ", you are about to embark on a journey, get ready"
#Timer, probably a better way to do this, but too lazy to do that, and enjoy doing this.
time.sleep(sleep1)
print"5..."
time.sleep(sleep1)
print"4..."
time.sleep(sleep1)
print"3.."
time.sleep(sleep1)
print"2.."
time.sleep(sleep1)
print"1.."
time.sleep(sleep3)
print"Loading Complete"
time.sleep(sleep3)
##Adds a space between lines
print" "
print" "
#While Variable for the while block
#If it's false, it will continue to the story, but if true it will blow through it until the game changes it again to false
#This is the basis of a code based password system
#Block 1
wvar = False
if pc == "1":
print"Starting at block 1"
print" "
pc = "0"
elif pc == "0":
print" "
else:
wvar = True
while not wvar:
#Start of game with wake up sequence
print"Your alarm clock goes off, it is 6:47 a.m."
print"You think to you yourself, why did that go off so early?"
print"Work starts at 8:30 a.m., you have about an hour to get ready."
move = raw_input("You turn over and see your alarm clock, do you (hit snooze or wake up) ")
#Starting main if block, see 'example structure.py' for better examples
if wake_up_is_right(move) == "correct":
print"You stand up, and walk towards the bathroom door"
wvar = True
elif wake_up_is_right(move) == "wrong":
print"You lean over, and hit snooze on your alarm clock"
print"As you hit snooze, your arms falls off"
print"You bleed to death and die."
print"You are now dead"
blank = raw_input("Press Enter to close...")
sys.exit()
else:
print"Error (420-1), was your spelling right? Please enter a valid choice."
blank = raw_input("Press Enter to continue...")
print" "
print" "
#fav_food = raw_input("What is your favorite food %s? " % (name))
print" "
#Block 2
wvar = False
if pc == "2":
print"Starting at block 2"
print" "
pc = "0"
elif pc == "0":
print" "
else:
wvar = True
while not wvar:
#Start of bathroom sequence
print"After stumbling towards the bathroom door, you are confronted with an issue"
move = raw_input("Do you (open or keep closed)? ")
if open_is_right(move) == "correct":
print"You open the door, and move into the bathroom uneventfully"
wvar = True
elif open_is_right(move) == "wrong":
print"You run away and fall down your stairs breaking your neck"
print"You live in a 1 story no basement house"
print"You are dead"
blank = raw_input("Press Enter to close...")
sys.exit()
else:
print"Error (420-2), was your spelling right? Please enter a valid choice."
blank = raw_input("Press Enter to continue...")
print" "
print" "
#fav_color = raw_input("What is your favorite color %s? " % (name))
print" "
#Block 3
wvar = False
if pc == "3":
print"Starting at block 3"
print" "
pc = "0"
elif pc == "0":
print" "
else:
wvar = True
while not wvar:
move = raw_input("Walking in the door, you notice your toothbrush on the sink, do you (pick up or leave there)? ")
if leavethere_is_right(move) == "correct":
print"You notice that the toothbrush has bird poop on it, and leave it there"
wvar = True
elif leavethere_is_right(move) == "wrong":
#System for more than one option using random numbers
rint = random()
#Makes it option A 25% of the time, and B 75% of the time
if rint > 0 and rint < .25:
print"You start to brush your teeth, everything is fine"
print"You continue through your day as normal"
print"Months later, you die of bird flu"
print"You are dead"
blank = raw_input("Press Enter to close...")
sys.exit()
else:
print"You look in the mirror and notice you are a turtle"
print"Turtles have no teeth"
print"You accidentally ingest all your toothpaste and die"
print"You are dead"
blank = raw_input("Press Enter to close...")
sys.exit()
else:
print"Error (420-3), was your spelling right? Please enter a valid choice."
blank = raw_input("Press Enter to continue...")
print" "
print" "
#fav_season = raw_input("What is your favorite season %s? " % (name))
print" "
#Block 4
wvar = False
if pc == "4":
print"Starting at block 4"
print" "
pc = "0"
elif pc == "0":
print" "
else:
wvar = True
while not wvar:
#Part 3 of bathroom sequence
print"Being disgusted with the toothbrush, you notice the shower and a box of kellogs brand pop tarts"
move = raw_input("What do you want to do with the shower (turn on or keep off)? ")
if keep_off_is_right(move) == "correct":
print"You ignore the shower, and continue searching"
wvar = True
elif keep_off_is_right(move) == "wrong":
print"You turn on the shower, and get in"
print"After washing off, you die"
print"You are now dead"
blank = raw_input("Press Enter to close...")
sys.exit()
else:
print"Error (420-4), was your spelling right? Please enter a valid choice."
blank = raw_input("Press Enter to continue...")
print" "
print" "
#fav_animal = raw_input("What is your favorite animal %s? " % (name))
print" "
#print"%s's favorite food is %s" % (name, fav_food)
#print"%s's favorite color is %s" % (name, fav_color)
#print"%s's favorite season is %s" % (name, fav_season)
#print"%s's favorite animal is %s" % (name, fav_animal)
print" "
print"Temp end"
blank = raw_input("Press Enter to close...")
sys.exit()
#Hi dom