home *** CD-ROM | disk | FTP | other *** search
- on exitFrame me
- global playerViewpoint, anchorViewPoint, playerLocData, playerSO, screenTileSize, updateTextFields, animDelay, animNumber, screenDimensions, superPowers, rumbleOffset, screenShakeValue, thoughtBaloonVisible, killOnlyOnce, gFrameTimer, bossIntro, lastTimerCheck, totalCountedFrames, spawnDelay, skipFade, terrainData_Type, locksOpened, maxLocks, lockedOffReigon, playerHealth, portalIndex, playerInventory, playerlevel, bubbleData, updateScoreDisplayNOW, playerScore, levelScore
- if (gFrameTimer + 1) < the ticks then
- gFrameTimer = the ticks
- if playerlevel = 4 then
- if bossIntro < 75 then
- thoughtBaloonVisible = 0
- sprite(27).visible = 0
- end if
- if bossIntro > 0 then
- bossIntro = bossIntro - 1
- if bossIntro = 160 then
- screenShakeValue = 5
- playSound("Small Bomb SFX")
- else
- if bossIntro = 130 then
- screenShakeValue = 10
- playSound("Small Bomb SFX")
- else
- if bossIntro = 100 then
- screenShakeValue = 20
- playSound("Small Bomb SFX")
- else
- if bossIntro = 50 then
- sprite(23).visible = 1
- sprite(24).visible = 1
- sprite(25).visible = 1
- sprite(26).visible = 1
- end if
- end if
- end if
- end if
- end if
- else
- bossIntro = 0
- end if
- if screenShakeValue > 0 then
- screenShakeValue = screenShakeValue - 1
- end if
- if screenShakeValue > 0 then
- rumbleOffset = point(random(screenShakeValue * 6), random(screenShakeValue * 6)) - (screenShakeValue * 3)
- end if
- if the ticks > lastTimerCheck then
- lastTimerCheck = the ticks + 15
- totalCountedFrames = 1
- else
- totalCountedFrames = totalCountedFrames + 1
- end if
- if playerlevel = 3 then
- if spawnDelay <= 0 then
- xSpawn = playerViewpoint[1] + 600
- ySpawn = random(350)
- addMonster(1, point(xSpawn, ySpawn), [point(-4, random(3) - 2), point(0, 120), point(0, 0), 0], 2)
- spawnDelay = 40 + random(40)
- else
- spawnDelay = spawnDelay - 1
- end if
- end if
- animNumber = animNumber + 1
- moveSpeed = findDistance(playerViewpoint, anchorViewPoint)
- moveAim = findAngle(playerViewpoint, anchorViewPoint)
- locY = 0
- locX = integer(sin(moveAim * PI / 180) * (moveSpeed * 0.10000000000000001))
- viewChangerooRec = playerViewpoint / screenTileSize
- playerViewpoint = playerViewpoint + point(locX, locY)
- if playerViewpoint[1] < 20 then
- playerViewpoint[1] = 20
- end if
- xView = ((count(terrainData_Type[1]) - 11) * screenTileSize) + 20
- yView = ((count(terrainData_Type) - 11) * screenTileSize) + 20
- if playerViewpoint[1] > xView then
- playerViewpoint[1] = xView
- end if
- wVector = 1
- maxValue = (([count(terrainData_Type[1]), count(terrainData_Type)][wVector] - screenDimensions[wVector] + 1) * 50) - 15
- if playerViewpoint[1] > maxValue then
- playerViewpoint[1] = maxValue
- end if
- viewChangerooNew = playerViewpoint / screenTileSize
- movePlayer()
- if playerlevel = 4 then
- moveBossMonster(1)
- end if
- moveMonsters()
- movePickups()
- repositionTerrain()
- if viewChangerooRec <> viewChangerooNew then
- redrawTerrainPics()
- end if
- randomValue = point(playerLocData[3][1], playerLocData[3][2])
- if superPowers = 1 then
- if skipFade = 1 then
- if playerLocData[1] = 1 then
- addparticle(randomValue, 0, 4, the member of sprite playerSO, sprite(playerSO).flipH)
- end if
- skipFade = 2
- else
- skipFade = 1
- end if
- end if
- moveParticles()
- repeat with wBulb = 1 to 3
- if wBulb <= playerHealth then
- set the member of sprite (410 + wBulb) to "Health Bulb On"
- next repeat
- end if
- set the member of sprite (410 + wBulb) to "Health Bulb Off"
- end repeat
- if inside(playerLocData[3], portalIndex[1]) = 1 then
- if playerlevel >= 4 then
- go(35)
- else
- go(30)
- end if
- else
- if playerLocData[11] > 100 then
- if playerInventory[3] > 0 then
- playerlevel = playerlevel - 1
- playerInventory[3] = playerInventory[3] - 1
- playerInventory[1] = 0
- superPowers = 0
- go(5)
- else
- go(40)
- end if
- end if
- end if
- if thoughtBaloonVisible = 1 then
- connectionmade = 0
- drawLoc = playerViewpoint + point(250, 200)
- zoomLoc = playerLocData[3] + point(0, -50)
- distMover = findDistance(drawLoc, zoomLoc)
- jumpyDist = distMover / 3
- repeat while connectionmade = 0
- testAim = findAngle(drawLoc, zoomLoc)
- testDist = findDistance(drawLoc, zoomLoc)
- if testDist <= 15 then
- connectionmade = 1
- next repeat
- end if
- locY = integer(cos(testAim * PI / 180) * -jumpyDist)
- locX = integer(sin(testAim * PI / 180) * jumpyDist)
- drawLoc = drawLoc + point(locX, locY)
- addparticle(drawLoc, 0, 8)
- end repeat
- end if
- if updateScoreDisplayNOW = 1 then
- if updateTextFields = 1 then
- member("Score Display").text = string(playerScore + levelScore)
- end if
- updateScoreDisplayNOW = 0
- end if
- updateParalaxBG()
- end if
- go(the frame)
- end
-