home *** CD-ROM | disk | FTP | other *** search
/ Imagination Express: Destination Pyramids / PYRAMIDS.ISO / THEMES / PYRAMIDS / DD / PARENTS.EXE / PARENTS.DXR / 00066.ls < prev    next >
Encoding:
Text File  |  1996-02-08  |  3.1 KB  |  132 lines

  1. on startMovie
  2.   global gMoovQty, gPreroll
  3.   clearGlobals()
  4.   preLoadCast(1, 36)
  5.   set the centerStage to 1
  6.   set the mouseDownScript to "donnaMouseDown"
  7.   set the mouseUpScript to "donnaMouseUp"
  8. end
  9.  
  10. on initialize
  11.   repeat with counter = 3 to 15
  12.     puppetSprite(counter, 1)
  13.   end repeat
  14. end
  15.  
  16. on donnaMouseDown
  17.   global gSpriteNumber, gValidButton
  18.   set gValidButton to 0
  19.   set gSpriteNumber to the clickOn
  20.   if (gSpriteNumber > 2) and (gSpriteNumber < 17) then
  21.     repeat while the mouseDown
  22.       if rollOver(gSpriteNumber) then
  23.         toggleButton("D")
  24.       else
  25.         toggleButton("U")
  26.       end if
  27.       updateStage()
  28.     end repeat
  29.     if gValidButton <> 1 then
  30.       toggleButton("D")
  31.       updateStage()
  32.     end if
  33.     toggleButton("U")
  34.     updateStage()
  35.   end if
  36. end
  37.  
  38. on donnaMouseUp
  39.   global gSpriteNumber, gValidButton, gJumpFlag, gMoov
  40.   set gMoov to gSpriteNumber - 2
  41.   if (gSpriteNumber > 3) and (gSpriteNumber < 10) then
  42.     if rollOver(gSpriteNumber) then
  43.       go("B2" & gMoov)
  44.     end if
  45.   else
  46.     if (gSpriteNumber > 9) and (gSpriteNumber < 16) then
  47.       if rollOver(gSpriteNumber) then
  48.         go("B" & gMoov)
  49.       end if
  50.     else
  51.       if gSpriteNumber = 3 then
  52.         if rollOver(gSpriteNumber) then
  53.           go(80)
  54.           quit()
  55.         end if
  56.       else
  57.         if gSpriteNumber = 16 then
  58.           if rollOver(gSpriteNumber) then
  59.             go("b1")
  60.           end if
  61.         end if
  62.       end if
  63.     end if
  64.   end if
  65. end
  66.  
  67. on toggleButton state
  68.   global gSpriteNumber, gValidButton
  69.   if gSpriteNumber = 0 then
  70.     exit
  71.   end if
  72.   set castNumber to the castNum of sprite gSpriteNumber
  73.   set castName to the name of cast castNumber
  74.   if char 6 of castName = "G" then
  75.     set gValidButton to 0
  76.     exit
  77.   else
  78.     if state = "D" then
  79.       set gValidButton to 1
  80.     end if
  81.   end if
  82.   put state into char 6 of castName
  83.   set the castNum of sprite gSpriteNumber to the number of cast castName
  84.   updateStage()
  85. end
  86.  
  87. on moovSetup
  88.   global gPreroll, gMoovNameNum, GMOOVNAME
  89.   puppetSprite(20, 1)
  90.   cursor(4)
  91.   if label(0) < 15 then
  92.     set GMOOVNAME to "DD0"
  93.   else
  94.     set GMOOVNAME to "DD" & (label(0) - 10) / 5
  95.   end if
  96.   set gMoovNameNum to the number of cast GMOOVNAME
  97.   set the directToStage of cast gMoovNameNum to 1
  98.   set the preLoad of cast gMoovNameNum to 1
  99.   set the pausedAtStart of cast gMoovNameNum to 1
  100.   preLoadCast(gMoovNameNum)
  101. end
  102.  
  103. on playMoov
  104.   global gMoovNameNum, GMOOVNAME
  105.   set the mouseDownScript to EMPTY
  106.   set the mouseUpScript to EMPTY
  107.   set abortFlag to 0
  108.   set the castNum of sprite 20 to gMoovNameNum
  109.   set gMoovlength to the duration of cast GMOOVNAME
  110.   updateStage()
  111.   set the movieRate of sprite 20 to 1
  112.   repeat while the movieTime of sprite 20 < gMoovlength
  113.     if the mouseDown then
  114.       set abortFlag to 1
  115.       exit repeat
  116.     end if
  117.     updateStage()
  118.   end repeat
  119.   set the mouseDownScript to "donnaMouseDown"
  120.   set the mouseUpScript to "donnaMouseUp"
  121.   if abortFlag = 1 then
  122.     set the movieRate of sprite 20 to 0
  123.     updateStage()
  124.     set moov to char 3 to 4 of GMOOVNAME
  125.     if ((value(moov) > 0) and (value(moov) < 8)) or ((value(moov) > 20) and (value(moov) < 28)) then
  126.       go("w2")
  127.     else
  128.       go("w1")
  129.     end if
  130.   end if
  131. end
  132.