home *** CD-ROM | disk | FTP | other *** search
- on exitFrame me
- global grabbedPiece, pegData, holeData, inputString, gottaRedraw, tickRecord, levelTimer, unfinishedSlots, timeRecount, panicTimer, homeLocations, victoryDelay
- harvestInput()
- speedmod = 1
- if the ticks > tickRecord then
- totalTicksLeft = integer((3600 * speedmod * 2) - levelTimer)
- timerSeconds = (totalTicksLeft / 60 mod 60) + 1
- timerMinutes = totalTicksLeft / 60 / 60
- if timerSeconds = 60 then
- timerSeconds = 0
- timerMinutes = timerMinutes + 1
- end if
- if timerSeconds < 10 then
- member("Timer Display").text = string(timerMinutes) & ":0" & string(timerSeconds)
- else
- member("Timer Display").text = string(timerMinutes) & ":" & string(timerSeconds)
- end if
- totalSeconds = (totalTicksLeft / 60) + 1
- if integer(totalSeconds) < integer(panicTimer) then
- panicTimer = integer(totalSeconds)
- member("Panic Counter").text = string(panicTimer)
- sprite(16).visible = 1
- end if
- tickRecord = the ticks + 0.5
- if gottaRedraw = 1 then
- drawSlots(1)
- gottaRedraw = 0
- else
- drawSlots(0)
- end if
- levelTimer = levelTimer + 1
- repeat with wPiece = 1 to count(pegData)
- if (wPiece <> grabbedPiece) and (pegData[wPiece][4] = 0) then
- if homeLocations[wPiece] <> pegData[wPiece][1] then
- moveAim = findAngle(pegData[wPiece][1], homeLocations[wPiece])
- moveDist = findDistance(pegData[wPiece][1], homeLocations[wPiece])
- if moveDist <= 10 then
- pegData[wPiece][1] = homeLocations[wPiece]
- else
- locY = integer(cos(moveAim * PI / 180) * -20)
- locX = integer(sin(moveAim * PI / 180) * 20)
- pegData[wPiece][1] = pegData[wPiece][1] + point(locX, locY)
- end if
- set the loc of sprite (100 + wPiece) to pegData[wPiece][1]
- end if
- end if
- end repeat
- if levelTimer > (60 * 60 * speedmod) then
- levelTimer = 60 * 60 * speedmod
- end if
- set the member of sprite integer(200 + (levelTimer / 60.0 / speedmod) - 0.5) to "Red Bulb"
- timeAimer = levelTimer / 10.0 / speedmod
- locY = integer(cos(timeAimer * PI / 180) * -210)
- locX = integer(sin(timeAimer * PI / 180) * 210)
- set the loc of sprite 261 to the loc of sprite 5 + point(locX, locY - 2)
- sprite(261).locZ = 16
- if grabbedPiece <> 0 then
- pegData[grabbedPiece][1] = the mouseLoc
- if inputString[1] = 1 then
- pegData[grabbedPiece][2] = pegData[grabbedPiece][2] - 10
- else
- if inputString[2] = 1 then
- pegData[grabbedPiece][2] = pegData[grabbedPiece][2] + 10
- end if
- end if
- coreloc = pegData[grabbedPiece][2]
- end if
- timeRecount = timeRecount = 1
- if timeRecount > 10 then
- drawpegs()
- timeRecount = 0
- end if
- updatePeg()
- end if
- if unfinishedSlots > 0 then
- if levelTimer >= 3600 then
- go(35)
- else
- go(the frame)
- end if
- else
- updateStage()
- victoryDelay = 0
- go(15)
- end if
- end
-