home *** CD-ROM | disk | FTP | other *** search
/ Professor Iris' Fun Field Trip - Animal Safari / Iris.iso / pc / discover / page3.dir / 00381.ls < prev    next >
Encoding:
Text File  |  1995-06-18  |  12.5 KB  |  397 lines

  1. on startMovie
  2.   global gMovieNum, gWhichFrame, gTracker1, gNavHiliteSprite, gRadioNormal, gArrowClicked, gButtonNormal, gButtonHilite
  3.   set gMovieNum to 3
  4.   set gWhichFrame to "Intro"
  5.   doNumberSwap()
  6.   set gTracker1 to pointerFactory(mnew, 3)
  7.   set gNavHiliteSprite to 23
  8.   set the immediate of sprite gNavHiliteSprite to 1
  9.   charButtonInit()
  10.   navButtonInit()
  11.   checkHot1Init()
  12.   checkHot2Init()
  13.   LanguageAndPoemInit()
  14. end
  15.  
  16. on stopMovie
  17.   global gTracker1, gNavHiliteSprite
  18.   gTracker1(mdispose)
  19.   set the immediate of sprite gNavHiliteSprite to 0
  20.   when mouseUp then nothing
  21.   SoundFadeRestore()
  22.   LanguageAndPoemRestore()
  23. end
  24.  
  25. on goGameQuitter
  26.   pExitGame()
  27. end
  28.  
  29. on pInitGame
  30.   global knAnimals, gHead, gBody, gBack, gchHeadWord, gchBodyWord, gchBackWord, gchHeadPic, gchBodyPic, gchBackPic
  31.   set knAnimals to 7
  32.   set gchHeadWord to 6
  33.   set gchBodyWord to 7
  34.   set gchBackWord to 8
  35.   set gchHeadPic to 10
  36.   set gchBodyPic to 11
  37.   set gchBackPic to 12
  38.   set gHead to random(knAnimals)
  39.   set gBody to random(knAnimals)
  40.   set gBack to random(knAnimals)
  41.   pDraw(#Head)
  42.   pDraw(#Body)
  43.   pDraw(#Back)
  44.   repeat with ch = 6 to 16
  45.     puppetSprite(ch, 1)
  46.   end repeat
  47. end
  48.  
  49. on pExitGame
  50.   repeat with ch = 6 to 16
  51.     puppetSprite(ch, 0)
  52.   end repeat
  53. end
  54.  
  55. on pDraw theBodyPart
  56.   global gHead, gBody, gBack, gchHeadWord, gchBodyWord, gchBackWord, gchHeadPic, gchBodyPic, gchBackPic
  57.   if theBodyPart = #Head then
  58.     set the castNum of sprite gchHeadWord to the number of cast "FirstHeadWord" + gHead - 1
  59.     set the castNum of sprite gchHeadPic to the number of cast "FirstHeadPic" + gHead - 1
  60.   else
  61.     if theBodyPart = #Body then
  62.       set the castNum of sprite gchBodyWord to the number of cast "FirstBodyWord" + gBody - 1
  63.       set the castNum of sprite gchBodyPic to the number of cast "FirstBodyPic" + gBody - 1
  64.     else
  65.       if theBodyPart = #Back then
  66.         set the castNum of sprite gchBackWord to the number of cast "FirstBackWord" + gBack - 1
  67.         set the castNum of sprite gchBackPic to the number of cast "FirstBackPic" + gBack - 1
  68.       end if
  69.     end if
  70.   end if
  71.   updateStage()
  72. end
  73.  
  74. on pNext theBodyPart
  75.   global knAnimals, gHead, gBody, gBack
  76.   if theBodyPart = #Head then
  77.     set gHead to gHead + 1
  78.     if gHead > knAnimals then
  79.       set gHead to 1
  80.     end if
  81.   else
  82.     if theBodyPart = #Body then
  83.       set gBody to gBody + 1
  84.       if gBody > knAnimals then
  85.         set gBody to 1
  86.       end if
  87.     else
  88.       if theBodyPart = #Back then
  89.         set gBack to gBack + 1
  90.         if gBack > knAnimals then
  91.           set gBack to 1
  92.         end if
  93.       end if
  94.     end if
  95.   end if
  96.   pDraw(theBodyPart)
  97. end
  98.  
  99. on pPlayFullAnimalSound
  100.   pPlayAnimalSound(#Head)
  101.   pPlayAnimalSound(#Body)
  102.   pPlayAnimalSound(#Back)
  103. end
  104.  
  105. on pPlayFullAnimalName
  106.   pPlayWordSound(#Head)
  107.   pPlayWordSound(#Body)
  108.   pPlayWordSound(#Back)
  109. end
  110.  
  111. on pPlayWordSound theBodyPart
  112.   global gHead, gBody, gBack
  113.   if theBodyPart = #Head then
  114.     pPlayMySound(the name of cast (the number of cast "FirstAnimalNameHead" + gHead - 1))
  115.   else
  116.     if theBodyPart = #Body then
  117.       pPlayMySound(the name of cast (the number of cast "FirstAnimalNameBody" + gBody - 1))
  118.     else
  119.       if theBodyPart = #Back then
  120.         pPlayMySound(the name of cast (the number of cast "FirstAnimalNameBack" + gBack - 1))
  121.       end if
  122.     end if
  123.   end if
  124. end
  125.  
  126. on pPlayAnimalSound theBodyPart
  127.   global gHead, gBody, gBack
  128.   if theBodyPart = #Head then
  129.     pPlayMySound(the name of cast (the number of cast "FirstAnimalSoundHead" + gHead - 1))
  130.   else
  131.     if theBodyPart = #Body then
  132.       pPlayMySound(the name of cast (the number of cast "FirstAnimalSoundBody" + gBody - 1))
  133.     else
  134.       if theBodyPart = #Back then
  135.         pPlayMySound(the name of cast (the number of cast "FirstAnimalSoundBack" + gBack - 1))
  136.       end if
  137.     end if
  138.   end if
  139. end
  140.  
  141. on GameHiliteInit
  142.   global gHeadArrow, gBodyArrow, gBackArrow
  143.   set gAnimalWord to 4
  144.   set gAnimalSound to 5
  145.   set gHeadArrow to 14
  146.   set gBodyArrow to 15
  147.   set gBackArrow to 16
  148.   set the immediate of sprite gAnimalWord to 1
  149.   set the immediate of sprite gAnimalSound to 1
  150.   set the immediate of sprite gHeadArrow to 1
  151.   set the immediate of sprite gBodyArrow to 1
  152.   set the immediate of sprite gBackArrow to 1
  153. end
  154.  
  155. on doNextHead
  156.   global gHeadArrow
  157.   if rollOver(gHeadArrow) then
  158.     pNext(#Head)
  159.   end if
  160.   when mouseUp then nothing
  161. end
  162.  
  163. on doNextBody
  164.   global gBodyArrow
  165.   if rollOver(gBodyArrow) then
  166.     pNext(#Body)
  167.   end if
  168.   when mouseUp then nothing
  169. end
  170.  
  171. on doNextBack
  172.   global gBackArrow
  173.   if rollOver(gBackArrow) then
  174.     pNext(#Back)
  175.   end if
  176.   when mouseUp then nothing
  177. end
  178.  
  179. on checkHot1Init
  180.   global gHot1H, gHot1V, gHot1W, gHot1T, gHot2H, gHot2V, gHot2W, gHot2T, gHot3H, gHot3V, gHot3W, gHot3T, gHot4H, gHot4V, gHot4W, gHot4T, gHot5H, gHot5V, gHot5W, gHot5T, gHot6H, gHot6V, gHot6W, gHot6T, gHot7H, gHot7V, gHot7W, gHot7T, gHotChannel1
  181.   set gHotChannel1 to 12
  182.   set the immediate of sprite gHotChannel1 to 1
  183.   set gHot1H to 178
  184.   set gHot1V to 189
  185.   set gHot1W to 94
  186.   set gHot1T to 79
  187.   set gHot2H to 93
  188.   set gHot2V to 184
  189.   set gHot2W to 84
  190.   set gHot2T to 85
  191.   set gHot3H to 154
  192.   set gHot3V to 269
  193.   set gHot3W to 118
  194.   set gHot3T to 113
  195.   set gHot4H to 177
  196.   set gHot4V to 131
  197.   set gHot4W to 91
  198.   set gHot4T to 58
  199.   set gHot5H to 67
  200.   set gHot5V to 271
  201.   set gHot5W to 86
  202.   set gHot5T to 111
  203.   set gHot6H to 87
  204.   set gHot6V to 64
  205.   set gHot6W to 106
  206.   set gHot6T to 66
  207.   set gHot7H to 94
  208.   set gHot7V to 131
  209.   set gHot7W to 80
  210.   set gHot7T to 50
  211. end
  212.  
  213. on checkHot2Init
  214.   global gHot8H, gHot8V, gHot8W, gHot8T, gHot9H, gHot9V, gHot9W, gHot9T, gHot10H, gHot10V, gHot10W, gHot10T, gHot11H, gHot11V, gHot11W, gHot11T, gHot12H, gHot12V, gHot12W, gHot12T, gHot13H, gHot13V, gHot13W, gHot13T, gHot14H, gHot14V, gHot14W, gHot14T, gHotChannel2
  215.   set gHotChannel2 to 13
  216.   set the immediate of sprite gHotChannel2 to 1
  217.   set gHot8H to 272
  218.   set gHot8V to 225
  219.   set gHot8W to 176
  220.   set gHot8T to 74
  221.   set gHot9H to 449
  222.   set gHot9V to 223
  223.   set gHot9W to 47
  224.   set gHot9T to 75
  225.   set gHot10H to 497
  226.   set gHot10V to 179
  227.   set gHot10W to 70
  228.   set gHot10T to 119
  229.   set gHot11H to 454
  230.   set gHot11V to 65
  231.   set gHot11W to 117
  232.   set gHot11T to 112
  233.   set gHot12H to 271
  234.   set gHot12V to 300
  235.   set gHot12W to 126
  236.   set gHot12T to 85
  237.   set gHot13H to 272
  238.   set gHot13V to 180
  239.   set gHot13W to 223
  240.   set gHot13T to 45
  241.   set gHot14H to 398
  242.   set gHot14V to 299
  243.   set gHot14W to 171
  244.   set gHot14T to 89
  245. end
  246.  
  247. on checkHot1
  248.   global gHot1H, gHot1V, gHot1W, gHot1T, gHot2H, gHot2V, gHot2W, gHot2T, gHot3H, gHot3V, gHot3W, gHot3T, gHot4H, gHot4V, gHot4W, gHot4T, gHot5H, gHot5V, gHot5W, gHot5T, gHot6H, gHot6V, gHot6W, gHot6T, gHot7H, gHot7V, gHot7W, gHot7T, QTSpriteNum
  249.   set mv to the mouseV
  250.   set mh to the mouseH
  251.   go(string((1 * ((mh > gHot1H) and (mh < (gHot1H + gHot1W)) and ((mv > gHot1V) and (mv < (gHot1V + gHot1T))))) + (2 * ((mh > gHot2H) and (mh < (gHot2H + gHot2W)) and ((mv > gHot2V) and (mv < (gHot2V + gHot2T))))) + (3 * ((mh > gHot3H) and (mh < (gHot3H + gHot3W)) and ((mv > gHot3V) and (mv < (gHot3V + gHot3T))))) + (4 * ((mh > gHot4H) and (mh < (gHot4H + gHot4W)) and ((mv > gHot4V) and (mv < (gHot4V + gHot4T))))) + (5 * ((mh > gHot5H) and (mh < (gHot5H + gHot5W)) and ((mv > gHot5V) and (mv < (gHot5V + gHot5T))))) + (6 * ((mh > gHot6H) and (mh < (gHot6H + gHot6W)) and ((mv > gHot6V) and (mv < (gHot6V + gHot6T))))) + (7 * ((mh > gHot7H) and (mh < (gHot7H + gHot7W)) and ((mv > gHot7V) and (mv < (gHot7V + gHot7T))))) & "Hot"))
  252.   startTimer()
  253.   set the visible of sprite QTSpriteNum to 1
  254. end
  255.  
  256. on checkHot2
  257.   global gHot8H, gHot8V, gHot8W, gHot8T, gHot9H, gHot9V, gHot9W, gHot9T, gHot10H, gHot10V, gHot10W, gHot10T, gHot11H, gHot11V, gHot11W, gHot11T, gHot12H, gHot12V, gHot12W, gHot12T, gHot13H, gHot13V, gHot13W, gHot13T, gHot14H, gHot14V, gHot14W, gHot14T, QTSpriteNum
  258.   set mv to the mouseV
  259.   set mh to the mouseH
  260.   go(string((8 * ((mh > gHot8H) and (mh < (gHot8H + gHot8W)) and ((mv > gHot8V) and (mv < (gHot8V + gHot8T))))) + (9 * ((mh > gHot9H) and (mh < (gHot9H + gHot9W)) and ((mv > gHot9V) and (mv < (gHot9V + gHot9T))))) + (10 * ((mh > gHot10H) and (mh < (gHot10H + gHot10W)) and ((mv > gHot10V) and (mv < (gHot10V + gHot10T))))) + (11 * ((mh > gHot11H) and (mh < (gHot11H + gHot11W)) and ((mv > gHot11V) and (mv < (gHot11V + gHot11T))))) + (12 * ((mh > gHot12H) and (mh < (gHot12H + gHot12W)) and ((mv > gHot12V) and (mv < (gHot12V + gHot12T))))) + (13 * ((mh > gHot13H) and (mh < (gHot13H + gHot13W)) and ((mv > gHot13V) and (mv < (gHot13V + gHot13T))))) + (14 * ((mh > gHot14H) and (mh < (gHot14H + gHot14W)) and ((mv > gHot14V) and (mv < (gHot14V + gHot14T))))) & "Hot"))
  261.   startTimer()
  262.   set the visible of sprite QTSpriteNum to 1
  263. end
  264.  
  265. on PoemLineTestE
  266.   global gWhichLine, gPoemChannel
  267.   set mv to the mouseV
  268.   set top to the top of sprite the clickOn
  269.   set part to the height of sprite the clickOn / 4
  270.   StopAllSound()
  271.   if mv < (top + (1 * part)) then
  272.     set gWhichLine to 1
  273.     playQTSequence(5, 172)
  274.   else
  275.     if (mv >= (top + (1 * part))) and (mv < (top + (2 * part))) then
  276.       set gWhichLine to 2
  277.       playQTSequence(172, 300)
  278.     else
  279.       if (mv >= (top + (2 * part))) and (mv < (top + (3 * part))) then
  280.         set gWhichLine to 3
  281.         playQTSequence(300, 440)
  282.       else
  283.         if (mv >= (top + (3 * part))) and (mv < (top + (4 * part))) then
  284.           set gWhichLine to 4
  285.           playQTSequence(440, 573)
  286.         end if
  287.       end if
  288.     end if
  289.   end if
  290.   go("QTwait")
  291. end
  292.  
  293. on PoemLineTestF
  294.   global gWhichLine, gPoemChannel
  295.   set mv to the mouseV
  296.   set top to the top of sprite the clickOn
  297.   set part to the height of sprite the clickOn / 4
  298.   StopAllSound()
  299.   if mv < (top + (1 * part)) then
  300.     set gWhichLine to 1
  301.     playQTSequence(0, 120)
  302.   else
  303.     if (mv >= (top + (1 * part))) and (mv < (top + (2 * part))) then
  304.       set gWhichLine to 2
  305.       playQTSequence(120, 210)
  306.     else
  307.       if (mv >= (top + (2 * part))) and (mv < (top + (3 * part))) then
  308.         set gWhichLine to 3
  309.         playQTSequence(210, 372)
  310.       else
  311.         if (mv >= (top + (3 * part))) and (mv < (top + (4 * part))) then
  312.           set gWhichLine to 4
  313.           playQTSequence(372, 479)
  314.         end if
  315.       end if
  316.     end if
  317.   end if
  318.   go("QTwait")
  319. end
  320.  
  321. on PoemLineTestS
  322.   global gWhichLine, gPoemChannel
  323.   set mv to the mouseV
  324.   set top to the top of sprite the clickOn
  325.   set part to the height of sprite the clickOn / 4
  326.   StopAllSound()
  327.   if mv < (top + (1 * part)) then
  328.     set gWhichLine to 1
  329.     playQTSequence(0, 150)
  330.   else
  331.     if (mv >= (top + (1 * part))) and (mv < (top + (2 * part))) then
  332.       set gWhichLine to 2
  333.       playQTSequence(150, 288)
  334.     else
  335.       if (mv >= (top + (2 * part))) and (mv < (top + (3 * part))) then
  336.         set gWhichLine to 3
  337.         playQTSequence(288, 504)
  338.       else
  339.         if (mv >= (top + (3 * part))) and (mv < (top + (4 * part))) then
  340.           set gWhichLine to 4
  341.           playQTSequence(504, 655)
  342.         end if
  343.       end if
  344.     end if
  345.   end if
  346.   go("QTwait")
  347. end
  348.  
  349. on PoemLineTestJ
  350.   global gWhichLine, gPoemChannel
  351.   set mv to the mouseV
  352.   set top to the top of sprite the clickOn
  353.   set part to the height of sprite the clickOn / 3
  354.   StopAllSound()
  355.   if mv < (top + (1 * part)) then
  356.     set gWhichLine to 1
  357.     playQTSequence(0, 240)
  358.   else
  359.     if (mv >= (top + (1 * part))) and (mv < (top + (2 * part))) then
  360.       set gWhichLine to 2
  361.       playQTSequence(240, 700)
  362.     else
  363.       if (mv >= (top + (2 * part))) and (mv < (top + (3 * part))) then
  364.         set gWhichLine to 3
  365.         playQTSequence(240, 700)
  366.       end if
  367.     end if
  368.   end if
  369.   go("QTwait")
  370. end
  371.  
  372. on QTHotSwap charName, QTlocH, QTlocV
  373.   global QTSpriteNum, gMovieNum, gWhichLangLet
  374.   set the visible of sprite QTSpriteNum to 1
  375.   put gMovieNum & charName & gWhichLangLet & ".mov"
  376.   set the castNum of sprite QTSpriteNum to the number of cast the name of cast (gMovieNum & charName & gWhichLangLet & ".mov")
  377.   set the locH of sprite QTSpriteNum to QTlocH
  378.   set the locV of sprite QTSpriteNum to QTlocV
  379. end
  380.  
  381. on QTswap movieName, QTlocH, QTlocV
  382.   global QTSpriteNum, gMovieNum, gWhichLangLet
  383.   set the visible of sprite QTSpriteNum to 1
  384.   set the castNum of sprite QTSpriteNum to the number of cast movieName
  385.   set the locH of sprite QTSpriteNum to QTlocH
  386.   set the locV of sprite QTSpriteNum to QTlocV
  387. end
  388.  
  389. on writeMe nameChar
  390.   global QTSpriteNum, gWhichLangLet, gMovieNum
  391.   put "global QTspriteNum,gWhichLangLet,gMovieNum"
  392.   put "set the visibility of sprite QTspriteNum = TRUE"
  393.   put "set the castNum of sprite QTspriteNum = the number of cast(gMovieNum putANDhere" && QUOTE & nameChar & QUOTE && "gWhichLangLet putANDhere" && QUOTE & ".mov" & QUOTE & ")"
  394.   put "set the locH of sprite QTspriteNum = " & the locH of sprite QTSpriteNum
  395.   put "set the locV of sprite QTspriteNum = " & the locV of sprite QTSpriteNum
  396. end
  397.