home *** CD-ROM | disk | FTP | other *** search
- ;=========================================================
- ;======================= SORTER.MPS ======================
- ;=========================================================
- ; ETHAN
- ;
- ;
- ;
- ;
- ;
- ; REQUIRED RESOURCE: SORTER.RSC
-
- ;=== INITIAL COVERS ===
- yield off
- Scene 2000
- rrIn=OMAnimation 106 142 2514
- set rrIn touchy 0
- set rrIn movable 0
- set rrIn z 1
- matIn=OMAnimation 384 12 2515
- set matIn touchy 0
- set matIn movable 0
- mitIn=OMAnimation 0 175 2516
- set mitIn touchy 0
- set mitIn movable 0
- set mitIn z 0
- discardBin=OMAnimation 413 30 2503
- set discardBin movable 0
- set discardBin z 0
- lever=OMAnimation 413 30 2506
- set lever touchy 0
- set lever movable 0
- set lever z 2
- cushion=OMAnimation 413 30 2510
- set cushion touchy 0
- set cushion movable 0
- set cushion z 0
- shelves=OMAnimation 413 30 2512
- set shelves movable 0
- set shelves z 0
- shooter=OMAnimation 413 30 2513
- set shooter touchy 0
- set shooter movable 0
- set shooter z 0
- goButton=OMAnimation 111 33 2549
- set goButton movable 0
- set goButton touchy 0
- shelfAll=OMAnimation 517 1 2556
- set shelfAll x 513
- set shelfAll visible 0
- set shelfAll movable 0
- set shelfAll z 0
- resetButton=RPButton 462 447 10042
- set resetButton hit resetHdlr
- continueButton=RPButton 553 447 10041
- set continueButton hit continueHdlr
- yield on
-
- yield off
- play rrIn
- play matIn
- play mitIn
- yield on
-
- procedure dummy
- [
- ]
-
- set rrIn paused instructions
-
- ;=== GLOBALS ===
- totalRight=0
- totalWrong=0
- total=0
- value=0
- correctOnShelf=0
- areWeDoneYet=0
- number=0
-
- ;=== CONSTANTS ===
- kWordInDelay=0.85
- ; WORD ON PILLOW
- wordAArray=[ 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029
- ; WORD ON SHELF
- wordBArray=[ 10030 10021 10032 10033 10024 10025 10036 10027 10038 10029
- ; BOX
- box=1
- ; WORD SAID BY READER
- rrWordArray=[ 2789 2704 2790 2791 2912 2733 2794 2809 2795 2783
- ; VALUE ARRAY
- valArray=[ 1 0 1 1 0 0 1 0 1 0
- ; X1 POS
- X1Pos=[ 305 308 313 314 307 311 312 315 309 311
- ; Y1 POS
- Y1Pos=[ 190 193 189 189 190 193 188 192 189 192
- ; X2 POS
- X2Pos=[ 537 539 544 545 537 543 544 547 542 542
- ; Y2 POS
- Y2Pos=[ 97 101 98 97 99 102 96 99 97 99
-
- for cnt 0 9
- [
- status.cnt=1
- ]
-
- procedure instructions
- [
- yield off
- drop rrIn
- drop mitIn
- rrIntro=OMAnimation 106 142 2517
- set rrIntro movable 0
- set rrIntro z 2
- mitAm=OMAnimation 330 396 2564
- set mitAm mouseDown play_mit
- set mitAm movable 0
- set mitAm z 1
- set mitAm touchy 0
- yield on
- yield off
- play rrIntro
- set rrIntro paused waitForButton
- yield on
- ]
- ;=======================================
- ;=== INSTRUCTIONS AND INTRO ===
- ;=======================================
-
- procedure waitForButton
- [
- yield off
- set mitAm touchy 1
- set goButton touchy 1
- set goButton mouseDown playButton
- yield on
- ]
- ;=======================================
- ;=== WAIT FOR BUTTON ===
- ;=======================================
-
- procedure playButton
- [
- yield off
- set mitAm touchy 0
- play goButton
- set goButton paused defineTarget
- yield on
- ]
- ;=======================================
- ;=== PLAY BUTTON ===
- ;=======================================
-
- procedure defineTarget
- [
- yield off
- drop rrIntro
- set goButton touchy 0
- rrBeginSndIs=OMAnimation 106 142 2609
- set rrBeginSndIs movable 0
- jxx=OMAnimation 300 60 10040
- set jxx x 300
- set jxx y 60
- set jxx z 0
- set jxx movable 0
- set jxx touchy 0
- yield on
- pause 4
- yield off
- rrJSnd=OMAnimation 106 142 2659
- set rrJSnd movable 0
- set rrJSnd paused theBrain
- yield on
- ]
- ;=======================================
- ;=== J _ _ ===
- ;=======================================
-
- procedure theBrain
- [
- rnd=?
- status.rnd=0
- box=rnd+1
- call crankWord
- ]
- ;=======================================
- ;=== THEBRAIN ===
- ;=======================================
-
- procedure crankWord
- [
- yield off
- drop rrBeginSndIs
- drop rrJSnd
- set goButton touchy 0
- set lever visible 0
- set cushion visible 1
- rrCrank=OMAnimation 202 148 2600
- set rrCrank touchy 0
- set rrCrank movable 0
- yield on
- pause 3
- yield off
- set shooter visible 0
- set goButton visible 0
- boxIn=OMAnimation 30 0 2552
- set boxIn touchy 0
- set boxIn movable 0
- set boxIn z 1
- set boxIn special bounce.0
- set boxIn paused waitForInput
- yield on
- pause 1
- set cushion visible 0
- ]
- ;=======================================
- ;=== CRANKS AND WORD ===
- ;=======================================
-
- procedure bounce.0
- [
- yield off
- get boxIn param 1 Code
- if -2000=Code
- [
- word=OMAnimation 302 178 wordAArray.box
- set word x X1Pos.box
- set word y Y1Pos.box
- set word z 1
- set word touchy 0
- set word movable 0
- ]
- if -2003=Code
- [
- get boxIn param 3 change
- play word offset 0 change
- ]
- yield on
- ]
- ;=======================================
- ;=== BOUNCE 0 ===
- ;=======================================
-
- procedure waitForInput
- [
- yield off
- set lever visible 1
- set cushion visible 0
- drop rrCrank
- rrWord=OMAnimation 106 142 rrWordArray.box
- set rrWord touchy 0
- set rrWord movable 0
- value=valArray.box
- ;=== HOTSPOTS ===
- keeper=RHotSpot 519 34 639 395
- discard=RHotSpot 230 262 418 383
- set keeper hit keepWord
- set discard hit trashWord
- set mitAm touchy 1
- yield on
- ]
- ;=======================================
- ;=== WORD IS DISPLAYED, WAITING FOR USER INTERACTION ===
- ;=======================================
-
-
- procedure keepWord
- [
- yield off
- drop keeper
- drop discard
- set mitAm touchy 0
- set cushion visible 0
- set shooter visible 1
- set goButton visible 1
- drop word
- drop boxIn
- keeperAO=OMAnimation 268 84 2555
- set keeperAO touchy 0
- set keeperAO movable 0
- set keeperAO z 0
- set keeperAO special bounce.1
- set keeperAO paused retextWord
- word.0=OMAnimation 302 178 wordBArray.box
- set word.0 x X1Pos.box
- set word.0 y Y1Pos.box-10
- set word.0 touchy 0
- set word.0 movable 0
- if value=1
- [
- totalRight=totalRight+1
- correctOnShelf=correctOnShelf+1
- ]
- else
- [
- totalWrong=totalWrong+1
- ]
- yield on
- ]
- ;=======================================
- ;=== PLACE WORD ON SHELF ===
- ;=======================================
-
- procedure bounce.1
- [
- yield off
- get keeperAO param 1 Code
- if -2001=Code
- [
- drop word.0
- ]
- if -2003=Code
- [
- get keeperAO param 2 P2
- get keeperAO param 3 P3
- play word offset P2 P3
- ]
- yield on
- ]
- ;=======================================
- ;=== BOUNCE 1 ===
- ;=======================================
-
- procedure retextWord
- [
- yield off
- drop word
- set cushion visible 1
- set shelves visible 0
- set shelfAll visible 1
- shelfText.total=OMAnimation 537 150 wordBArray.box
- set shelfText.total x X2Pos.box
- set shelfText.total y Y2Pos.box
- set shelfText.total z 99
- set shelfText.total touchy 0
- set shelfText.total movable 0
- total=total+1
- call check_total
- if areWeDoneYet=1
- [
- set shelfAll paused dummy
- call completion.1
- ]
- else
- [
- set shelfAll special shiftWords
- set shelfAll paused keepOnGoing
- play shelfAll
- ]
- yield on
- ]
- ;=======================================
- ;=== PUT WORD BACK ON BOX ===
- ;=======================================
-
-
- procedure shiftWords
- [
- yield off
- get shelfAll param 1 Code
- if -2003=Code
- [
- play shelfText.0 offset 0 9
- play shelfText.1 offset 0 9
- play shelfText.2 offset 0 9
- play shelfText.3 offset 0 9
- drop keeperAO
- ]
- yield on
- ]
- ;=======================================
- ;=== SHIFT WORDS WITH SHELF ===
- ;=======================================
-
- procedure trashWord
- [
- yield off
- set mitAm touchy 0
- drop keeper
- drop discard
- drop boxIn
- set discardBin visible 0
- set cushion visible 0
- set shooter visible 1
- set goButton visible 1
- discardAO=OMAnimation 251 201 2554
- set discardAO touchy 0
- set discardAO movable 0
- set discardAO z 0
- set discardAO special bounce.2
- set discardAO paused keepOnGoing
- if value=0
- [
- totalRight=totalRight+1
- ]
- else
- [
- totalWrong=totalWrong+1
- ]
- yield on
- ]
- ;=======================================
- ;=== TRASH WORD ===
- ;=======================================
-
- procedure bounce.2
- [
- yield off
- get discardAO param 1 Code
- if -2001=Code
- [
- drop word
- ]
- if -2003=Code
- [
- get discardAO param 2 P2
- get discardAO param 3 P3
- play word offset P2 P3
- ]
- yield on
- ]
- ;=======================================
- ;=== BOUNCE 1 ===
- ;=======================================
-
- procedure keepOnGoing
- [
- yield off
- set discardBin visible 1
- drop discardAO
- say number
- if number=9
- [
- set cushion visible 1
- call completion.0
- ]
- else
- [
- drop rrWord
- rnd=?
- for (status.rnd#1)
- [
- rnd=?
- ]
- status.rnd=0
- box=rnd+1
-
- call crankWord
- ]
- number=number+1
- yield on
- ]
- ;=======================================
- ;=== KEEPONGOING ===
- ;=======================================
-
- procedure completion.0
- [
- yield off
- if correctOnShelf>0
- [
- ; AT LEAST ONE RIGHT ANSWER
- some=OMAnimation 106 142 2617
- set some touchy 0
- set some movable 0
- set some z 99
- set some paused sayJuh.0
- ]
- else
- [
- call boxOut.total
- ]
- yield on
- ]
- ;=======================================
- ;=== COMPLETION_0 ===
- ;=======================================
-
- procedure sayJuh.0
- [
- pause 0.5
- yield off
- drop some
- juh=OMAnimation 201 144 2659
- set juh touchy 0
- set juh moveable 0
- yield on
- call boxOut.total
- ]
- ;=======================================
- ;=== SAYJUH.0 ===
- ;=======================================
-
- procedure boxOut.1
- [
- yield off
- drop shelfAll
- bottomCover=OMAnimation 0 0 2505
- set bottomCover z 99
- set bottomCover touchy 0
- set bottomCover movable 0
- shelfOut=OMAnimation 512 0 2612
- set shelfOut x 512
- set shelfOut y 0
- set shelfOut z 0
- set shelfOut touchy 0
- set shelfOut movable 0
- set shelfOut special loseWords
- set shelfOut paused fin
- yield on
- ]
- ;=======================================
- ;=== BOXOUT.1 ===
- ;=======================================
-
- procedure boxOut.2
- [
- yield off
- drop shelfAll
- bottomCover=OMAnimation 0 0 2505
- set bottomCover z 99
- set bottomCover touchy 0
- set bottomCover movable 0
- shelfOut=OMAnimation 512 0 2613
- set shelfOut x 512
- set shelfOut y 0
- set shelfOut z 0
- set shelfOut touchy 0
- set shelfOut movable 0
- set shelfOut special loseWords
- set shelfOut paused fin
- yield on
- ]
- ;=======================================
- ;=== BOXOUT.2 ===
- ;=======================================
-
- procedure boxOut.3
- [
- yield off
- drop shelfAll
- bottomCover=OMAnimation 0 0 2505
- set bottomCover z 99
- set bottomCover touchy 0
- set bottomCover movable 0
- shelfOut=OMAnimation 512 0 2614
- set shelfOut x 512
- set shelfOut y 0
- set shelfOut z 0
- set shelfOut touchy 0
- set shelfOut movable 0
- set shelfOut special loseWords
- set shelfOut paused fin
- yield on
- ]
- ;=======================================
- ;=== BOXOUT.3 ===
- ;=======================================
-
- procedure boxOut.4
- [
- yield off
- drop shelfAll
- bottomCover=OMAnimation 0 0 2505
- set bottomCover z 99
- set bottomCover touchy 0
- set bottomCover movable 0
- shelfOut=OMAnimation 512 0 2615
- set shelfOut x 512
- set shelfOut y 0
- set shelfOut z 0
- set shelfOut touchy 0
- set shelfOut movable 0
- set shelfOut special loseWords
- set shelfOut paused fin
- yield on
- ]
- ;=======================================
- ;=== BOXOUT.4 ===
- ;=======================================
-
- procedure completion.1
- [
- yield off
- ; say "situation_1: 5 words filled the shelf."
- say correctOnShelf
- if correctOnShelf=5
- [
- ; ALL 5 CORRECT ANSWERS
- call perfectReward
- ]
- else
- [
- if correctOnShelf>0
- [
- ; AT LEAST ONE RIGHT ANSWER
- some=OMAnimation 106 142 2617
- set some movable 0
- set some z 99
- set some touchy 0
- set some movable 0
- set some paused sayJuh.1
- ]
- else
- [
- call cleanShelf
- ]
- ]
- yield on
- ]
- ;=======================================
- ;=== COMPLETION.1 ===
- ;=======================================
-
- procedure sayJuh.1
- [
- pause 0.5
- yield off
- drop some
- juh=OMAnimation 201 144 2659
- set juh touchy 0
- set juh moveable 0
- yield on
- call cleanShelf
- ]
- ;=======================================
- ;=== SAYJUH.1 ===
- ;=======================================
-
- procedure loseWords
- [
- yield off
- get shelfOut param 1 Code
- kMagicNumber=350
- get shelfText.0 y ypos.0
- if ypos.0<kMagicNumber
- [
- if -2003=Code
- [
- play shelfText.0 offset 0 9
- ]
- ]
- else
- [
- drop shelfText.0
- ]
- get shelfText.1 y ypos.1
- if ypos.1<kMagicNumber
- [
- if -2003=Code
- [
- play shelfText.1 offset 0 9
- ]
- ]
- else
- [
- drop shelfText.1
- ]
- get shelfText.2 y ypos.2
- if ypos.2<kMagicNumber
- [
- if -2003=Code
- [
- play shelfText.2 offset 0 9
- ]
- ]
- else
- [
- drop shelfText.2
- ]
- get shelfText.3 y ypos.3
- if ypos.3<kMagicNumber
- [
- if -2003=Code
- [
- play shelfText.3 offset 0 9
- ]
- ]
- else
- [
- drop shelfText.3
- ]
- get shelfText.4 y ypos.4
- if ypos.4<kMagicNumber
- [
- if -2003=Code
- [
- play shelfText.4 offset 0 9
- ]
- ]
- else
- [
- drop shelfText.4
- ]
- yield on
- ]
- ;=======================================
- ;=== LOSE WORDS ===
- ;=======================================
-
-
- procedure check_total
- [
- yield off
- if total=5
- [
- areWeDoneYet=1
- ]
- yield on
- ]
- ;=======================================
- ;=== CHECK_TOTAL ===
- ;=======================================
-
- procedure perfectReward
- [
- yield off
- set mitAm visible 0
- drop rrWord
- rrJump=OMAnimation 0 0 2603
- set rrJump touchy 0
- set rrJump movable 0
- mitWatch=OMAnimation 0 0 2531
- set mitWatch touchy 0
- set mitWatch movable 0
- set rrJump paused doReward
- yield on
- ]
- ;=======================================
- ;=== PERFECT REWARD ===
- ;=======================================
-
- procedure doReward
- [
- drop rrJump
- yield off
- rrReward_1=OMAnimation 0 0 2528
- set rrReward_1 movable 0
- set rrReward_1 paused restoreState
- rrIn=OMAnimation 106 142 2514
- set rrIn movable 0
- set rrIn z 1
- set rrIn visible 0
- set rrIn touchy 0
- set rrIn movable 0
- mitIn=OMAnimation 0 175 2516
- set mitIn movable 0
- set mitIn z 0
- set mitIn visible 0
- set mitIn touchy 0
- set mitIn movable 0
- yield on
- ]
- ;=======================================
- ;=== DO REWARD ===
- ;=======================================
-
- procedure restoreState
- [
- yield off
- drop rrReward_1
- drop mitWatch
- set rrIn visible 1
- set mitIn visible 1
- play rrIn
- play mitIn
- set rrIn paused cleanShelf
- yield on
- ]
- ;=======================================
- ;=== RESTORE STATE ===
- ;=======================================
-
- procedure cleanShelf
- [
- yield off
- drop keeperAO
- drop shelfAll
- bottomCover=OMAnimation 0 0 2505
- set bottomCover z 99
- set bottomCover touchy 0
- set bottomCover movable 0
- shelfOut=OMAnimation 512 0 2616
- set shelfOut x 512
- set shelfOut y 0
- set shelfOut z 0
- set shelfOut touchy 0
- set shelfOut movable 0
- set shelfOut special loseWords
- set shelfOut paused fin
- yield on
- ]
- ;=======================================
- ;=== CLEAN SHELF ===
- ;=======================================
-
- procedure play_mit
- [
- yield off
- set goButton touchy 0
- set mitAm touchy 0
- stopIt=RHotSpot 2 1 638 399
- set stopIt hit dummy
- play RECEIVER
- steam=OMAnimation 20 124 2563
- set steam touchy 0
- set steam movable 0
- set steam z 0
- play steam
- set steam paused drop_steam
- yield on
- ]
- ;=======================================
- ;=== PLAY MIT PIPE ANIMATION ===
- ;=======================================
-
- procedure drop_steam
- [
- yield off
- set mitAm touchy 1
- set goButton touchy 1
- drop steam
- drop stopIt
- yield on
- ]
- ;=======================================
- ;=== DROP THE STEAM ===
- ;=======================================
-
- procedure fin
- [
- yield off
- schedule 15 moveOn
- yield on
- ]
- ;=======================================
- ;=== FIN ===
- ;=======================================
-
- procedure moveOn
- [
- yield off
- drop trinkets
- relay reader2.mps
- yield on
- ]
- ;=======================================
- ;=== MOVEON ===
- ;=======================================
-
- procedure resetHdlr
- [
- yield off
- click1=RSound 10043 -1
- play click1 start
- drop trinkets
- relay sorter.mps
- yield on
- ]
- ;=======================================
- ;=== RESETHDLR ===
- ;=======================================
-
- procedure continueHdlr
- [
- yield off
- click2=RSound 10043 -1
- play click2 start
- drop trinkets
- relay reader2.mps
- yield on
- ]
- ;=======================================
- ;=== CONTINUEHDLR ===
- ;=======================================
-
-