home *** CD-ROM | disk | FTP | other *** search
- global activeBullets, playerShipSO, playerData
-
- on exitFrame me
- global inputString, totalBugs, deathDelay, playerlevel, bossShipData, pBulletData, totalScore, playerScore, lowestRank, playerintro, victoryDelay, pBulletSO, swoopDelay, targetLocationList, selectedCraftList, homein, enemyData, swooperType, fadeTricky, playerLives, accuracyRating
- harvestInput()
- case playerlevel of
- 4:
- swoopDelay = swoopDelay - 1
- 5:
- swoopDelay = swoopDelay - 2
- end case
- if (deathDelay <> 40) or (playerintro <> 0) then
- swoopDelay = 100
- end if
- if swoopDelay <= 0 then
- targetLocationList = point(random(500) + 40, 0)
- validCraftList = []
- repeat with wEnemy = 1 to count(enemyData)
- if enemyData[wEnemy][1] = 1 then
- if enemyData[wEnemy][2] = swooperType then
- if enemyData[wEnemy][6] = 0 then
- add(validCraftList, wEnemy)
- end if
- end if
- end if
- end repeat
- if count(validCraftList) >= 3 then
- repeat with wAssignment = 1 to 3
- rEntry = random(count(validCraftList))
- enemyData[validCraftList[rEntry]][6] = 1
- enemyData[validCraftList[rEntry]][7] = wAssignment
- deleteAt(validCraftList, rEntry)
- end repeat
- end if
- swoopDelay = 200
- end if
- if targetLocationList <> #Na then
- targetLocationList[2] = targetLocationList[2] + 5
- end if
- if targetLocationList <> #Na then
- if targetLocationList[2] > 400 then
- recallSwoopRobots(1)
- targetLocationList = #Na
- end if
- end if
- runBugs()
- runPBullets()
- runEBullets()
- updateArmors()
- moveParticles()
- if bossShipData[1] = 1 then
- if bossShipData[2] > 0 then
- bossShipData[2] = bossShipData[2] - 1
- if bossShipData[2] = 1 then
- playSound("Flyby Man SFX", 2)
- end if
- else
- bossShipData[3] = bossShipData[3] + point(3, 0)
- if fadeTricky > 5 then
- addparticle(bossShipData[3], 0, 5)
- fadeTricky = 0
- else
- fadeTricky = fadeTricky + 1
- end if
- repeat with wBullet = 1 to count(pBulletData)
- if pBulletData[wBullet][1] = 1 then
- if findDistance(bossShipData[3], pBulletData[wBullet][2]) <= 30 then
- repeat with wEffect = 1 to 6
- rBit = point(random(50), random(50)) - 25
- addparticle(bossShipData[3] + rBit, 0, random(2))
- end repeat
- accuracyRating[1] = accuracyRating[1] + 1
- pBulletData[wBullet][1] = 0
- bossShipData[1] = 0
- playerScore = playerScore + 500
- member("Score display").text = string(totalScore + playerScore)
- set the loc of sprite (pBulletSO + wBullet - 1) to point(-50, -50)
- end if
- end if
- end repeat
- set the loc of sprite 9 to bossShipData[3]
- end if
- else
- set the loc of sprite 9 to point(-50, -50)
- end if
- if playerData[1] = 1 then
- if playerintro > 0 then
- set the loc of sprite playerShipSO to playerData[2] + point(0, playerintro)
- playerintro = playerintro - 2
- else
- if inputString[1] = 1 then
- playerData[2][1] = playerData[2][1] - 4
- else
- if inputString[2] = 1 then
- playerData[2][1] = playerData[2][1] + 4
- end if
- end if
- if playerData[2][1] <= 20 then
- playerData[2][1] = 20
- end if
- if playerData[2][1] >= 560 then
- playerData[2][1] = 560
- end if
- set the loc of sprite playerShipSO to playerData[2]
- end if
- sprite(playerShipSO).visible = 1
- else
- addparticle(playerData[2] + point(random(30), random(30)) - 15, 0, random(2) + 1)
- deathDelay = deathDelay - 1
- sprite(playerShipSO).visible = 0
- end if
- if playerintro = 0 then
- if inputString[5] = 1 then
- if playerData[1] = 1 then
- if activeBullets < 1 then
- addBullet(playerData[2], 14, 0)
- accuracyRating[2] = accuracyRating[2] + 1
- end if
- end if
- end if
- end if
- if lowestRank >= 340 then
- playerData[1] = 0
- playerLives = 0
- end if
- if (playerData[1] = 0) and (deathDelay <= 0) then
- if playerLives > 0 then
- deathDelay = 40
- playerLives = playerLives - 1
- initializeplayer()
- playerintro = 100
- if playerLives < 0 then
- go(the frame)
- else
- member("Lives display").text = string(playerLives)
- go(the frame)
- end if
- else
- if deathDelay <= 0 then
- go(35)
- else
- deathDelay = deathDelay - 1
- go(the frame)
- end if
- end if
- else
- if totalBugs = 0 then
- if playerlevel = 5 then
- go(30)
- else
- if victoryDelay <= 0 then
- go(25)
- else
- victoryDelay = victoryDelay - 1
- go(the frame)
- end if
- end if
- else
- go(the frame)
- end if
- end if
- end
-
- on recallSwoopRobots wSwooping
- global enemyData
- repeat with wRobot = 1 to count(enemyData)
- if enemyData[wRobot][6] = wSwooping then
- enemyData[wRobot][6] = 0
- enemyData[wRobot][7] = 0
- end if
- end repeat
- end
-
- on mouseDown
- global accuracyRating, playerintro
- if playerintro = 0 then
- if playerData[1] = 1 then
- if activeBullets < 1 then
- addBullet(playerData[2], 14, 0)
- accuracyRating[2] = accuracyRating[2] + 1
- end if
- end if
- end if
- end
-