-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGame.toml
662 lines (489 loc) · 18.7 KB
/
Game.toml
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
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
[game]
splash = """
___ ___ ___ ___ ___
/\\ \\ /\\ \\ /\\ \\ /\\__\\ /\\ \\
/::\\ \\ /::\\ \\ /::\\ \\ /::| | /::\\ \\
/:/\\:\\ \\ /:/\\:\\ \\ /:/\\:\\ \\ /:|:| | /:/\\:\\ \\
/::\\~\\:\\ \\ /:/ \\:\\ \\ /::\\~\\:\\ \\ /:/|:|__|__ /::\\~\\:\\ \\
/:/\\:\\ \\:\\__\\ /:/__/_\\:\\__\\ /:/\\:\\ \\:\\__\\ /:/ |::::\\__\\ /:/\\:\\ \\:\\__\\
\\/__\\:\\/:/ / \\:\\ /\\ \\/__/ \\/__\\:\\/:/ / \\/__/~~/:/ / \\:\\~\\:\\ \\/__/
\\::/ / \\:\\ \\:\\__\\ \\::/ / /:/ / \\:\\ \\:\\__\\
/:/ / \\:\\/:/ / /:/ / /:/ / \\:\\ \\/__/
/:/ / \\::/ / /:/ / /:/ / \\:\\__\\
\\/__/ \\/__/ \\/__/ \\/__/ \\/__/
b y @ s t e v e k l a b n i k
"""
win = """
__ __ ______ __ __ __ __ __ ________ ___ __
/_/\\/_/\\ /_____/\\ /_/\\/_/\\ /_//_//_/\\ /_______/\\/__/\\ /__/\\
\\ \\ \\ \\ \\\\:::_ \\ \\\\:\\ \\:\\ \\ \\:\\\\:\\\\:\\ \\ \\__.::._\\/\\::\\_\\\\ \\ \\
\\:\\_\\ \\ \\\\:\\ \\ \\ \\\\:\\ \\:\\ \\ \\:\\\\:\\\\:\\ \\ \\::\\ \\ \\:. `-\\ \\ \\
\\::::_\\/ \\:\\ \\ \\ \\\\:\\ \\:\\ \\ \\:\\\\:\\\\:\\ \\ _\\::\\ \\__\\:. _ \\ \\
\\::\\ \\ \\:\\_\\ \\ \\\\:\\_\\:\\ \\ \\:\\\\:\\\\:\\ \\/__\\::\\__/\\\\. \\`-\\ \\ \\
\\__\\/ \\_____\\/ \\_____\\/ \\_______\\/\\________\\/ \\__\\/ \\__\\/
c o n g r a t u l a t i o n s !
"""
lose = """
There are so many other things to do than stay inside and play with
computers. Maybe you pick up a basketball, and start practicing your shot.
Maybe you start looking more closely at the grass, flowers, and insects,
and start cataloguing what you see. Maybe you have fun just playing in the
small stream out back. Maybe you learn more about the farm, and taking
care of the cows.
There's a whole world of possibilities out there. Your fate doesn't have
to be computers.
(Press any key to quit. Thanks for playing!)
"""
[[rooms]]
description = """"It's time to go visit your grandparents!"
Your mom is calling to you. She says that there's a surprise waiting for
you at your grandparents' house. They live just down the road, and you
spend a lot of time with them, generally. But today is a special day.
Apparently. You're not sure what that's about, but you love visiting your
grandparents, so you climb in the car with no complaints.
Pulling up to their house, your parents tell you that it might not be
ready yet, though. "You can play outside in the yard for a bit first if
you'd like, or just come inside. It's up to you."
"""
[[rooms.choices]]
description = "Go outside"
action = 1
[[rooms.choices]]
description = "Enter the house"
action = 2
[[rooms]]
description = """Grass, trees, a gravel driveway. Your family lives in a farm, and so
you're quite familiar with being outdoors. Living in a rural town, there's
not much else to do, really. I guess reading books can be hard when it's
sunny outside, and when it snows in the winter, you can't stay out for
long. It's too cold.
But today is a bright, summer day. Your grandparents have a pretty big
plot; land is cheap out here in farming country. You might even say
there's a whole big world to explore out there...
"""
[[rooms.choices]]
description = "Enter the house"
action = 2
[[rooms.choices]]
description = "Keep playing outside"
action = "lose"
[[rooms]]
description = """Your entire family is in the living room. "Hey Steve, check this out! A
computer!" There's some kind of box hooked up to a T.V. with a bunch of
keys, one for each letter.
"We're trying to figure out how to turn this thing on. You're really gonna
like it. We're just missing something..."
"""
[[rooms.choices]]
description = "Go to the kitchen"
action = 3
[[rooms.choices]]
description = "Go outside"
action = 1
[[rooms.choices]]
description = "Plug in the computer"
action = 5
requires = "Power Cable"
[[rooms]]
description = """You enter the kitchen. There's a huge table. Lots of memories in this
room. It's where your whole family has Thanksgiving dinner, for example.
You've made a lot of arts and crafts in this room; the table is just a
great all-around workspace.
There's a stove, and oven, and a big sink. Even though there's a lot of
people in the house, somehow, the dishes never pile up. There's always
more clean ones available. Your family doesn't have much, but is proud of
what it does have.
That said, there's not a lot going on in here today. Everyone's too busy
in the living room.
"""
[[rooms.choices]]
description = "Go to the living room"
action = 2
[[rooms.choices]]
description = "Go to the guest bedroom"
action = 4
[[rooms]]
description = """This house, like many older houses, was built for more than one generation
of family to live together. That doesn't happen as much anymore, though.
So what would have been your parents' room in another time period is
instead a guest room, for when you stay around too late to make it back to
your house, or when relatives from far away come to visit for a few days.
There's a bed, a nightstand, and a tiny dresser that holds some clothes.
Just because there's an extra room doesn't mean that this place is
massive. Everything just barely fits. Which means you can easily spot
something that's out of place.
"""
[[rooms.choices]]
description = "Go to the kitchen"
action = 3
[[rooms.choices]]
description = "Pick up power cable"
action = "Power Cable"
[[rooms]]
description = """You take the power cable you've found and use it to plug the computer in.
It turns on, and everything works! Your relatives are amazed. Such an easy
thing to forget! The computer is supposed to work from batteries, but they
must have been dead.
This computer has a number of different programs: Word processor, spell
review, calculator, 'mind challenge', 'word zappers', a calendar,
spreadsheet, graph-drawing program, a database, and an art studio. But
there's two others that are calling to you: 'BASIC' and 'BASIC Tutor'.
"Remember those games you played on the computer grandma already has?
You can use this computer with BASIC to make your own! We don't know how
though, you'll have to learn on your own."
Well, looks like the tutor program is the way to go.
"""
[[rooms.choices]]
description = "Open 'BASIC Tutor' program"
action = 6
[[rooms]]
description = """You open up the tutor program, and this is what it says:
'BASIC' is a computer language that was especially designed for student
use. The commands are relatively simple yet allow you to demonstrate
control over a computer and achieve sometimes amazing results. BASIC is
an abbreviation for Beginners All Purpose Symbolic Instruction Code. The
power of BASIC has grown tremendously since its early implementations.
Today students can program in advanced versions that offer almost as much
structure and functionality as the most accepted "professional"
programming languages. Learning to program in BASIC using this computer
will prepare you for programming in all implementations of BASIC since the
commands are similar and the only differences are in some logic
structures.
PRESS ENTER TO CONTINUE
"""
[[rooms.choices]]
description = "Press the 'enter' key"
action = 7
[[rooms]]
description = """The tutor walks you through some more introductory text, explaining how to
use the little IDE that comes with the computer. It also teaches you one
of the first things you need to know about BASIC: that every single line
in a BASIC program has... something.
As a little kid, while working through the tutor, it can be hard to
remember what you've learned. At the end of each section of the tutor,
you'll be asked to recall the information from each section.
What is in every single line of a BASIC program?
"""
[[rooms.choices]]
description = "Line numbers"
action = 9
[[rooms.choices]]
description = "Semicolon"
action = 8
[[rooms]]
description = """Unfortunately, you've remembered incorrectly. There are some programming
languages that end every line in a semicolon, like C. Stop trying to skip
ahead in your childhood, though!
You don't know what C is yet. You will someday...
"""
[[rooms.choices]]
description = "Try again"
action = 7
[[rooms]]
description = """
Correct! Line numbers. But you're not entirely sure what that means,
exactly: you don't know any commands yet, so you can't actually write any
BASIC code yet.
"PRESS ENTER TO CONTINUE," says the tutor.
"""
[[rooms.choices]]
description = "Press the 'enter' key"
action = 10
[[rooms]]
description = """Next, you learn about 'comments'. Comments are a way for programmers to
leave notes to themselves, so when they read their programs at a later
time, they can remember what the tricky bits do. Computers completely
ignore lines with comments.
What syntax does BASIC use for comments?
"""
[[rooms.choices]]
description = "COM (for 'comment')"
action = 11
[[rooms.choices]]
description = "REM (for 'remark')"
action = 12
[[rooms]]
description = """Unfortunately, that's not correct. You'd think that COM might make sense,
but sometimes, programming is tough. This particular mnemonic isn't
accurate.
"""
[[rooms.choices]]
description = "Try again"
action = 10
[[rooms]]
description = """That's right, it's REM, for 'REMark'. You now know enough
to understand a simple BASIC program:
10 REM This is a comment for later
There's the line number, 10. You're still not totally sure why you need
them, but the tutor says you do.
"PRESS ENTER TO CONTINUE," says the tutor.
"""
[[rooms.choices]]
description = "Press the 'enter' key"
action = 13
[[rooms]]
description = """Comments aren't very interesting to you right now, though. Years later,
they will be, but at the moment, you're still not sure why they're there.
Anyway, the next section is about displaying stuff to the people who run
your program. What's the keyword for that, again?
"""
[[rooms.choices]]
description = "PUTS (for 'put string')"
action = 14
[[rooms.choices]]
description = "PRINT"
action = 15
[[rooms]]
description = """Sorry, it's not PUTS. Years later, you'll learn Ruby, which does use
'puts'. But you're skipping ahead again!
"""
[[rooms.choices]]
description = "Try again"
action = 13
[[rooms]]
description = """
Correct! PRINT is the keyword that lets you print stuff out.
10 PRINT "HELLO, WORLD!"
"PRESS ENTER TO CONTINUE," says the tutor.
"""
[[rooms.choices]]
description = "Press the 'enter' key"
action = 16
[[rooms]]
description = """Showing stuff to the user is fun, but being able to understand what
they're typing is important, too. Interactive programs are more fun than
non-interactive ones.
How do you get user input in BASIC?
"""
[[rooms.choices]]
description = "GETS (for 'get string')"
action = 17
[[rooms.choices]]
description = "INPUT"
action = 18
[[rooms]]
description = "That's not true, sadly. Try again?"
[[rooms.choices]]
description = "Try again"
action = 16
[[rooms]]
description = """Correct! You also need a $ for string variables. Here's a sample program
showing INPUT:
10 INPUT "YOUR NAME PLEASE:";NAME$
20 PRINT NAME$
"PRESS ENTER TO CONTINUE," says the tutor.
"""
[[rooms.choices]]
description = "Press the 'enter' key"
action = 19
[[rooms]]
description = """The next section is about a topic that something that you don't fully
understand the importance of at first. It's called 'GOTO', and it's a way
to make your program execute other parts of your program. Or something.
Is GOTO a good thing, or a bad thing?
"""
[[rooms.choices]]
description = "Harmful"
action = 20
[[rooms.choices]]
description = "Totally fine"
action = 21
[[rooms]]
description = """Okay, so here's the thing. Yes, Dijkstra said that GOTO is terrible. Yes,
he's not wrong. Exactly.
I mean, you're a kid. This isn't about building reliable programs, and
besides, at this time, the _reason_ that Dijkstra wrote his essay was that
people did consider GOTO a good idea. So choosing this answer is kind of a
cheat. We haven't gotten there yet.
"""
[[rooms.choices]]
description = "Try again"
action = 19
[[rooms]]
description = """GOTO may not be great in 2016, but in 1991, it's fine. Good enough for
you, anyway. GOTO looks like this:
10 GOTO 40
20 PRINT "GOODBYE"
30 END
40 PRINT "HELLO"
50 GOTO 20
"Understanding a program containing many GOTOs can be a very complicated
and difficult process.
"PRESS ENTER TO CONTINUE," says the tutor.
"""
[[rooms.choices]]
description = "Press the 'enter' key"
action = 22
[[rooms]]
description = """One critical thing for programs is being able to make decisions. In other
words, you want to be able to do things like "is the input the user typed
in correct?" and then do something if it's right, and something else if
it's wrong.
A large number of languages use two keywords for this, IF and ELSE. So
does BASIC, but does it also need an END keyword?
"""
[[rooms.choices]]
description = "BASIC uses END"
action = 23
[[rooms.choices]]
description = "No, it does not use END"
action = 24
[[rooms]]
description = "Wrong! Sorry about that. Maybe try again?"
[[rooms.choices]]
description = "Try again"
action = 22
[[rooms]]
description = """That's right! In BASIC, things all fit on one line, so you don't need an
END. In languages that support multi-line IFs, END is much more useful.
You see an example program in the documentation:
10 INPUT "YOUR AGE PLEASE ";AGE
20 IF AGE > 15 THEN 50
30 PRINT "YOU ARE IN THE COMPUTER GENERATION!"
40 GOTO 60
50 PRINT "SORRY, YOU'RE TOO OLD FOR COMPUTERS!"
60 END
That's... a bit mean. Your uncle is a great programmer, but is certainly
older than 15...
"PRESS ENTER TO CONTINUE," says the tutor.
"""
[[rooms.choices]]
description = "Press the 'enter' key"
action = 25
[[rooms]]
description = """Programs need to manipulate data. You learn from the tutorial that
"variables" are the way that you do this kind of thing.
But how do you define a variable in BASIC?
"""
[[rooms.choices]]
description = "X = 1"
action = 26
[[rooms.choices]]
description = "LET X = 1"
action = 26
[[rooms]]
description = """... actually, both forms work! LET is optional; it's there because older
versions of BASIC required it, but today, the equals sign is enough for
BASIC to know that you are assigning something.
10 LET N$="PETER"
20 X=X+1
The $ appears at the end of the name to indicate that N is a string. You
don't need to make these kinds of annotations, but if you do, they can
help make programs easier to understand.
"CONGRATULATIONS. YOU NOW KNOW THE BASICS OF BASIC.
"PRESS ENTER TO QUIT," says the tutor.
"""
[[rooms.choices]]
description = "Press the 'enter' key"
action = 27
[[rooms]]
description = """Now that you know a bit about BASIC, you can start to make your own
programs! You open up the BASIC program next, and time just seems to pass
on its own...
"""
[[rooms.choices]]
description = "Write some programs"
action = 28
[[rooms]]
description = """Time goes by. You make a bunch of little programs, and learn a lot. There
are some harder games that you don't quite know how to make yet, though.
But today, that's about to change. Time to wake up!
"""
[[rooms.choices]]
description = "Wake up"
action = 29
[[rooms]]
description = """"It's library day!" Your mom knows that you really love reading books,
books of all kinds. Going to the library is one of your favorite things.
But today, today you realize something: there are books about computers.
You can look for books about programming at the library!
"Come on, the car is starting!"
"""
[[rooms.choices]]
description = "Go to the library"
action = 30
[[rooms]]
description = """Ahh, the local library. So many books! Your parents told you that reading
was very important, and luckily for you, it's also something that you
really enjoy doing. There are so many things to read, and the library has
so many books!
You've learned in school about the Dewey Decimal System, and how the books
are organized. The card catalogue tells you that there are, in fact, some
books related to programming, and they're in that section over there.
"""
[[rooms.choices]]
description = "Go to the computer section"
action = 31
[[rooms.choices]]
description = "Go home"
action = 32
[[rooms]]
description = """You're in the computer section of the library. So many books!
It's not totally clear which one you should choose...
"""
[[rooms.choices]]
description = "Return to library entrance"
action = 30
[[rooms.choices]]
description = "Pick out a book"
action = "Book: 'Making a Game'"
[[rooms]]
description = """You're at home. Your family comes from fairly humble means: I mean, they
could afford the $199 for that computer, but just barely. Farmers don't
make a lot of money. You're never wanting for food, but you don't have
money to just throw around, either.
Now that you're obsessed with your computer, there's not a lot to do,
other than play around with it.
"""
[[rooms.choices]]
description = "Go to the library"
action = 30
[[rooms.choices]]
description = "Read your book"
action = 33
requires = "Book: 'Making a Game'"
[[rooms]]
description = """This book is so good! It even has examples on how to make little text
adventure games. For example, using line numbers to help indicate which
room you're in: lines 100-199, for example, are in room 1, and lines
400-499 are in room 4. This gives you 100 lines a room, but you don't need
to rearrange your entire program when you want to add some more lines.
That was a painful process before you learned the trick.
With this new knowledge, you work hard on a new game. It's pretty good!
You've got a knack for this.
Time to wake up, another day is about to begin.
"""
[[rooms.choices]]
description = "Wake up"
action = 34
[[rooms]]
description = """Uuuuuugh school starts early.
That said, you manage to roll out of bed. They put Pokémon on right before
you need to get on the bus, and you don't want to miss an episode. So it's
not _that_ hard to wake up.
Time to go to school!
"""
[[rooms.choices]]
description = "Go to School"
action = 35
[[rooms]]
description = """At school, a friend of yours asks about the game you've been working on.
"How's it going? Did you finish it?"
"Yes! Just yesterday. It's pretty cool."
"My mom just gave me $10 for my allowance for the week. Could I buy a copy
of the code from you? I'm learning how to program myself, it would be neat
to see how you've done things."
"""
[[rooms.choices]]
description = "Sell your game"
action = 36
[[rooms]]
description = """And so begins a career in software, that continues until you're 30, when
you participate in Ludum Dare 35. And make interactive fiction about how
you learned how to program as a child.
This short game isn't _exactly_ my childhood, but it's close. I hope you
had fun; I know I had fun making it.
"""
[[rooms.choices]]
description = "Keep living life"
action = "win"