home *** CD-ROM | disk | FTP | other *** search
/ Shocking The Web CD-ROM / SHOCK_CD.ISO / pc / tutorial / devglry / studiosw / source / shokcats.dir / 00068.ls < prev    next >
Encoding:
Text File  |  1996-05-10  |  4.3 KB  |  171 lines

  1. global gGameBoard, gGameInPlay, gArt, gDirA, gDirB, gDirC, gTimeOut
  2.  
  3. on startMovie
  4.   set gTimeOut to 60
  5.   set gDirA to 1
  6.   set gDirB to -1
  7.   set gDirC to 1
  8.   set gGameInPlay to 0
  9.   set the stageColor to 25
  10.   set gArt to 1
  11.   set counter to 30
  12.   repeat while counter < 42
  13.     puppetSprite(counter, 1)
  14.     set counter to counter + 1
  15.   end repeat
  16.   puppetSprite(45, 1)
  17.   puppetSprite(46, 1)
  18.   puppetSprite(47, 1)
  19.   InitGameBoard()
  20. end
  21.  
  22. on stopMovie
  23.   killGame(gGameBoard)
  24.   set gGameBoard to 0
  25. end
  26.  
  27. on goGallery
  28.   puppetSound("meow2.aiff")
  29.   set thisSprite to the clickOn
  30.   set holdCast to the castNum of sprite thisSprite
  31.   set the castNum of sprite thisSprite to 104
  32.   updateStage()
  33.   repeat while the mouseDown and rollOver(thisSprite)
  34.   end repeat
  35.   set the castNum of sprite thisSprite to holdCast
  36.   if rollOver(thisSprite) then
  37.     doReturn()
  38.   end if
  39. end
  40.  
  41. on InitGameBoard
  42.   set gGameBoard to birth(script "aGameBrd", 75, 1, 48)
  43.   set theCast to 40
  44.   set theRevCast to 40
  45.   createNewGame(gGameBoard, theCast, 6, 5, 50, theRevCast)
  46.   startTimer()
  47. end
  48.  
  49. on doGMouseDown theSprite
  50.   if gGameInPlay then
  51.     doMouseDown(gGameBoard, theSprite)
  52.   end if
  53. end
  54.  
  55. on reset
  56.   reset(gGameBoard)
  57. end
  58.  
  59. on Meow
  60.   puppetSound("meow2.aiff")
  61.   set thisSprite to the clickOn
  62.   set holdCast to the castNum of sprite thisSprite
  63.   put the number of cast "MEOWCNTR.PICT"
  64.   set the castNum of sprite thisSprite to the number of cast "MEOWCNTR2.PICT"
  65.   updateStage()
  66.   repeat while the mouseDown and rollOver(thisSprite)
  67.   end repeat
  68.   set the castNum of sprite thisSprite to holdCast
  69.   updateStage()
  70. end
  71.  
  72. on Purr
  73.   puppetSound("pur.aiff")
  74.   set thisSprite to the clickOn
  75.   set holdCast to the castNum of sprite thisSprite
  76.   set the castNum of sprite thisSprite to the number of cast "PURRCNTR2.PICT"
  77.   updateStage()
  78.   repeat while the mouseDown and rollOver(thisSprite)
  79.   end repeat
  80.   set the castNum of sprite thisSprite to holdCast
  81.   updateStage()
  82. end
  83.  
  84. on PlayGame
  85.   puppetSound("meow1.aiff")
  86.   set thisSprite to the clickOn
  87.   set holdCast to the castNum of sprite thisSprite
  88.   set the castNum of sprite thisSprite to the number of cast "PLAYOPEN.PICT"
  89.   updateStage()
  90.   repeat while the mouseDown and rollOver(thisSprite)
  91.   end repeat
  92.   if rollOver(thisSprite) then
  93.     StartANewGame(gGameBoard)
  94.     set gGameInPlay to 1
  95.     set gTimeOut to 5 * 60
  96.     go("playGame")
  97.   end if
  98.   set the castNum of sprite thisSprite to holdCast
  99.   updateStage()
  100. end
  101.  
  102. on doSwapART
  103.   killGame(gGameBoard)
  104.   if gArt = 1 then
  105.     set theCast to 81
  106.     set theRevCast to 41
  107.     set gArt to 2
  108.   else
  109.     set theCast to 144
  110.     set theRevCast to 81
  111.     set gArt to 1
  112.   end if
  113.   createNewGame(gGameBoard, theCast, 6, 5, theCast + 16, theRevCast)
  114. end
  115.  
  116. on idle
  117.   if the timer > gTimeOut then
  118.     wiggleButtons()
  119.     if gGameInPlay then
  120.       doTick(gGameBoard)
  121.     else
  122.       scrambleTwoTiles(gGameBoard)
  123.     end if
  124.     startTimer()
  125.   end if
  126. end
  127.  
  128. on doNenoLights
  129.   set theSeed_Inner to random(3)
  130.   set theSeed_Middle to random(3)
  131.   set theSeed_Outer to random(3)
  132.   set the castNum of sprite 30 to 55 + theSeed_Inner
  133.   set the castNum of sprite 31 to 58 + theSeed_Middle
  134.   set the castNum of sprite 32 to 61 + theSeed_Outer
  135.   set the castNum of sprite 33 to 66 + theSeed_Inner
  136.   set the castNum of sprite 34 to 69 + theSeed_Middle
  137.   set the castNum of sprite 35 to 72 + theSeed_Outer
  138.   set the castNum of sprite 36 to 77 + theSeed_Inner
  139.   set the castNum of sprite 37 to 80 + theSeed_Middle
  140.   set the castNum of sprite 38 to 83 + theSeed_Outer
  141.   set the castNum of sprite 39 to 88 + theSeed_Inner
  142.   set the castNum of sprite 40 to 91 + theSeed_Middle
  143.   set the castNum of sprite 41 to 94 + theSeed_Outer
  144. end
  145.  
  146. on wiggleButtons
  147.   set gDirA to wiggleThisButton(45, 53, 55, gDirA)
  148.   set gDirB to wiggleThisButton(46, 57, 59, gDirB)
  149.   set gDirC to wiggleThisButton(47, 61, 63, gDirC)
  150. end
  151.  
  152. on wiggleThisButton theSprite, minCast, maxCast, theDelta
  153.   set holdCast to the castNum of sprite theSprite
  154.   if theDelta > 0 then
  155.     if holdCast = maxCast then
  156.       set theDelta to -1
  157.       set the castNum of sprite theSprite to holdCast - 1
  158.     else
  159.       set the castNum of sprite theSprite to holdCast + 1
  160.     end if
  161.   else
  162.     if holdCast = minCast then
  163.       set theDelta to 1
  164.       set the castNum of sprite theSprite to holdCast + 1
  165.     else
  166.       set the castNum of sprite theSprite to holdCast - 1
  167.     end if
  168.   end if
  169.   return theDelta
  170. end
  171.