-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMapleTuring (Final).t
1240 lines (1106 loc) · 42.4 KB
/
MapleTuring (Final).t
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
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%%%%%%%%%%%%%%%%%
%% MapleTuring %%
%% By Sunny Li %%
%%%%%%%%%%%%%%%%%
% Date of creation: 6.3.2010
% V1.0 updated on 4.8.2012
/*=====================================================================
This program is created based on the popular MMORPG game MapleStory
and I have used the server selection page as menu. All origional image
and sound(excluding the one in quiz) are extracted from MapleStory and
edited on photoshop.
=====================================================================*/
% When in game, type in name and press enter to login.
%===== Settings =======================================================================================
View.Set ("graphics:780;570,position:center;center,nobuttonbar,title:Maple Turing,nocursor")
%======================================================================================================
%======================================================================================================
% Sound
%======================================================================================================
% Music
var music : string
var finished : boolean
process bgMusic
finished := false
loop
exit when finished
Music.PlayFile ("Sound/Music/" + music + ".mp3")
end loop
end bgMusic
% Reminder of how to fork and stop music
% fork bgMusic
% Stop the music
/*finished := true
Music.PlayFileStop*/
% UI sound
var soundFile : string
var soundFinished : boolean
process sounds
soundFinished := false
loop
exit when soundFinished
Music.PlayFile ("Sound/Sound/" + soundFile + ".mp3")
end loop
end sounds
% Reminder of how to fork and stop sound
% fork sounds
% Stop the sound
/*soundFinished := true
Music.PlayFileStop*/
%======================================================================================================
% Mouse
%======================================================================================================
% for Mouse.Where
var mouseX, mouseY, mouseButton : int
%======================================================================================================
% Keyboard
%======================================================================================================
% Key inputs
var key : array char of boolean
var ch : string (1)
%======================================================================================================
% Text
%======================================================================================================
var font : array 1 .. 15 of int
font (1) := Font.New ("system:10")
font (2) := Font.New ("computer:8")
font (3) := Font.New ("Times New Roman:10")
font (4) := Font.New ("Times New Roman:10:bold")
font (5) := Font.New ("Times New Roman:12")
font (6) := Font.New ("Times New Roman:12:bold")
font (7) := Font.New ("Times New Roman:12:bold,italic")
font (8) := Font.New ("Times New Roman:13:bold")
font (9) := Font.New ("Times New Roman:15")
font (10) := Font.New ("Times New Roman:15:bold")
font (11) := Font.New ("Times New Roman:15:bold,italic")
font (12) := Font.New ("Times New Roman:17:bold,italic")
font (13) := Font.New ("Times New Roman:21")
font (14) := Font.New ("Times New Roman:21:bold")
font (15) := Font.New ("Arial:80:bold,italic")
%======================================================================================================
% User Info
%======================================================================================================
% The login name typed
var name : string := ""
% This is usesless...for the game I'm gonna do maybe?
var level : int := 1
%======================================================================================================
% Other Info
%======================================================================================================
% Content Select Scroll Position
var scrollPosition : int := 1
% Exit Content Select
var toExit : int := 0
% Keep track of which option is selected
var selectDown : int := 0
% Quiz
var win : boolean := false
%======================================================================================================
% Images
%======================================================================================================
% Start Up
var nexonLogo : int := Pic.FileNew ("Image/start up/nexon_logo.jpg")
var wizetLogo : int := Pic.FileNew ("Image/start up/wizet_logo.gif")
var msLogo : int := Pic.FileNew ("Image/start up/Title.logo.0.1.gif")
var fantasticStory : int := Pic.FileNew ("Image/start up/fantastic story.jpg")
% Login page
var boarder : int := Pic.FileNew ("Image/Login/Common.frame.gif")
var background : int := Pic.FileNew ("Image/Login/WorldSelect.birthday.0.0.jpeg")
var title : int := Pic.FileNew ("Image/Login/Title.MSTitle.gif")
var loginNormalBox : int := Pic.FileNew ("Image/Login/title.signboard.0.0.gif")
var loginNormalBox1 : int := Pic.FileNew ("Image/Login/title.signboard.0.1.bmp")
var loginNormal : int := Pic.FileNew ("Image/Login/Title.BtLogin.normal.0.gif")
var loginNormalMouseOver : int := Pic.FileNew ("Image/Login/Title.BtLogin.mouseover.0.gif")
var loginNormalPressed : int := Pic.FileNew ("Image/Login/Title.BtLogin.pressed.0.gif")
var loginNormalDisabled : int := Pic.FileNew ("Image/Login/Title.BtLogin.disabled.0.gif")
% Content Select
var signboard : int := Pic.FileNew ("Image/Content Select/WorldSelect.signboard.0.0.gif")
var signboard1 : int := Pic.FileNew ("Image/Content Select/WorldSelect.signboard.2.0.gif")
var csBg : int := Pic.FileNew ("Image/Content Select/WorldSelect.moonbunny.0.0.gif")
var selectDisable : int := Pic.FileNew ("Image/Content Select/WorldSelect.BtWorld.e.disabled.0.gif")
var selectNormal : int := Pic.FileNew ("Image/Content Select/WorldSelect.BtWorld.e.enabled.0.gif")
var selectFocus : int := Pic.FileNew ("Image/Content Select/Select Focus.gif")
var textLesson : int := Pic.FileNew ("Image/Content Select/lesson.gif")
var textCredit : int := Pic.FileNew ("Image/Content Select/credit.gif")
var textQuiz : int := Pic.FileNew ("Image/Content Select/quiz.gif")
var scroll1 : int := Pic.FileNew ("Image/Content Select/WorldSelect.scroll.0.1.gif")
var scroll2 : int := Pic.FileNew ("Image/Content Select/WorldSelect.scroll.0.2.gif")
var scroll3 : int := Pic.FileNew ("Image/Content Select/WorldSelect.scroll.0.3.gif")
var backDisabled : int := Pic.FileNew ("Image/Content Select/Common.BtStart.disabled.0.gif")
var backMouseOver : int := Pic.FileNew ("Image/Content Select/Common.BtStart.mouseOver.0.gif")
var backNormal : int := Pic.FileNew ("Image/Content Select/Common.BtStart.normal.0.gif")
var backPressed : int := Pic.FileNew ("Image/Content Select/Common.BtStart.pressed.0.gif")
var creditNormal : int := Pic.FileNew ("Image/Content Select/button1up.gif")
var creditMouseOver : int := Pic.FileNew ("Image/Content Select/button1over.gif")
var quizNormal : int := Pic.FileNew ("Image/Content Select/button2up.gif")
var quizMouseOver : int := Pic.FileNew ("Image/Content Select/button2over.gif")
% Loading
var loadingBar1 : int := Pic.FileNew ("Image/Loading/Notice.Loading.backgrnd.gif")
var loadingBar2 : int := Pic.FileNew ("Image/Loading/Notice.Loading.bar.0.gif")
var loadingBar3 : int := Pic.FileNew ("Image/Loading/Notice.Loading.bar.1.gif")
var loadingBar4 : int := Pic.FileNew ("Image/Loading/Notice.Loading.bar.2.gif")
var loadingBar5 : int := Pic.FileNew ("Image/Loading/Notice.Loading.bar.3.gif")
var loadingBar6 : int := Pic.FileNew ("Image/Loading/Notice.Loading.bar.4.gif")
var loadingBar7 : int := Pic.FileNew ("Image/Loading/Notice.Loading.bar.5.gif")
var loadingBar8 : int := Pic.FileNew ("Image/Loading/Notice.Loading.bar.6.gif")
var loadingBar9 : int := Pic.FileNew ("Image/Loading/Notice.Loading.bar.7.gif")
var loadingBar10 : int := Pic.FileNew ("Image/Loading/Notice.Loading.bar.8.gif")
var loadingBar11 : int := Pic.FileNew ("Image/Loading/Notice.Loading.bar.9.gif")
var loadingBar12 : int := Pic.FileNew ("Image/Loading/Notice.Loading.bar.10.gif")
% Maps
var gameBG1 : int := Pic.FileNew ("Image/Game/Map/Henesys1.bmp")
% UI bar
var userUIbarBG : int := Pic.FileNew ("Image/Game/UI/background.gif")
var userUIbar : int := Pic.FileNew ("Image/Game/UI/background2.gif")
var healthBar : int := Pic.FileNew ("Image/Game/UI/bar.gif")
var chatTarget : int := Pic.FileNew ("Image/Game/UI/chatTarget.gif")
var graduation : int := Pic.FileNew ("Image/Game/UI/graduation.gif")
%======================================================================================================
% Procedures
%======================================================================================================
% Login
procedure loginNormalClick
fork sounds
soundFile := "UI/ScrollUp"
Pic.Draw (loginNormalMouseOver, 587, 473, picCopy)
delay (50)
Pic.Draw (loginNormalPressed, 587, 473, picCopy)
delay (50)
Pic.Draw (loginNormal, 587, 473, picCopy)
delay (50)
end loginNormalClick
procedure loginNormalMouseEffect1
%fork sounds
%soundFile := "UI/BtMouseOver"
Pic.Draw (loginNormalMouseOver, 587, 473, picCopy)
%delay (300)
%soundFinished := true
end loginNormalMouseEffect1
procedure loginNormalMouseEffect2
fork sounds
soundFile := "UI/BtMouseClick"
Pic.Draw (loginNormalPressed, 587, 473, picCopy)
delay (100)
Pic.Draw (loginNormalMouseOver, 587, 473, picCopy)
delay (100)
soundFinished := true
end loginNormalMouseEffect2
% Content Select
procedure scrollDown
View.Set ("nooffscreenonly")
Pic.Draw (signboard1, 125, 355, picMerge)
delay (100)
Pic.Draw (scroll1, 125, 86, picMerge)
delay (100)
Pic.Draw (scroll2, 125, 85, picMerge)
delay (100)
Pic.Draw (scroll3, 125, 90, picMerge)
delay (100)
scrollPosition := 0
View.Set ("offscreenonly")
end scrollDown
procedure scrollUp
View.Set ("nooffscreenonly")
Pic.Draw (scroll3, 125, 90, picMerge)
delay (100)
Pic.Draw (scroll2, 125, 85, picMerge)
delay (100)
Pic.Draw (scroll1, 125, 86, picMerge)
delay (100)
Pic.Draw (signboard1, 125, 355, picMerge)
delay (100)
scrollPosition := 1
View.Set ("offscreenonly")
end scrollUp
% Loading (for fun)
procedure loading
View.Set ("nooffscreenonly")
Pic.Draw (loadingBar1, maxx div 3 - 25, 150, picMerge)
Pic.Draw (loadingBar12, maxx div 2 - 21, 188, picMerge)
delay (300)
Pic.Draw (loadingBar2, maxx div 2 - 21, 188, picMerge)
delay (400)
fork sounds
soundFile := "UI/Enchant"
Pic.Draw (loadingBar3, maxx div 2 - 21, 188, picMerge)
delay (500)
Pic.Draw (loadingBar4, maxx div 2 - 21, 188, picMerge)
delay (400)
Pic.Draw (loadingBar5, maxx div 2 - 21, 188, picMerge)
delay (200)
Pic.Draw (loadingBar6, maxx div 2 - 21, 188, picMerge)
delay (500)
Pic.Draw (loadingBar7, maxx div 2 - 21, 188, picMerge)
delay (200)
Pic.Draw (loadingBar8, maxx div 2 - 21, 188, picMerge)
delay (100)
Pic.Draw (loadingBar9, maxx div 2 - 21, 188, picMerge)
Pic.Draw (loadingBar10, maxx div 2 - 21, 188, picMerge)
delay (300)
Pic.Draw (loadingBar11, maxx div 2 - 21, 188, picMerge)
delay (500)
soundFinished := true
Music.PlayFileStop
end loading
%======================================================================================================
% Start Up
%======================================================================================================
procedure startUp
View.Set ("offscreenonly")
colorback (black)
cls
Font.Draw ("Created by:", 200, 370, font (14), white)
delay (100)
fork bgMusic
music := "UI/nxlogo"
for gap : 1 .. 260
View.Update
drawfillbox (0, 0, maxx, maxy, black)
Font.Draw ("Created by:", 170, 360, font (14), white)
Font.Draw ("S", 150, 250, font (15), gap div 5)
Font.Draw ("u", 150 + (gap div 4), 250, font (15), gap div 6)
Font.Draw ("n", 150 + (gap div 2), 250, font (15), gap div 15 * 5)
Font.Draw ("n", 150 + (gap div 4 * 3), 250, font (15), gap div 7)
Font.Draw ("y", 150 + gap, 250, font (15), gap div 8)
Font.Draw ("L", 150 + gap * 4 div 3, 250, font (15), gap div 9 * 2)
Font.Draw ("i", 150 + gap * 3 div 2 + 25, 250, font (15), gap div 10 * 5 div 4)
end for
delay (1200)
delay (0) %Lessen sound glitch
finished := true
Music.PlayFileStop
%Extra just to make sure
delay (1)
finished := true
Music.PlayFileStop
fork bgMusic
music := "UI/wzlogo"
delay (500)
colorback (white)
cls
Font.Draw ("Image and Data extracted from:", 50, 500, font (13), black)
Pic.Draw (msLogo, 186, 340, picMerge)
Font.Draw ("by", 350, 355, font (13), black)
Pic.Draw (nexonLogo, 100, 165, picCopy)
Pic.Draw (wizetLogo, 420, 180, picCopy)
Font.Draw ("and also credit to", 300, 110, font (8), black)
Pic.Draw (fantasticStory, 222, 50, picMerge)
View.Update
delay (5000)
finished := true
Music.PlayFileStop
delay (100)
View.Set ("nooffscreenonly")
end startUp
%======================================================================================================
% Login Page
%======================================================================================================
procedure loginNormalScreen
toExit := 0
%Sound
delay (100) %avoid sound glitch
fork bgMusic
music := "UI/title"
%Login
Pic.Draw (background, -30, 0, picCopy)
Pic.Draw (title, 180, 225, picMerge)
Pic.Draw (loginNormalBox, 330, 337, picMerge)
Pic.Draw (loginNormal, 587, 473, picCopy)
Pic.Draw (boarder, -20, -30, picMerge)
Font.Draw ("No Pass Required", 450, 475, font (7), white)
Font.Draw ("Brought to you by Sunny Li", 400, 435, font (8), white)
loop
Input.KeyDown (key)
Mouse.Where (mouseX, mouseY, mouseButton)
%Login from Keyboard
if length (name) > 0 then
if key (KEY_ENTER) then
finished := true
Music.PlayFileStop
delay (100)
loginNormalClick
exit
end if
else
Pic.Draw (loginNormalDisabled, 587, 473, picCopy)
end if
if key (KEY_BACKSPACE) then
if length (name) > 0 then
name := name (1 .. length (name) - 1)
end if
end if
%ch := ""
%if hasch then
getch (ch)
if ord (ch) = 8 or ord (ch) = 10 or length (name) = 15 then
ch := ""
end if
%end if
name := name + ch
%Login from Mouse (Not Recommended)
/*To use the Mouse option you should enable "if hasch then" statement,
the 3 comment above, or keep inputting a key and use the mouse which
also work.*/
if mouseX > 592 and mouseX < 675 and mouseY > 475 and mouseY < 517 then
if mouseButton = 0 then
loginNormalMouseEffect1
/*fork sounds
soundFile := "UI/BtMouseOver"
Pic.Draw (loginNormalMouseOver, 587, 473, picCopy)
delay(?)*/
else
finished := true
Music.PlayFileStop
delay (100)
loginNormalMouseEffect2
/*fork sounds
soundFile := "UI/BtMouseClick"
Pic.Draw (loginNormalPressed, 587, 473, picCopy)
delay (?)
Pic.Draw (loginNormalMouseOver, 587, 473, picCopy)
delay (?)*/
exit
end if
else
Pic.Draw (loginNormal, 587, 473, picCopy)
end if
Pic.Draw (loginNormalBox1, 437, 498, picCopy)
Font.Draw (name, 450, 505, font (1), white)
end loop
cls
end loginNormalScreen
%======================================================================================================
% Table of Content
%======================================================================================================
% Procedures
procedure lesson1
Font.Draw ("Lesson 1:", 210, 338, font (7), black)
Font.Draw ("Locate", 210, 310, font (14), black)
Font.Draw ("In Turing, in order to output a character anywhere on", 250, 280, font (5), black)
Font.Draw ("the screen, we must first learn the procedure", 210, 260, font (5), black)
Font.Draw ("locate.", 480, 260, font (7), black)
Font.Draw ("Syntax: locate ( row, column : int )", 210, 230, font (6), black)
Font.Draw ("The locate procedure moves the cursor to the given row", 250, 200, font (5), black)
Font.Draw ("and column so the next output will appear at that location.", 210, 180, font (5), black)
Font.Draw ("There are 25 rows and 80 columns. Row 1 is the top of the", 210, 160, font (5), black)
Font.Draw ("screen and Column 1 is the left side of the screen.", 210, 140, font (5), black)
end lesson1
procedure lesson2
Font.Draw ("Lesson 2:", 210, 338, font (7), black)
Font.Draw ("Clear Screen", 210, 310, font (14), black)
Font.Draw ("In Turing, to display a new graphic, we need to learn", 250, 280, font (5), black)
Font.Draw ("to clear the window with procedure", 210, 260, font (5), black)
Font.Draw ("cls.", 427, 260, font (7), black)
Font.Draw ("Syntax: cls", 210, 230, font (6), black)
Font.Draw ("The cls procedure clears the window and reset the", 250, 200, font (5), black)
Font.Draw ("cursor back to Row 1, Colume 1. Also, by using cls, the", 210, 180, font (5), black)
Font.Draw ("output window will be set to the current background color.", 210, 160, font (5), black)
end lesson2
procedure lesson3
Font.Draw ("Lesson 3:", 210, 338, font (7), black)
Font.Draw ("Display in Colors", 210, 310, font (14), black)
Font.Draw ("In Turing, we can display our results in color by using", 250, 280, font (5), black)
Font.Draw ("the predefined procedure", 210, 260, font (5), black)
Font.Draw ("color.", 365, 260, font (7), black)
Font.Draw ("Syntax: color (Color : int)", 210, 230, font (6), black)
Font.Draw ("The procedure color is used to change the color of", 250, 200, font (5), black)
Font.Draw ("the characters that are to be displayed. colour is the alternate", 210, 180, font (5), black)
Font.Draw ("spelling. Turing has 255 predefined colors", 210, 160, font (5), black)
end lesson3
procedure lesson4
Font.Draw ("Lesson 4:", 210, 338, font (7), black)
Font.Draw ("Background Color", 210, 310, font (14), black)
Font.Draw ("In Turing, we can also set the background color for", 250, 280, font (5), black)
Font.Draw ("each displayed character by using the predefined procedure", 210, 260, font (5), black)
Font.Draw ("colorback.", 210, 240, font (7), black)
Font.Draw ("Syntax: colorback (Color : int)", 210, 210, font (6), black)
Font.Draw ("The colorback procedure is used to change the text's", 250, 180, font (5), black)
Font.Draw ("or the screen's background color. The alternate spelling is", 210, 160, font (5), black)
Font.Draw ("colourback.", 210, 140, font (5), black)
end lesson4
procedure lesson5
Font.Draw ("Lesson 5:", 210, 338, font (7), black)
Font.Draw ("Hide Cursor", 210, 310, font (14), black)
Font.Draw ("In Turing, we can hide the cusor by using the predefined", 240, 280, font (5), black)
Font.Draw ("procedure", 210, 260, font (5), black)
Font.Draw ("setscreen (\"nocursor\")", 275, 260, font (7), black)
Font.Draw ("and reveal again by using", 430, 260, font (5), black)
Font.Draw ("the procedure", 210, 240, font (5), black)
Font.Draw ("setscreen (\"cursor\").", 298, 240, font (7), black)
Font.Draw ("Syntax: setscreen (\"nocursor\") and setscreen (\"cursor\")", 210, 210, font (6), black)
Font.Draw ("This procedure is particularly useful in animated graphics.", 240, 180, font (5), black)
end lesson5
procedure lesson6
Font.Draw ("Lesson 6:", 210, 338, font (7), black)
Font.Draw ("Animating Graphics", 210, 310, font (14), black)
Font.Draw ("In Turing, we can create animation by moving still", 250, 280, font (5), black)
Font.Draw ("images to different position each time.", 210, 260, font (5), black)
end lesson6
procedure lesson7
Font.Draw ("Lesson 7:", 210, 338, font (7), black)
Font.Draw ("Delay", 210, 310, font (14), black)
Font.Draw ("In Turing, we can pause the program from executing", 250, 280, font (5), black)
Font.Draw ("for a duration of time by using the statement", 210, 260, font (5), black)
Font.Draw ("delay.", 477, 260, font (7), black)
Font.Draw ("Syntax: delay (duration : int)", 210, 230, font (6), black)
Font.Draw ("Duration is measured in milliseconds, so delay (1000)", 250, 200, font (5), black)
Font.Draw ("equals to a 1 second delay. The statement delay is a very", 210, 180, font (5), black)
Font.Draw ("useful in animation.", 210, 160, font (5), black)
end lesson7
procedure lesson8
Font.Draw ("Lesson 8:", 210, 338, font (7), black)
Font.Draw ("Pause for User Input", 210, 310, font (14), black)
Font.Draw ("In Turing, we can also pause until a user inputs a single", 250, 280, font (5), black)
Font.Draw ("character. To do this we need to learn the procedure", 210, 260, font (5), black)
Font.Draw ("getch.", 530, 260, font (7), black)
Font.Draw ("Syntax: getch ( var ch : string ( 1 ) )", 210, 230, font (6), black)
Font.Draw ("Also, we can stop the user input from being displayed on", 250, 200, font (5), black)
Font.Draw ("screen by using", 210, 180, font (5), black)
Font.Draw ("setscreen (\"noecho\")", 307, 180, font (7), black)
Font.Draw ("and redisplay it by using", 450, 180, font (5), black)
Font.Draw ("setscreen (\"echo\")", 210, 160, font (7), black)
Font.Draw ("Syntax: setscreen (\"noecho\") and setscreen (\"echo\")", 210, 130, font (6), black)
end lesson8
procedure quizGame
loop
loop
cls
color (white)
locate (17, 10)
put "Question 1."
locate (18, 10)
put "To output characters anywhere in the window, we use:"
locate (19, 10)
put "1.The mouse \t2.Use space bar \t3.Procedure locate \t4.You can't"
getch (ch)
if ch not= '3' then
exit
end if
cls
locate (17, 5)
put "Question 2."
locate (18, 5)
put "Locate row 18, coloum 25:"
locate (19, 5)
put "1.locate (25,18) \t2.locate (18,25) \t3.where (18,25) \t4.where (25,18)"
getch (ch)
if ch not= '2' then
exit
end if
cls
locate (17, 10)
put "Question 3."
locate (18, 10)
put "How do you clear window?"
locate (19, 10)
put "1.cls \t\t2.clear.window \t3.clear.screen \t4.clw"
getch (ch)
if ch not= '1' then
exit
end if
cls
locate (16, 10)
put "Question 4."
locate (17, 10)
put "How do you give your text color?"
locate (18, 10)
put "1.write the color number in bracket behind the text"
locate (19, 10)
put "2.first do color (#)"
locate (20, 10)
put "3.first do colorword (#)"
locate (21, 10)
put "4.Impossible"
getch (ch)
if ch not= '2' then
exit
end if
cls
locate (17, 10)
put "Question 5."
locate (18, 10)
put "Whats the maximum color number available in Turing? \t0-#"
locate (19, 10)
put "1.156 \t2.256 \t3.255 \t4.unlimited"
getch (ch)
if ch not= '3' then
exit
end if
cls
locate (16, 10)
put "Question 6."
locate (17, 10)
put "How do you give background color?"
locate (18, 10)
put "1.colorback (#)"
locate (19, 10)
put "2.use color procedure"
locate (20, 10)
put "3.draw a colored box that fills the whole screen"
locate (21, 10)
put "4.Impossible"
getch (ch)
if ch not= '1' then
exit
end if
cls
locate (16, 10)
put "Question 7."
locate (17, 10)
put "How do you hide and show the cursor?"
locate (18, 10)
put "1.To hide: noCursor, To show: showCursor"
locate (19, 10)
put "2.To hide: hideCursor, To show: cursor"
locate (20, 10)
put "3.To hide: setscreen (\"hidecursor\"), To show: setscreen (\"showcursor\")"
locate (21, 10)
put "4.To hide: setscreen (\"nocursor\"), To show: setscreen (\"cursor\")"
getch (ch)
if ch not= '4' then
exit
end if
cls
locate (16, 10)
put "Question 8."
locate (17, 10)
put "How do you make animation in turing?"
locate (18, 10)
put "1.Use animation tools"
locate (19, 10)
put "2.Get those moving pictures on the internet"
locate (20, 10)
put "3.By having a series of still pictures slightly moved each time."
locate (21, 10)
put "4.You can't do animation in turing..."
getch (ch)
if ch not= '3' then
exit
end if
cls
locate (17, 10)
put "Question 9."
locate (18, 10)
put "To pause the program, we use delay (duration). What unit is the duration measured in?"
locate (19, 10)
put "1.seconds \t2.milliseconds \t3.minutes \t4.microseconds"
getch (ch)
if ch not= '2' then
exit
end if
cls
locate (17, 10)
put "Question 10."
locate (18, 10)
put "How can we pause the program until the user presses a key? (best option)"
locate (19, 10)
put "1.delay \t2.get \t\t3.getch (reply) \t4.get and delay"
getch (ch)
if ch not= '3' then
exit
end if
win := true
exit
end loop
exit when win = true
cls
Font.Draw ("INCORRECT!!!", maxx div 2 - 50, maxy div 2, font (14), white)
delay (2000)
end loop
cls
Font.Draw ("YOU WIN!!!", maxx div 2 - 50, maxy div 2, font (14), white)
delay (3000)
end quizGame
procedure quiz
Font.Draw ("Quiz Time!", 210, 325, font (14), black)
if mouseX > 320 and mouseX < 442 and mouseY > 225 and mouseY < 246 then
Pic.Draw (quizMouseOver, 320, 225, picMerge)
if mouseButton = 1 then
delay (100)
finished := true
Music.PlayFileStop
loading
%Extra just to make sure
delay (100)
finished := true
Music.PlayFileStop
%Quiz Here
delay (0)
fork bgMusic
music := "Final Countdown"
colorback (black)
cls
Font.Draw ("Welcome to the Quiz", maxx div 3, maxy div 2, font (14), white)
delay (3000)
cls
Font.Draw ("You will be asked 10 questions.", maxx div 3, maxy div 2, font (13), white)
delay (5000)
cls
Font.Draw ("If you answer them incorrectly,", maxx div 3, maxy div 2, font (13), white)
delay (3000)
cls
Font.Draw ("The Quiz will RESTART!!!", maxx div 3, maxy div 2, font (13), white)
delay (3000)
cls
Font.Draw ("So lets begin: 3", maxx div 3, maxy div 2, font (13), white)
delay (1000)
cls
Font.Draw ("So lets begin: 2", maxx div 3, maxy div 2, font (13), white)
delay (1000)
cls
Font.Draw ("So lets begin: 1", maxx div 3, maxy div 2, font (13), white)
delay (1000)
cls
Font.Draw ("Start!", maxx div 2 + 10, maxy div 2, font (13), white)
delay (1000)
win := false
quizGame
delay (100)
finished := true
Music.PlayFileStop
%Extra Just to make sure
delay (1)
finished := true
Music.PlayFileStop
delay (1)
fork bgMusic
music := "AboveTheTreetops"
View.Set ("offscreenonly")
end if
else
Pic.Draw (quizNormal, 320, 225, picMerge)
end if
end quiz
procedure showCredit
Font.Draw ("Credit", 210, 325, font (14), black)
Font.Draw ("Programmed and edited by:", 210, 286, font (9), black)
Font.Draw ("Sunny Li", 450, 286, font (11), black)
Font.Draw ("Image and Sound extracted from: Maplestory", 210, 250, font (8), black)
Font.Draw ("Original Artworks by: Wizet", 210, 230, font (8), black)
Font.Draw ("Soundtracks (excluding in quiz) by: Wizet", 210, 210, font (8), black)
Font.Draw ("Original Game Owned by Nexon Corporation", 210, 170, font (8), black)
Font.Draw ("COPYRIGHT C 2003 NEXON CORPORATION.", 210, 148, font (5), black)
if mouseX > 420 and mouseX < 542 and mouseY > 322 and mouseY < 343 then
Pic.Draw (creditMouseOver, 420, 322, picMerge)
if mouseButton = 1 then
delay (100)
finished := true
Music.PlayFileStop
startUp
fork bgMusic
music := "AboveTheTreetops"
View.Set ("offscreenonly")
end if
else
Pic.Draw (creditNormal, 420, 322, picMerge)
end if
end showCredit
procedure contentSelect
View.Set ("offscreenonly")
toExit := 0
for screenDrop : 0 .. 57
Pic.Draw (csBg, -94, 570 - screenDrop * 9, picCopy)
Pic.Draw (signboard1, 125, 868 - screenDrop * 9, picMerge)
Pic.Draw (signboard, 48, 990 - screenDrop * 9, picMerge)
Pic.Draw (background, -30, 0 - screenDrop * 10, picCopy)
Pic.Draw (title, 180, 225 - screenDrop * 10, picMerge)
Pic.Draw (loginNormalBox, 330, 337 - screenDrop * 10, picMerge)
Pic.Draw (loginNormal, 587, 473 - screenDrop * 10, picCopy)
Font.Draw ("No Pass Required", 450, 475 - screenDrop * 10, font (7), white)
Font.Draw ("Brought to you by Sunny Li", 400, 435 - screenDrop * 10, font (8), white)
Font.Draw (name, 450, 505 - screenDrop * 10, font (1), white)
Pic.Draw (boarder, -20, -30, picMerge)
View.Update
end for
delay (800)
soundFinished := true
Music.PlayFileStop
delay (100) %Required to avoid sound glitch
fork bgMusic
music := "AboveTheTreetops"
loop
Input.KeyDown (key)
Mouse.Where (mouseX, mouseY, mouseButton)
Pic.Draw (csBg, -94, 57, picCopy)
if scrollPosition = 1 then
Pic.Draw (signboard1, 125, 355, picMerge)
Font.Draw ("Use mouse to select", 300, 373, font (8), black)
Font.Draw ("or input the lesson #, Q as Quiz, and C to see Credit", 240, 360, font (4), black)
else
Pic.Draw (scroll3, 125, 90, picMerge)
end if
Pic.Draw (signboard, 48, 477, picMerge)
Pic.Draw (boarder, -20, -30, picMerge)
if mouseX > 0 and mouseX < 100 and mouseY > 120 and mouseY < 157 or key (KEY_ESC) then
if mouseButton = 1 or key (KEY_ESC) then
Pic.Draw (backPressed, -18, 110, picMerge)
View.Update
toExit := 1
delay (100)
else
Pic.Draw (backMouseOver, -18, 110, picMerge)
end if
else
Pic.Draw (backNormal, -18, 110, picMerge)
end if
ch := ""
if hasch then
getch (ch)
end if
%When pressed the Exit button in content select, toExit becomes one...so this is what it'll happen
if toExit = 1 then
for screenRaise : 0 .. 57
Pic.Draw (csBg, -94, 57 + screenRaise * 9, picCopy)
Pic.Draw (signboard1, 125, 355 + screenRaise * 9, picMerge)
Pic.Draw (signboard, 48, 477 + screenRaise * 9, picMerge)
Pic.Draw (background, -30, -570 + screenRaise * 10, picCopy)
Pic.Draw (title, 180, -345 + screenRaise * 10, picMerge)
Pic.Draw (loginNormalBox, 330, -233 + screenRaise * 10, picMerge)
Pic.Draw (loginNormal, 587, -97 + screenRaise * 10, picCopy)
Font.Draw ("No Pass Required", 450, -95 + screenRaise * 10, font (7), white)
Font.Draw ("Brought to you by Sunny Li", 400, -135 + screenRaise * 10, font (8), white)
Font.Draw (name, 450, -65 + screenRaise * 10, font (1), white)
Pic.Draw (boarder, -20, -30, picMerge)
View.Update
end for
setscreen ("nooffscreenonly")
exit
end if
%Close Scroll Thingy
if mouseX > 75 and mouseX < 165 and mouseY > 75 and mouseY < 543
or mouseX > 608 and mouseX < 695 and mouseY > 75 and mouseY < 543
or mouseX > 75 and mouseX < 695 and mouseY > 75 and mouseY < 90
or mouseX > 75 and mouseX < 695 and mouseY > 485 and mouseY < 543
or ch = "0" then
if scrollPosition not= 1 and mouseButton = 1 or scrollPosition not= 1 and ch = "0" then
scrollUp
%drawfillbox (75,75,695,543,black)
selectDown := 0
end if
end if
%Lesson 1 (Locate)
if mouseX > 168 and mouseX < 192 and mouseY > 388 and mouseY < 482 or ch = '1' then
Pic.Draw (selectNormal, 168, 383, picMerge)
Pic.Draw (selectFocus, 165, 382, picMerge)
Pic.Draw (textLesson, 169, 400, picMerge)
Font.Draw ("1", 173, 393, font (12), white)
if selectDown = 1 then
lesson1
elsif mouseButton = 1 or ch = '1' then
Pic.Draw (selectNormal, 168, 383, picMerge)
Pic.Draw (textLesson, 170, 400, picMerge)
Font.Draw ("1", 174, 393, font (12), white)
scrollDown
selectDown := 1
end if
else
if selectDown = 1 then
Pic.Draw (selectNormal, 168, 383, picMerge)
Pic.Draw (textLesson, 170, 400, picMerge)
Font.Draw ("1", 174, 393, font (12), white)
lesson1
else
Pic.Draw (selectNormal, 168, 388, picMerge)
Pic.Draw (textLesson, 170, 405, picMerge)
Font.Draw ("1", 174, 398, font (12), white)
end if
end if
%Lesson 2
if mouseX > 195 and mouseX < 219 and mouseY > 388 and mouseY < 482 or ch = '2' then
Pic.Draw (selectNormal, 195, 383, picMerge)
Pic.Draw (selectFocus, 192, 382, picMerge)
Pic.Draw (textLesson, 196, 400, picMerge)
Font.Draw ("2", 200, 393, font (12), white)
if selectDown = 2 then
lesson2
elsif mouseButton = 1 or ch = '2' then
Pic.Draw (selectNormal, 195, 383, picMerge)
Pic.Draw (textLesson, 197, 400, picMerge)
Font.Draw ("2", 201, 393, font (12), white)
scrollDown
selectDown := 2
end if
else
if selectDown = 2 then
Pic.Draw (selectNormal, 195, 383, picMerge)
Pic.Draw (textLesson, 197, 400, picMerge)
Font.Draw ("2", 201, 393, font (12), white)
lesson2
else
Pic.Draw (selectNormal, 195, 388, picMerge)
Pic.Draw (textLesson, 197, 405, picMerge)
Font.Draw ("2", 201, 398, font (12), white)
end if
end if
%Lesson 3
if mouseX > 222 and mouseX < 246 and mouseY > 388 and mouseY < 482 or ch = '3' then
Pic.Draw (selectNormal, 222, 383, picMerge)
Pic.Draw (selectFocus, 219, 382, picMerge)
Pic.Draw (textLesson, 223, 400, picMerge)
Font.Draw ("3", 227, 393, font (12), white)
if selectDown = 3 then
lesson3
elsif mouseButton = 1 or ch = '3' then
Pic.Draw (selectNormal, 222, 383, picMerge)
Pic.Draw (textLesson, 224, 400, picMerge)
Font.Draw ("3", 228, 393, font (12), white)
scrollDown
selectDown := 3
end if
else
if selectDown = 3 then
Pic.Draw (selectNormal, 222, 383, picMerge)
Pic.Draw (textLesson, 224, 400, picMerge)
Font.Draw ("3", 228, 393, font (12), white)
lesson3
else
Pic.Draw (selectNormal, 222, 388, picMerge)
Pic.Draw (textLesson, 224, 405, picMerge)
Font.Draw ("3", 228, 398, font (12), white)
end if
end if
%Lesson 4
if mouseX > 249 and mouseX < 273 and mouseY > 388 and mouseY < 482 or ch = '4' then
Pic.Draw (selectNormal, 249, 383, picMerge)
Pic.Draw (selectFocus, 246, 382, picMerge)
Pic.Draw (textLesson, 250, 400, picMerge)
Font.Draw ("4", 254, 393, font (12), white)
if selectDown = 4 then
lesson4
elsif mouseButton = 1 or ch = '4' then
Pic.Draw (selectNormal, 249, 383, picMerge)
Pic.Draw (textLesson, 251, 400, picMerge)
Font.Draw ("4", 255, 393, font (12), white)
scrollDown
selectDown := 4
end if
else
if selectDown = 4 then
Pic.Draw (selectNormal, 249, 383, picMerge)
Pic.Draw (textLesson, 251, 400, picMerge)
Font.Draw ("4", 255, 393, font (12), white)
lesson4
else
Pic.Draw (selectNormal, 249, 388, picMerge)
Pic.Draw (textLesson, 251, 405, picMerge)
Font.Draw ("4", 255, 398, font (12), white)
end if
end if