home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / TroyReturns.dxr / 00003.ls < prev    next >
Encoding:
Text File  |  2002-01-31  |  5.3 KB  |  157 lines

  1. on exitFrame me
  2.   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
  3.   if (gFrameTimer + 1) < the ticks then
  4.     gFrameTimer = the ticks
  5.     if playerlevel = 4 then
  6.       if bossIntro < 75 then
  7.         thoughtBaloonVisible = 0
  8.         sprite(27).visible = 0
  9.       end if
  10.       if bossIntro > 0 then
  11.         bossIntro = bossIntro - 1
  12.         if bossIntro = 160 then
  13.           screenShakeValue = 5
  14.           playSound("Small Bomb SFX")
  15.         else
  16.           if bossIntro = 130 then
  17.             screenShakeValue = 10
  18.             playSound("Small Bomb SFX")
  19.           else
  20.             if bossIntro = 100 then
  21.               screenShakeValue = 20
  22.               playSound("Small Bomb SFX")
  23.             else
  24.               if bossIntro = 50 then
  25.                 sprite(23).visible = 1
  26.                 sprite(24).visible = 1
  27.                 sprite(25).visible = 1
  28.                 sprite(26).visible = 1
  29.               end if
  30.             end if
  31.           end if
  32.         end if
  33.       end if
  34.     else
  35.       bossIntro = 0
  36.     end if
  37.     if screenShakeValue > 0 then
  38.       screenShakeValue = screenShakeValue - 1
  39.     end if
  40.     if screenShakeValue > 0 then
  41.       rumbleOffset = point(random(screenShakeValue * 6), random(screenShakeValue * 6)) - (screenShakeValue * 3)
  42.     end if
  43.     if the ticks > lastTimerCheck then
  44.       lastTimerCheck = the ticks + 15
  45.       totalCountedFrames = 1
  46.     else
  47.       totalCountedFrames = totalCountedFrames + 1
  48.     end if
  49.     if playerlevel = 3 then
  50.       if spawnDelay <= 0 then
  51.         xSpawn = playerViewpoint[1] + 600
  52.         ySpawn = random(350)
  53.         addMonster(1, point(xSpawn, ySpawn), [point(-4, random(3) - 2), point(0, 120), point(0, 0), 0], 2)
  54.         spawnDelay = 40 + random(40)
  55.       else
  56.         spawnDelay = spawnDelay - 1
  57.       end if
  58.     end if
  59.     animNumber = animNumber + 1
  60.     moveSpeed = findDistance(playerViewpoint, anchorViewPoint)
  61.     moveAim = findAngle(playerViewpoint, anchorViewPoint)
  62.     locY = 0
  63.     locX = integer(sin(moveAim * PI / 180) * (moveSpeed * 0.10000000000000001))
  64.     viewChangerooRec = playerViewpoint / screenTileSize
  65.     playerViewpoint = playerViewpoint + point(locX, locY)
  66.     if playerViewpoint[1] < 20 then
  67.       playerViewpoint[1] = 20
  68.     end if
  69.     xView = ((count(terrainData_Type[1]) - 11) * screenTileSize) + 20
  70.     yView = ((count(terrainData_Type) - 11) * screenTileSize) + 20
  71.     if playerViewpoint[1] > xView then
  72.       playerViewpoint[1] = xView
  73.     end if
  74.     wVector = 1
  75.     maxValue = (([count(terrainData_Type[1]), count(terrainData_Type)][wVector] - screenDimensions[wVector] + 1) * 50) - 15
  76.     if playerViewpoint[1] > maxValue then
  77.       playerViewpoint[1] = maxValue
  78.     end if
  79.     viewChangerooNew = playerViewpoint / screenTileSize
  80.     movePlayer()
  81.     if playerlevel = 4 then
  82.       moveBossMonster(1)
  83.     end if
  84.     moveMonsters()
  85.     movePickups()
  86.     repositionTerrain()
  87.     if viewChangerooRec <> viewChangerooNew then
  88.       redrawTerrainPics()
  89.     end if
  90.     randomValue = point(playerLocData[3][1], playerLocData[3][2])
  91.     if superPowers = 1 then
  92.       if skipFade = 1 then
  93.         if playerLocData[1] = 1 then
  94.           addparticle(randomValue, 0, 4, the member of sprite playerSO, sprite(playerSO).flipH)
  95.         end if
  96.         skipFade = 2
  97.       else
  98.         skipFade = 1
  99.       end if
  100.     end if
  101.     moveParticles()
  102.     repeat with wBulb = 1 to 3
  103.       if wBulb <= playerHealth then
  104.         set the member of sprite (410 + wBulb) to "Health Bulb On"
  105.         next repeat
  106.       end if
  107.       set the member of sprite (410 + wBulb) to "Health Bulb Off"
  108.     end repeat
  109.     if inside(playerLocData[3], portalIndex[1]) = 1 then
  110.       if playerlevel >= 4 then
  111.         go(35)
  112.       else
  113.         go(30)
  114.       end if
  115.     else
  116.       if playerLocData[11] > 100 then
  117.         if playerInventory[3] > 0 then
  118.           playerlevel = playerlevel - 1
  119.           playerInventory[3] = playerInventory[3] - 1
  120.           playerInventory[1] = 0
  121.           superPowers = 0
  122.           go(5)
  123.         else
  124.           go(40)
  125.         end if
  126.       end if
  127.     end if
  128.     if thoughtBaloonVisible = 1 then
  129.       connectionmade = 0
  130.       drawLoc = playerViewpoint + point(250, 200)
  131.       zoomLoc = playerLocData[3] + point(0, -50)
  132.       distMover = findDistance(drawLoc, zoomLoc)
  133.       jumpyDist = distMover / 3
  134.       repeat while connectionmade = 0
  135.         testAim = findAngle(drawLoc, zoomLoc)
  136.         testDist = findDistance(drawLoc, zoomLoc)
  137.         if testDist <= 15 then
  138.           connectionmade = 1
  139.           next repeat
  140.         end if
  141.         locY = integer(cos(testAim * PI / 180) * -jumpyDist)
  142.         locX = integer(sin(testAim * PI / 180) * jumpyDist)
  143.         drawLoc = drawLoc + point(locX, locY)
  144.         addparticle(drawLoc, 0, 8)
  145.       end repeat
  146.     end if
  147.     if updateScoreDisplayNOW = 1 then
  148.       if updateTextFields = 1 then
  149.         member("Score Display").text = string(playerScore + levelScore)
  150.       end if
  151.       updateScoreDisplayNOW = 0
  152.     end if
  153.     updateParalaxBG()
  154.   end if
  155.   go(the frame)
  156. end
  157.