home *** CD-ROM | disk | FTP | other *** search
- global gGameBoard, gGameInPlay, gArt, gDirA, gDirB, gDirC, gTimeOut, gRWindow, gOriginalColorDepth
-
- on startMovie
- set gTimeOut to 60
- set gDirA to 1
- set gDirB to -1
- set gDirC to 1
- set gGameInPlay to 0
- set the stageColor to 25
- set gArt to 1
- set counter to 30
- repeat while counter < 42
- puppetSprite(counter, 1)
- set counter to counter + 1
- end repeat
- puppetSprite(45, 1)
- puppetSprite(46, 1)
- puppetSprite(47, 1)
- Init()
- InitGameBoard()
- end
-
- on stopMovie
- killGame(gGameBoard)
- set gGameBoard to 0
- kill()
- end
-
- on Init
- set gOriginalColorDepth to the colorDepth
- set the colorDepth to 8
- if the machineType < 255 then
- openXLib(the pathName & "RearWindow.XObj")
- set gRWindow to RearWindow(mnew, "S")
- gRWindow(mRGBColorToWindow, 255, 255, 255)
- end if
- end
-
- on kill
- set the colorDepth to gOriginalColorDepth
- if the machineType < 255 then
- gRWindow(mdispose)
- closeXLib(the pathName & "RearWindow.XObj")
- end if
- end
-
- on goPur
- puppetSound("pur.aiff")
- set thisSprite to the clickOn
- set holdCast to the castNum of sprite thisSprite
- set the castNum of sprite thisSprite to 104
- updateStage()
- repeat while the mouseDown and rollOver(thisSprite)
- end repeat
- set the castNum of sprite thisSprite to holdCast
- if rollOver(thisSprite) then
- do(RETURN)
- end if
- end
-
- on goMeow
- puppetSound("meow2.aiff")
- set thisSprite to the clickOn
- set holdCast to the castNum of sprite thisSprite
- set the castNum of sprite thisSprite to 126
- updateStage()
- repeat while the mouseDown and rollOver(thisSprite)
- end repeat
- set the castNum of sprite thisSprite to holdCast
- if rollOver(thisSprite) then
- do(RETURN)
- end if
- end
-
- on InitGameBoard
- set gGameBoard to birth(script "aGameBrd", 75, 1, 48)
- set theCast to 188
- set theRevCast to 188
- createNewGame(gGameBoard, theCast, 6, 5, 198, theRevCast)
- startTimer()
- end
-
- on doGMouseDown theSprite
- if gGameInPlay then
- doMouseDown(gGameBoard, theSprite)
- end if
- end
-
- on reset
- reset(gGameBoard)
- end
-
- on PlayGame
- puppetSound("meow1.aiff")
- set thisSprite to the clickOn
- set holdCast to the castNum of sprite thisSprite
- set the castNum of sprite thisSprite to 115
- updateStage()
- repeat while the mouseDown and rollOver(thisSprite)
- end repeat
- if rollOver(thisSprite) then
- StartANewGame(gGameBoard)
- set gGameInPlay to 1
- set gTimeOut to 5 * 60
- go("playGame")
- end if
- set the castNum of sprite thisSprite to holdCast
- updateStage()
- end
-
- on doSwapART
- killGame(gGameBoard)
- if gArt = 1 then
- set theCast to 81
- set theRevCast to 41
- set gArt to 2
- else
- set theCast to 144
- set theRevCast to 81
- set gArt to 1
- end if
- createNewGame(gGameBoard, theCast, 6, 5, theCast + 16, theRevCast)
- end
-
- on idle
- if the timer > gTimeOut then
- wiggleButtons()
- if gGameInPlay then
- doTick(gGameBoard)
- else
- scrambleTwoTiles(gGameBoard)
- end if
- doNenoLights()
- startTimer()
- end if
- end
-
- on doNenoLights
- set theSeed_Inner to random(3)
- set theSeed_Middle to random(3)
- set theSeed_Outer to random(3)
- set the castNum of sprite 30 to 55 + theSeed_Inner
- set the castNum of sprite 31 to 58 + theSeed_Middle
- set the castNum of sprite 32 to 61 + theSeed_Outer
- set the castNum of sprite 33 to 66 + theSeed_Inner
- set the castNum of sprite 34 to 69 + theSeed_Middle
- set the castNum of sprite 35 to 72 + theSeed_Outer
- set the castNum of sprite 36 to 77 + theSeed_Inner
- set the castNum of sprite 37 to 80 + theSeed_Middle
- set the castNum of sprite 38 to 83 + theSeed_Outer
- set the castNum of sprite 39 to 88 + theSeed_Inner
- set the castNum of sprite 40 to 91 + theSeed_Middle
- set the castNum of sprite 41 to 94 + theSeed_Outer
- end
-
- on wiggleButtons
- set gDirA to wiggleThisButton(45, 112, 114, gDirA)
- set gDirB to wiggleThisButton(46, 123, 125, gDirB)
- set gDirC to wiggleThisButton(47, 101, 103, gDirC)
- end
-
- on wiggleThisButton theSprite, minCast, maxCast, theDelta
- set holdCast to the castNum of sprite theSprite
- if theDelta > 0 then
- if holdCast = maxCast then
- set theDelta to -1
- set the castNum of sprite theSprite to holdCast - 1
- else
- set the castNum of sprite theSprite to holdCast + 1
- end if
- else
- if holdCast = minCast then
- set theDelta to 1
- set the castNum of sprite theSprite to holdCast + 1
- else
- set the castNum of sprite theSprite to holdCast - 1
- end if
- end if
- return theDelta
- end
-