-
Notifications
You must be signed in to change notification settings - Fork 0
/
tutorial.sh
executable file
·405 lines (377 loc) · 8.54 KB
/
tutorial.sh
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
#! /bin/bash
startdt="$1"
. libs/lib_var.sh
function log {
echo "[$1]: $2" >> "logs/tutorial"
}
function wrong {
echo oops! wrong action! lets try again.
var.set next menu.$1
}
clear
function tuto.1 {
echo "welcome to the tutorial."
sleep 0.5
echo "i am going to learn you navigate trough this game."
sleep 0.5
echo "let's first open up our profile's menu."
read -p "(press [enter] to continue)" -s
var.set next menu.main
}
function title {
echo " __ ___ ___ ___ ___"
echo " /\ /\ /\ |__) | |___ (__ | "
echo "/ \/ \ /--\ | | |___ ___) |"
echo " tutorial "
}
function teleport {
clear
log teleport "drawing teleport"
echo '
` . ,
`\\||/|//:
.== () =<
/|/\|\\,`
" ` ,
teleporting...
'
sleep $1
}
# menu's
log game "setting menu's"
function menu.pauze {
log menu "drawing pauze menu"
title
echo " -=[ 1. return to game ]=-"
sleep 0.1
echo " -=[ q. save and quit ]=-"
sleep 0.1
echo "nice! now save and quit the game"
sleep 0.1
echo "[task] save and quit the game using the menu"
echo -e "\n type an option: "
sleep 0.1
read -p " > " -n 1 in
if [[ "$in" == 1 ]]
then var.set next tuto.map.4.2
elif [[ "$in" == q ]]
then var.set next menu.save
fi
}
function menu.save {
title
echo "what profile do you want to load?"
echo " -=[ 1. profile 1 -> ]=-"
sleep 0.1
echo " -=[ q. <<- go back ]=-"
sleep 0.1
echo "well done! your profile is now saved."
sleep 0.1
echo "[task] go back to the main menu"
echo -e "type an option: "
sleep 0.1
read -p " > " -n 1 in
if [[ "$in" == q ]]
then var.set next "menu.main.2"
ani=''
fi
}
function menu.main {
log menu "drawing main menu"
title
echo -e "\n\n"
echo " -=[ 1. go! ->> ]=-"
sleep 0.1
echo " -=[ q. []<- exit ]=-"
sleep 0.1
echo -e "\n\n"
echo -e "type an option: "
sleep 0.1
echo "hi there! would you like to follow the tutorial? nice!"
sleep 0.1
echo "you can use the menu's by typing the letter in front of the button's name."
sleep 0.1
echo "[task] open up the save menu. (hint: use [1])"
read -p " > " -n 1 in
if [[ "$in" == 1 ]]
then var.set next menu.load
elif [[ "$in" == q ]]
then var.set next "menu.confirmclose"
fi
}
function menu.confirmclose {
echo "
would you like to exit the tutorial?
"
read -p " [y/n] > " in
if [[ "$in" == y ]]
then var.set next exit
else var.set next menu.main
fi
}
function menu.main.2 {
title
echo -e "\n\n"
echo " -=[ 1. go! ->> ]=-"
sleep 0.1
echo " -=[ q. []<- exit ]=-"
sleep 0.1
echo -e "\n\n"
echo -e "type an option: "
sleep 0.1
echo "we are done with the tutorial! you can now quit."
echo "[task] close the game using the menu"
read -p " > " -n 1 in
if [[ "$in" == 1 ]]
then var.set next menu.load
elif [[ "$in" == q ]]
then var.set next "exit"
fi
}
function menu.load {
log menu "drawing load menu"
title
echo "what profile do you want to load?"
echo " -=[ 1. profile 1 -> ]=-"
sleep 0.1
echo " -=[ q. <<- go back ]=-"
sleep 0.1
echo "here are your profile's. for simplicity, we disabled all exept profile 1."
sleep 0.1
echo "[task] open profile 1"
echo -e "type an option: "
sleep 0.1
read -p " > " -n 1 in
if [[ "$in" == 1 ]]
then var.set next tuto.map.1
elif [[ "$in" == q ]]
then var.set next "wrong load"
ani=''
fi
}
function menu.teleport {
log menu "drawing teleport menu"
echo "
,___, ,___, _ ,___, _ _ ,___,,___,
| (__, | (__, (\ | (__, |
,| (___, ,\_, (___, ,| \) (___, ,|
"
log teleport "network 1 interface"
echo "you are connected to network 1
choose an option:
4. (4) [1 seconds]
5. (5) [1 seconds]
see you soon!"
[[ "$1" == f ]] && echo "this is the teleportation ui."
[[ "$1" == f ]] && echo "[task] teleport to 5"
read -p " > " -n 1 in
if [[ "$in" == '' ]]
then var.set next $map
elif [[ "$in" == 4 ]]
then var.set next tuto.map.4.2
log teleport "sending to map tuto.map.4"
[[ "$1" == f ]] && var.set next tuto.map.4
teleport 1
elif [[ "$in" == 5 ]]
then var.set next tuto.map.5
log teleport "sending to map tuto.map.5"
teleport 1
log menu "close"
fi
}
# maps
function map.1 {
echo "
*
|
#------2 &-*
\
\
&
--------------------------"
# keypad
}
function map.2 {
echo "
3
|
1------# &-*
\
\
4
--------------------------"
# keypad
}
function map.3 {
echo "
#
|
*------2 &-*
\
\
*
--------------------------"
# keypad
}
function map.4 {
echo "
*
|
*------2 t-*
\
\
#
--------------------------"
# keypad
}
function map.5 {
echo "
*
|
*------* #-6
\
\
t
--------------------------"
# keypad
}
function map.6 {
echo "
*
|
*------* &-#
\
\
&
--------------------------"
# keypad
}
# keypad
function keypad {
:
}
function kp.map.1 {
map.1
read -p " > " -n 1 in
if [[ "$in" == "2" ]]
then var.set next kp.map.2
fi
}
function kp.map.2 {
map.2
read -p " > " -n 1 in
if [[ "$in" == 1 ]]
then var.set next kp.map.1
elif [[ "$in" == 3 ]]
then var.set next kp.map.3
elif [[ "$in" == 4 ]]
then var.set next tuto.map.4
fi
}
function kp.map.2.2 {
map.2
echo "HE! you should not be here!"
sleep 0.1
echo "lets get you back"
read -p "press any key"
var.set next tuto.map.4.2
}
function kp.map.3 {
map.3
read -p " > " -n 1 in
if [[ "$in" == "2" ]]
then var.set next kp.map.2
fi
}
function kp.map.4 {
map.4
read -p " > " -n 1 in
if [[ "$in" == "2" ]]
then var.set next kp.map.2
elif [[ "$in" == "t" ]]
then var.set next "menu.teleport f"
fi
}
function kp.map.6 {
map.6
read -p " > " -n 1 in
if [[ "$in" == "5" ]]
then var.set next tuto.map.5
fi
}
# tutomaps
function tuto.map.1 {
map.1
echo "this is the in game menu."
sleep 0.1
echo "you are at the #. the numbers are options you can travel to."
sleep 0.1
echo "[task] travel to (2) using the number keys"
read -p " > " -n 1 in
if [[ "$in" == 2 ]]
then var.set next tuto.map.2
fi
}
function tuto.map.2 {
map.2
echo "well done! the # moved! this means you are now at (2)."
sleep 0.1
echo "you can see that 3 more numbers appeared. lets move again."
sleep 0.1
echo "[task] travel the map"
read -p " > " -n 1 in
if [[ "$in" == 1 ]]
then var.set next kp.map.1
elif [[ "$in" == 3 ]]
then var.set next kp.map.3
elif [[ "$in" == 4 ]]
then var.set next tuto.map.4
fi
}
function tuto.map.4 {
map.4
echo "ah! there is something here! it is an teleportation machine. "
sleep 0.1
echo "they work with networks. this is network 1."
sleep 0.1
echo "[task] open the teleportation gui using [t]"
read -p " > " -n 1 in
if [[ "$in" == t ]]
then var.set next "menu.teleport f"
elif [[ "$in" == "2" ]]
then var.set next kp.map.2
fi
}
function tuto.map.4.2 {
map.4
echo "now that we are teleported back, let's save the game."
sleep 0.1
echo "[task] open the pauze menu using [q]"
read -p " > " -n 1 in
if [[ "$in" == t ]]
then var.set next menu.teleport
elif [[ "$in" == "2" ]]
then var.set next kp.map.2.2
elif [[ "$in" == q ]]
then var.set next menu.pauze
fi
}
function tuto.map.5 {
map.5
echo "now we are teleported!"
sleep 0.1
echo "you can have a look around here, or teleport back."
sleep 0.1
echo "[task] teleport back"
read -p " > " -n 1 in
if [[ "$in" == t ]]
then var.set next menu.teleport
elif [[ "$in" == "6" ]]
then var.set next kp.map.6
fi
}
var.set next "tuto.1"
while true ; do
$(var.get next)
clear
done