home *** CD-ROM | disk | FTP | other *** search
- on startMovie
- global glistCount, gcolorList
- set gcolorList to list(156, 76, 19, 96)
- end
-
- on puppetsOn
- puppetSprite(4, 1)
- puppetSprite(14, 1)
- puppetSprite(15, 1)
- puppetSprite(40, 1)
- puppetSprite(41, 1)
- puppetSprite(42, 1)
- puppetSprite(43, 1)
- puppetSprite(44, 1)
- end
-
- on puppetsOff
- puppetSprite(14, 0)
- puppetSprite(15, 0)
- end
-
- on waitfor seconds
- global getit
- set now to the timer
- repeat while the timer < (now + (seconds * 60))
- if the mouseDown then
- exit
- end if
- end repeat
- end
-
- on runaway
- waitfor(0.20000000000000001)
- puppetSound("giggle")
- set newH to random(the stageRight - the stageLeft)
- set newV to random(the stageBottom - the stageTop)
- moveSprtDiag(4, newH, newV)
- end
-
- on closeWindow
- tell the stage
- cleanUpMIAW()
- end tell
- end
-
- on moveSprtDiag whchSprt, newH, newV
- set x1 to the locH of sprite whchSprt
- set y1 to the locV of sprite whchSprt
- set x2 to newH
- set y2 to newV
- set stepSize to 10
- set stepDelay to 0
- if x1 > x2 then
- set xVal to -1
- else
- set xVal to 1
- end if
- if y1 > y2 then
- set yVal to -1
- else
- set yVal to 1
- end if
- set xDist to abs(x2 - x1)
- set yDist to abs(y2 - y1)
- set x to x1 * 1.0
- set y to y1 * 1.0
- if yDist > xDist then
- set steps to yDist
- set xFact to 1.0 * xDist / yDist * stepSize
- set yFact to stepSize
- else
- set steps to xDist
- set xFact to stepSize
- set yFact to 1.0 * yDist / xDist * stepSize
- end if
- repeat while (x <> x2) or (y <> y2)
- set x to x + (xFact * xVal)
- set y to y + (yFact * yVal)
- if abs(x - x2) <= xFact then
- set x to x2
- end if
- if abs(y - y2) <= yFact then
- set y to y2
- end if
- set the locH of sprite whchSprt to integer(x)
- set the locV of sprite whchSprt to integer(y)
- updateStage()
- set curTicks to the ticks
- repeat while the ticks < (curTicks + stepDelay)
- nothing()
- end repeat
- end repeat
- end
-