home *** CD-ROM | disk | FTP | other *** search
- on initDelayTime
- global startTime, permitgecko
- set permitgecko to 1
- set startTime to the ticks
- end
-
- on checkDelayTime
- global startTime, permitgecko
- set delay to 3 * 60
- if (permitgecko = 1) and (random(5) = 1) then
- if random(2) = 1 then
- runGeckoright()
- else
- runGeckoleft()
- end if
- else
- set permitgecko to 0
- end if
- set currTime to the ticks
- if currTime >= (startTime + delay) then
- checksound()
- puppetTransition(6, 2, 8)
- go(the frame + 1)
- puppetTransition(5, 2, 8)
- initDelayTime()
- else
- go(the frame)
- end if
- end
-
- on rungecko
- set whichway to random(2)
- if whichway = 1 then
- runGeckoright()
- else
- runGeckoleft()
- end if
- end
-
- on runGeckoright
- global startX, startY, stopX, stopY, incX, incY, gecko, permitgecko
- set gecko to 43
- set R_geckolist to "241,242,243,244,245,246,247,248"
- set startX to -30
- set stopX to 640 + 30
- set startY to random(300) + 20
- if the machineType <> 256 then
- set inc to (random(4) * 3) + 5
- else
- set inc to (random(4) * 1) + 2
- end if
- set stopY to startY
- set geckoSprite to 43
- set j to 0
- repeat with n = 1 to (stopX - startX) / inc
- if j < 7 then
- set j to j + 1
- else
- set j to 1
- end if
- puppetSprite(gecko, 1)
- set the castNum of sprite gecko to the value of item j of R_geckolist
- set the locH of sprite gecko to n * inc
- set the locV of sprite gecko to startY
- updateStage()
- end repeat
- set permitgecko to 0
- puppetSprite(gecko, 0)
- end
-
- on runGeckoleft
- global startX, startY, stopX, stopY, incX, incY, gecko, permitgecko
- set gecko to 43
- set L_geckolist to "253,254,255,256,257,258,259,260"
- set stopX to -100
- set startX to 640 + 30
- set startY to random(400) + 20
- if the machineType <> 256 then
- set inc to (random(4) * 3) + 5
- else
- set inc to (random(4) * 1) + 2
- end if
- set stopY to startY
- set geckoSprite to 43
- set j to 0
- repeat with n = 1 to abs((startX - stopX) / inc)
- if j < 7 then
- set j to j + 1
- else
- set j to 1
- end if
- puppetSprite(gecko, 1)
- set the castNum of sprite gecko to the value of item j of L_geckolist
- set the locH of sprite gecko to startX - (n * inc)
- set the locV of sprite gecko to startY
- updateStage()
- end repeat
- set permitgecko to 0
- puppetSprite(gecko, 0)
- end
-