home *** CD-ROM | disk | FTP | other *** search
- on exitFrame me
- global riverWidth, debrisFrequency, debrisTimer, debrisData, ProgressData, playerData, riverOffset, scrollingSpeed, playerThrottle, playerAcel, playerPosition, sparkIntensity, flagChecks, roundTimer, vanishCheckpoint, inputString, scoreRecords, playerlevel, lapBonusPoints, spareTimeBonus, playerLevelScore, playerTotalScore, checkTimer, secondsTimer, flagPosition, driftLoc, splashData, splashCycle, splashRateDelay, frameTime, frameTally
- debrisFrequency = [100, 75, 50][playerlevel]
- harvestInput()
- drawShore()
- moveDebris()
- sparkOn = 0
- repeat with whichScan = 1 to count(debrisData)
- if debrisData[whichScan][1] = 1 then
- testDist1 = findDistance(debrisData[whichScan][2], playerData[2] + point(0, -200))
- testDist2 = findDistance(debrisData[whichScan][2], playerData[2] + point(0, 200))
- if (testDist1 <= 250) or (testDist2 <= 250) then
- playerThrottle = playerThrottle / 10
- midPoint = (debrisData[whichScan][2] + playerData[2]) / 2
- set the loc of sprite 74 to (midPoint / 10) + point(riverOffset, 0)
- sparkOn = 1
- debrisData[whichScan][2][2] = 10000
- playSound("Hit " & string(random(3)) & " SFX", 4)
- end if
- end if
- end repeat
- if (sparkOn = 1) and (sparkIntensity >= 5) then
- sparkIntensity = 0
- sprite(74).flipH = random(2) - 1
- sprite(74).flipV = random(2) - 1
- end if
- if sparkIntensity < 5 then
- sparkIntensity = sparkIntensity + 1
- set the member of sprite 74 to "Splat A" & string(sparkIntensity)
- else
- set the loc of sprite 74 to point(-50, -50)
- end if
- if playerThrottle < 10 then
- playerThrottle = 10
- end if
- if debrisTimer <= 0 then
- debrisTimer = debrisTimer + debrisFrequency + random(debrisFrequency)
- addDebris(random(riverWidth))
- else
- debrisTimer = debrisTimer - scrollingSpeed
- end if
- if playerThrottle < 150 then
- if inputString[4] = 1 then
- playerThrottle = playerThrottle + 2
- end if
- end if
- if playerThrottle > 10 then
- if inputString[3] = 1 then
- playerThrottle = playerThrottle - 3
- end if
- end if
- scrollingSpeed = playerThrottle / 10
- sprite(71).rotation = (playerThrottle * 240 / 150) - 30 - integer((playerThrottle + 1) / 30)
- set the locV of sprite 79 to -50
- startPoints = 2000
- incrementPoints = 1
- checkTimer = checkTimer - 1
- if checkTimer <= 0 then
- checkTimer = checkTimer + 30
- secondsTimer = secondsTimer - 1
- setTimerFields = 1
- else
- setTimerFields = 0
- end if
- if flagChecks[1] = 0 then
- roundTimer[1] = roundTimer[1] + 1
- if playerPosition > 15000 then
- playSound("Checkpoint SFX", 5)
- flagChecks[1] = 1
- set the member of sprite 80 to "Checkpoint Animation"
- updateStage()
- sprite(80).visible = 1
- vanishCheckpoint = 50
- put secondsTimer into member "Lap 1 score"
- spareTimeBonus = spareTimeBonus + secondsTimer
- secondsTimer = secondsTimer + 45
- lapBonusPoints = 500
- set the member of sprite 70 to "checkpoint Flag"
- flagPosition = 0
- end if
- if setTimerFields = 1 then
- put secondsTimer into member "Lap 1 score"
- end if
- scoreRecords[1] = scoreRecords[1] + 1
- else
- if flagChecks[2] = 0 then
- roundTimer[2] = roundTimer[2] + 1
- if playerPosition > 30000 then
- playSound("Checkpoint SFX", 5)
- flagChecks[2] = 1
- set the member of sprite 80 to "Checkpoint Animation"
- updateStage()
- sprite(80).visible = 1
- vanishCheckpoint = 50
- put secondsTimer into member "Lap 2 score"
- spareTimeBonus = spareTimeBonus + secondsTimer
- secondsTimer = secondsTimer + 45
- lapBonusPoints = 1000
- set the member of sprite 70 to "checkpoint Flag"
- flagPosition = 0
- end if
- if setTimerFields = 1 then
- put secondsTimer into member "Lap 2 score"
- end if
- scoreRecords[2] = scoreRecords[2] + 1
- else
- if flagChecks[3] = 0 then
- roundTimer[3] = roundTimer[3] + 1
- if playerPosition > 45000 then
- playSound("Checkpoint SFX", 5)
- flagChecks[3] = 1
- set the member of sprite 80 to "Checkpoint Animation"
- updateStage()
- sprite(80).visible = 1
- vanishCheckpoint = 50
- put secondsTimer into member "Lap 3 score"
- spareTimeBonus = spareTimeBonus + secondsTimer
- secondsTimer = secondsTimer + 45
- lapBonusPoints = 1500
- set the member of sprite 70 to "checkpoint Flag"
- flagPosition = 0
- end if
- if setTimerFields = 1 then
- put secondsTimer into member "Lap 3 score"
- end if
- scoreRecords[3] = scoreRecords[3] + 1
- else
- if flagChecks[4] = 0 then
- roundTimer[4] = roundTimer[4] + 1
- if playerPosition > 60000 then
- playSound("Checkpoint SFX", 5)
- flagChecks[4] = 1
- set the member of sprite 80 to "Checkpoint Animation"
- updateStage()
- sprite(80).visible = 1
- vanishCheckpoint = 50
- put secondsTimer into member "Lap 4 score"
- spareTimeBonus = spareTimeBonus + secondsTimer
- lapBonusPoints = 2000
- set the member of sprite 70 to "Finish Flag"
- flagPosition = 0
- end if
- if setTimerFields = 1 then
- put secondsTimer into member "Lap 4 score"
- end if
- scoreRecords[4] = scoreRecords[4] + 1
- end if
- end if
- end if
- end if
- if playerPosition > 60500 then
- if playerlevel = 3 then
- playerLevelScore = lapBonusPoints + spareTimeBonus
- go(20)
- else
- playerLevelScore = lapBonusPoints + spareTimeBonus
- go(15)
- end if
- else
- if secondsTimer <= 0 then
- playerLevelScore = lapBonusPoints
- go(25)
- end if
- end if
- finalScore = playerTotalScore + lapBonusPoints + spareTimeBonus
- if finalScore < 10 then
- set the member of sprite 217 to "Digit empty"
- set the member of sprite 218 to "Digit empty"
- set the member of sprite 219 to "Digit empty"
- set the member of sprite 220 to "Digit " & string(char 1 of string(finalScore))
- else
- if finalScore < 100 then
- set the member of sprite 217 to "Digit empty"
- set the member of sprite 218 to "Digit empty"
- set the member of sprite 219 to "Digit " & string(char 1 of string(finalScore))
- set the member of sprite 220 to "Digit " & string(char 2 of string(finalScore))
- else
- if finalScore < 1000 then
- set the member of sprite 217 to "Digit empty"
- set the member of sprite 218 to "Digit " & string(char 1 of string(finalScore))
- set the member of sprite 219 to "Digit " & string(char 2 of string(finalScore))
- set the member of sprite 220 to "Digit " & string(char 3 of string(finalScore))
- else
- if finalScore < 10000 then
- set the member of sprite 217 to "Digit " & string(char 1 of string(finalScore))
- set the member of sprite 218 to "Digit " & string(char 2 of string(finalScore))
- set the member of sprite 219 to "Digit " & string(char 3 of string(finalScore))
- set the member of sprite 220 to "Digit " & string(char 4 of string(finalScore))
- end if
- end if
- end if
- end if
- if vanishCheckpoint > 0 then
- vanishCheckpoint = vanishCheckpoint - 1
- if vanishCheckpoint = 0 then
- sprite(80).visible = 0
- set the member of sprite 80 to "reddot"
- end if
- end if
- if (playerPosition / 200) <= 300 then
- set the loc of sprite 77 to point(468, 362 - (playerPosition / 200))
- end if
- shipLoc = playerData[2]
- if inputString[1] = 1 then
- driftLoc[1] = driftLoc[1] - 50
- else
- if inputString[2] = 1 then
- driftLoc[1] = driftLoc[1] + 50
- end if
- end if
- targloc = playerData[2] + driftLoc
- if playerData[2][1] < 25 then
- playerData[2][1] = 25
- if playerThrottle > 0 then
- playerThrottle = playerThrottle - 5
- if playerThrottle < 0 then
- playerThrottle = 0
- end if
- end if
- else
- if playerData[2][1] > (riverWidth - 25) then
- playerData[2][1] = riverWidth - 25
- if playerThrottle > 0 then
- playerThrottle = playerThrottle - 5
- if playerThrottle < 0 then
- playerThrottle = 0
- end if
- end if
- end if
- end if
- if playerData[2][2] < 500 then
- playerData[2][2] = 500
- else
- if playerData[2][2] > 4000 then
- playerData[2][2] = 4000
- end if
- end if
- totalSpeed = findDistance(shipLoc, targloc)
- playerMoveAim = findAngle(shipLoc, targloc)
- totalSpeed = totalSpeed / 10
- if totalSpeed > 120 then
- totalSpeed = 120
- end if
- totalSpeed = integer(totalSpeed * scrollingSpeed / 5)
- locY = cos(playerMoveAim * PI / 180) * -totalSpeed
- locX = sin(playerMoveAim * PI / 180) * totalSpeed
- dropSpeed = locY
- playerData[2] = playerData[2] + point(locX, locY)
- drawloc = playerData[2]
- depthRatio = (playerData[2][2] + 2000) / 6000.0
- centerPoint = (riverWidth / 20) + riverOffset
- centerDrift = (drawloc[1] - (riverWidth / 2)) * depthRatio / 10
- set the loc of sprite 87 to point(centerPoint + centerDrift, integer(drawloc[2] / 10))
- sprite(87).rotation = locX / 10
- shipAngle = locX / 10
- if splashRateDelay <= 2 then
- splashRateDelay = splashRateDelay + 1
- else
- splashRateDelay = splashRateDelay - 1
- splashCycle = splashCycle + 1
- if splashCycle > count(splashData) then
- splashCycle = 1
- end if
- splashData[splashCycle][1] = 0
- locY = cos(shipAngle * PI / 180) * -(-550)
- locX = sin(shipAngle * PI / 180) * -550
- splashData[splashCycle][2] = playerData[2] + point(locX, locY - 300)
- end if
- repeat with whichSplash = 1 to count(splashData)
- if splashData[whichSplash][1] >= 20 then
- set the loc of sprite (130 + whichSplash) to point(-50, -50)
- next repeat
- end if
- splashData[whichSplash][2] = splashData[whichSplash][2] + (point(0, playerThrottle) / 2)
- splashData[whichSplash][1] = splashData[whichSplash][1] + 1
- set the member of sprite (130 + whichSplash) to "splash " & string(splashData[whichSplash][1] / 4)
- sprite(130 + whichSplash).flipH = random(2) - 1
- sprite(130 + whichSplash).locZ = 55 - splashData[whichSplash][1]
- drawloc = splashData[whichSplash][2]
- depthRatio = (splashData[whichSplash][2][2] + 3000) / 6000.0
- centerPoint = (riverWidth / 20) + riverOffset
- centerDrift = (drawloc[1] - (riverWidth / 2)) * depthRatio / 12
- set the loc of sprite (130 + whichSplash) to point(centerPoint + centerDrift, integer(drawloc[2] / 10))
- end repeat
- frameTally = frameTally + 1
- if frameTime < the ticks then
- frameTally = 0
- frameTime = the ticks + 30
- end if
- go(the frame)
- end
-