home *** CD-ROM | disk | FTP | other *** search
/ Headbone Interactive / Headbone_Interactive_CD-ROM_Sampler_1995.iso / pc / demos / abf / intro.dxr / 00075_main scripts.ls < prev    next >
Encoding:
Text File  |  1995-09-15  |  11.1 KB  |  419 lines

  1. on startMovie
  2.   global gvBackSprite, gvAlphabetStripSprite, gvAlphaHiliteBoxSprite, gvQuitButtonSprite, gvPicSignSprite, gvRhySignSprite, gvFrogSprite, gvParrotSprite, gvVelmaSprite, gvRedLetterSprite, gvBonkHeadSprite, gvBonkBodySprite, gvHelpSignSprite, gvBonkRightArmSprite, gvBonkLeftArmSprite, gvCurLetter, gvfRhymeTrack, gvfFromIntro, MOV_EXT, SFX_EXT, DIR_SYM, gvfRealQuit, gvEntranceTime, gvIntroSyncheTime, gvBackDrop, IBM
  3.   setUpTop20()
  4.   set gvCurLetter to "X"
  5.   set gvfFromIntro to 1
  6.   set gvfRhymeTrack to 1
  7.   set gvfRealQuit to 0
  8.   set gvIntroSyncheTime to 3 * 60
  9.   if voidp(SFX_EXT) then
  10.     set SFX_EXT to ".aif"
  11.   end if
  12.   if voidp(MOV_EXT) then
  13.     set MOV_EXT to ".dxr"
  14.   end if
  15.   if voidp(DIR_SYM) then
  16.     if the machineType = IBM then
  17.       set DIR_SYM to "\"
  18.     else
  19.       set DIR_SYM to ":"
  20.     end if
  21.   end if
  22.   set gvBackSprite to 1
  23.   set gvBonkBodySprite to 5
  24.   set gvBonkHeadSprite to 6
  25.   set gvBonkRightArmSprite to 7
  26.   set gvPicSignSprite to 9
  27.   set gvBonkLeftArmSprite to 10
  28.   set gvVelmaSprite to 11
  29.   set gvFrogSprite to 13
  30.   set gvParrotSprite to 15
  31.   set gvAlphabetStripSprite to 17
  32.   set gvAlphaHiliteBoxSprite to 18
  33.   set gvQuitButtonSprite to 20
  34.   set gvRhySignSprite to 22
  35.   set gvHelpSignSprite to 23
  36.   set gvRedLetterSprite to 25
  37.   set the visible of sprite gvAlphaHiliteBoxSprite to 0
  38.   set the visible of sprite gvRedLetterSprite to 0
  39.   set the mouseDownScript to EMPTY
  40.   cursor(200)
  41.   set the keyDownScript to "checkKeyForQuit"
  42.   set the exitLock to 1
  43. end
  44.  
  45. on stopMovie
  46.   set the keyDownScript to EMPTY
  47.   set the mouseDownScript to EMPTY
  48.   set the timeoutScript to EMPTY
  49. end
  50.  
  51. on idle
  52.   if not checkForTop20() then
  53.     if the frame < label("pause") then
  54.       set the mouseDownScript to "mouseDownPrePause"
  55.       cursor(0)
  56.     else
  57.       set the mouseDownScript to "mouseDownHandler"
  58.       cursor(0)
  59.     end if
  60.   end if
  61. end
  62.  
  63. on wait vTicks
  64.   if vTicks > 0 then
  65.     set vOrigTime to the timer
  66.     repeat while the timer < (vOrigTime + vTicks)
  67.       nothing()
  68.     end repeat
  69.   end if
  70. end
  71.  
  72. on puppetsOn
  73.   global gvAlphaHiliteBoxSprite, gvQuitButtonSprite, gvPicSignSprite, gvRhySignSprite, gvAlphabetStripSprite
  74.   set the puppet of sprite gvAlphabetStripSprite to 1
  75.   set the puppet of sprite gvAlphaHiliteBoxSprite to 1
  76.   set the puppet of sprite gvQuitButtonSprite to 1
  77.   set the puppet of sprite gvPicSignSprite to 1
  78.   set the puppet of sprite gvRhySignSprite to 1
  79.   set the immediate of sprite gvAlphabetStripSprite to 1
  80.   updateStage()
  81. end
  82.  
  83. on puppetsOff
  84.   global gvAlphabetStripSprite
  85.   repeat with viSprite = 1 to 48
  86.     set the puppet of sprite viSprite to 0
  87.   end repeat
  88.   set the immediate of sprite gvAlphabetStripSprite to 0
  89.   updateStage()
  90. end
  91.  
  92. on mouseDownHandler
  93.   global gvBackSprite, gvAlphabetStripSprite, gvQuitButtonSprite, gvHelpSignSprite
  94.   setUpTop20()
  95.   set the mouseDownScript to EMPTY
  96.   cursor(200)
  97.   set vSprite to the clickOn
  98.   set vClickPoint to the clickLoc
  99.   if vSprite = gvBackSprite then
  100.     handleClickOnOtherStuff()
  101.   else
  102.     if vSprite = gvAlphabetStripSprite then
  103.       handleClickInAlphabetStrip(the locH of vClickPoint, the locV of vClickPoint)
  104.     else
  105.       if vSprite = gvQuitButtonSprite then
  106.         handleClickQuit()
  107.       else
  108.         if vSprite = gvHelpSignSprite then
  109.           handleClickHelp()
  110.         end if
  111.       end if
  112.     end if
  113.   end if
  114. end
  115.  
  116. on mouseDownPrePause
  117.   global gvQuitButtonSprite, gvHelpSignSprite
  118.   setUpTop20()
  119.   set the mouseDownScript to EMPTY
  120.   cursor(200)
  121.   set vSprite to the clickOn
  122.   if vSprite = gvQuitButtonSprite then
  123.     handleClickQuit()
  124.   else
  125.     if vSprite = gvHelpSignSprite then
  126.       handleClickHelp()
  127.     end if
  128.   end if
  129. end
  130.  
  131. on checkForMouseDownOnSTOP
  132.   global gvQuitButtonSprite
  133.   set vfSTOP to 0
  134.   if the mouseDown then
  135.     if the mouseCast = the castNum of sprite gvQuitButtonSprite then
  136.       set vfSTOP to 1
  137.     end if
  138.   end if
  139.   return vfSTOP
  140. end
  141.  
  142. on handleClickInAlphabetStrip vMouseH, vMouseV
  143.   global gvCurLetter, gvAlphabetStrip, gvAlphaHiliteBoxSprite, gvBonkHeadSprite, SFX_EXT
  144.   set vfOtherLetter to 0
  145.   set vLetter to (vMouseH - 16) / 21
  146.   if vLetter < 23 then
  147.     set vfOtherLetter to 1
  148.     set vLetter to 23
  149.   else
  150.     if vLetter > 25 then
  151.       set vLetter to 25
  152.     end if
  153.   end if
  154.   set the locH of sprite gvAlphaHiliteBoxSprite to (vLetter * 21) + 30
  155.   updateStage()
  156.   repeat while the stillDown
  157.     set vLetter to (the mouseH - 16) / 21
  158.     if vLetter < 23 then
  159.       set vLetter to 23
  160.     end if
  161.     if vLetter > 25 then
  162.       set vLetter to 25
  163.     end if
  164.     set the locH of sprite gvAlphaHiliteBoxSprite to (vLetter * 21) + 30
  165.     updateStage()
  166.   end repeat
  167.   set vLetter to numToChar(charToNum("A") + vLetter)
  168.   set gvCurLetter to vLetter
  169.   if vfOtherLetter then
  170.     puppetSound("1letter.aif")
  171.     updateStage()
  172.     animateChar(gvBonkHeadSprite, 10)
  173.   else
  174.     flashRedLetter(gvCurLetter)
  175.     puppetSound("1start.aif")
  176.     updateStage()
  177.     animateChar(gvBonkHeadSprite, 10)
  178.     fadeAway()
  179.   end if
  180. end
  181.  
  182. on flashRedLetter vLetter
  183.   global gvRedLetterSprite
  184.   set the castNum of sprite gvRedLetterSprite to the number of cast ("red" & vLetter)
  185.   set the visible of sprite gvRedLetterSprite to 1
  186.   updateStage()
  187.   wait(15)
  188.   set the visible of sprite gvRedLetterSprite to 0
  189.   updateStage()
  190. end
  191.  
  192. on animateChar vSprite, vWaitTime
  193.   set vCharCast to the castNum of sprite vSprite
  194.   set vCast to 1
  195.   set vfBlink to 0
  196.   repeat while soundBusy(1)
  197.     if vCast < 3 then
  198.       set the castNum of sprite vSprite to vCharCast + vCast
  199.       updateStage()
  200.       wait(vWaitTime)
  201.       set the castNum of sprite vSprite to vCharCast
  202.       updateStage()
  203.       wait(vWaitTime)
  204.       set vCast to vCast + 1
  205.     else
  206.       if vfBlink = 0 then
  207.         set the castNum of sprite vSprite to vCharCast + vCast
  208.         updateStage()
  209.         wait(vWaitTime)
  210.         set vfBlink to 1
  211.       else
  212.         set vfBlink to 0
  213.       end if
  214.       set vCast to 1
  215.     end if
  216.     if checkForMouseDownOnSTOP() then
  217.       set the mouseDownScript to EMPTY
  218.       cursor(200)
  219.       handleClickQuit()
  220.       abort()
  221.     end if
  222.   end repeat
  223.   set the castNum of sprite vSprite to vCharCast
  224.   updateStage()
  225.   set the timeoutLapsed to 0
  226. end
  227.  
  228. on doBlinkChar vSprite
  229.   set vOrigCast to the castNum of sprite vSprite
  230.   set the castNum of sprite vSprite to vOrigCast + 3
  231.   updateStage()
  232.   wait(10)
  233.   set the castNum of sprite vSprite to vOrigCast
  234.   updateStage()
  235. end
  236.  
  237. on doFarmerPoint vPoint
  238.   global gvBonkLeftArmSprite
  239.   if vPoint then
  240.     set the castNum of sprite gvBonkLeftArmSprite to the number of cast "Point1.pic"
  241.   else
  242.     set the castNum of sprite gvBonkLeftArmSprite to the number of cast "LeftArm.pic"
  243.   end if
  244.   updateStage()
  245. end
  246.  
  247. on doFrogJump vHowHigh
  248.   global gvFrogSprite
  249.   set vOrigV to the locV of sprite gvFrogSprite
  250.   set vOrigCast to the castNum of sprite gvFrogSprite
  251.   set the castNum of sprite gvFrogSprite to the number of cast "FrogJump.pic"
  252.   updateStage()
  253.   wait(2)
  254.   set the locV of sprite gvFrogSprite to vOrigV - vHowHigh
  255.   updateStage()
  256.   wait(10)
  257.   set the locV of sprite gvFrogSprite to vOrigV
  258.   set the castNum of sprite gvFrogSprite to vOrigCast
  259.   updateStage()
  260. end
  261.  
  262. on doParrotFlap
  263.   global gvParrotSprite
  264.   set vOrigCast to the castNum of sprite gvParrotSprite
  265.   set the castNum of sprite gvParrotSprite to the number of cast "WingFlap.pic"
  266.   updateStage()
  267.   wait(20)
  268.   set the castNum of sprite gvParrotSprite to vOrigCast
  269.   updateStage()
  270. end
  271.  
  272. on doVelmaArm vfArm
  273.   global gvVelmaSprite
  274.   if vfArm then
  275.     set the castNum of sprite gvVelmaSprite to the number of cast "VelmaArm.pic"
  276.   else
  277.     set the castNum of sprite gvVelmaSprite to the number of cast "Velma1.pic"
  278.   end if
  279.   updateStage()
  280. end
  281.  
  282. on doFarmerArm vfArm
  283.   global gvBonkRightArmSprite
  284.   if vfArm then
  285.     set the castNum of sprite gvBonkRightArmSprite to the number of cast "FarmArm.pic"
  286.   else
  287.     set the castNum of sprite gvBonkRightArmSprite to the number of cast "RightArm.pic"
  288.   end if
  289.   updateStage()
  290. end
  291.  
  292. on doVelmaPose
  293.   global gvVelmaSprite
  294.   set vOrigH to the locH of sprite gvVelmaSprite
  295.   set vOrigCast to the castNum of sprite gvVelmaSprite
  296.   set the castNum of sprite gvVelmaSprite to the number of cast "SveltVel.pic"
  297.   set the locH of sprite gvVelmaSprite to vOrigH + 20
  298.   updateStage()
  299.   wait(40)
  300.   set the locH of sprite gvVelmaSprite to vOrigH
  301.   set the castNum of sprite gvVelmaSprite to vOrigCast
  302.   updateStage()
  303. end
  304.  
  305. on doFarmerWipe
  306.   global gvBonkRightArmSprite
  307.   set the castNum of sprite gvBonkRightArmSprite to the number of cast "WipeArm1.pic"
  308.   updateStage()
  309.   wait(5)
  310.   set the castNum of sprite gvBonkRightArmSprite to the number of cast "WipeArm2.pic"
  311.   updateStage()
  312.   wait(20)
  313.   set the castNum of sprite gvBonkRightArmSprite to the number of cast "WipeArm1.pic"
  314.   updateStage()
  315.   wait(5)
  316.   set the castNum of sprite gvBonkRightArmSprite to the number of cast "RightArm.pic"
  317.   updateStage()
  318. end
  319.  
  320. on doIntroSpeech
  321.   global SFX_EXT, gvBonkHeadSprite
  322.   puppetSound("1intro1" & SFX_EXT)
  323.   updateStage()
  324.   animateChar(gvBonkHeadSprite, 10)
  325.   darkenAlphaStrip()
  326.   doFarmerPoint(1)
  327.   puppetSound("1intro2" & SFX_EXT)
  328.   moveAlphaBoxToLetter("X")
  329.   flashRedLetter("X")
  330.   updateStage()
  331.   animateChar(gvBonkHeadSprite, 10)
  332.   puppetSound("1intro3" & SFX_EXT)
  333.   moveAlphaBoxToLetter("Y")
  334.   flashRedLetter("Y")
  335.   updateStage()
  336.   animateChar(gvBonkHeadSprite, 10)
  337.   puppetSound("1intro4" & SFX_EXT)
  338.   moveAlphaBoxToLetter("Z")
  339.   flashRedLetter("Z")
  340.   updateStage()
  341.   animateChar(gvBonkHeadSprite, 10)
  342.   doFarmerPoint(0)
  343.   puppetSound("1intro5" & SFX_EXT)
  344.   updateStage()
  345.   animateChar(gvBonkHeadSprite, 10)
  346.   moveAlphaBoxToLetter("X")
  347.   updateStage()
  348. end
  349.  
  350. on moveAlphaBoxToLetter vLetter
  351.   global gvAlphaHiliteBoxSprite
  352.   if (vLetter = "Z") or (vLetter = "z") then
  353.     set vLetter to 25
  354.   else
  355.     if (vLetter = "Y") or (vLetter = "y") then
  356.       set vLetter to 24
  357.     else
  358.       set vLetter to 23
  359.     end if
  360.   end if
  361.   set the visible of sprite gvAlphaHiliteBoxSprite to 1
  362.   set the locH of sprite gvAlphaHiliteBoxSprite to (vLetter * 21) + 30
  363. end
  364.  
  365. on darkenAlphaStrip
  366.   global gvAlphabetStripSprite
  367.   set the castNum of sprite gvAlphabetStripSprite to the number of cast "AlphaStripDark"
  368.   updateStage()
  369. end
  370.  
  371. on handleClickQuit
  372.   global gvQuitButtonSprite
  373.   cursor(0)
  374.   set the castNum of sprite gvQuitButtonSprite to the number of cast "quitButtonOn"
  375.   updateStage()
  376.   repeat while the stillDown
  377.     nothing()
  378.   end repeat
  379.   set the castNum of sprite gvQuitButtonSprite to the number of cast "quitButton"
  380.   updateStage()
  381.   cursor(200)
  382.   repeat with viSprite = 1 to 48
  383.     set the puppet of sprite viSprite to 0
  384.     updateStage()
  385.   end repeat
  386.   puppetSound(0)
  387.   go("quit")
  388. end
  389.  
  390. on handleClickHelp
  391.   global gvHelpSignSprite, gvBonkHeadSprite, gvCurLetter, gvAlphaHiliteBoxSprite
  392.   cursor(0)
  393.   set the castNum of sprite gvHelpSignSprite to the number of cast "helpButtonOn"
  394.   updateStage()
  395.   repeat while the stillDown
  396.     nothing()
  397.   end repeat
  398.   set the castNum of sprite gvHelpSignSprite to the number of cast "helpButton"
  399.   updateStage()
  400.   cursor(200)
  401.   if the frame <> label("pause") then
  402.     darkenAlphaStrip()
  403.     moveAlphaBoxToLetter("X")
  404.     go("pause")
  405.   end if
  406.   puppetSound("1ihelp.aif")
  407.   updateStage()
  408.   animateChar(gvBonkHeadSprite, 10)
  409. end
  410.  
  411. on handleClickOnOtherStuff
  412.   global gvBonkHeadSprite, gvCurLetter
  413.   puppetSound("1non.aif")
  414.   updateStage()
  415.   animateChar(gvBonkHeadSprite, 10)
  416.   set gvCurLetter to "X"
  417.   fadeAway()
  418. end
  419.