home *** CD-ROM | disk | FTP | other *** search
- on exitFrame me
- global inputString, playerLocData, playerSO, playerViewPoint, targetSO, enemyData, deathDelay, winDelay, playerInvincible, holdingShot, shotPower, releaseShot, mouseinput, playerLives, totalEnemies, playerlevel, simultaneousEnemies, enemyArmyleft
- harvestInput()
- playerViewPoint = point(0, 0)
- wFrame = 1
- if (playerLocData[2] mod 300) > 150 then
- wFrame = 2
- end if
- set the loc of sprite targetSO to the mouseLoc
- playerInvincible = 0
- if playerLocData[1] = 1 then
- targloc = the mouseLoc * 10
- targloc[2] = 2000
- selfLoc = point(playerLocData[2], 3650)
- mAim = findAngle(selfLoc, targloc)
- locX = sin(mAim * PI / 180) * 150
- if (inputString[3] = 1) or (inputString[5] = 1) then
- guarding = 1
- end if
- if (shotPower = 0) and (guarding = 1) then
- set the member of sprite playerSO to "closedshell"
- playerInvincible = 1
- sprite(playerSO).rotation = 0
- targloc[1] = playerLocData[2]
- else
- if abs(locX) > 25 then
- if shotPower = 0 then
- playerLocData[2] = playerLocData[2] + locX
- if playerLocData[2] > 5600 then
- playerLocData[2] = 5600
- end if
- if playerLocData[2] < 200 then
- playerLocData[2] = 200
- end if
- if locX > 0 then
- playerLocData[4] = #right
- else
- if locX < 0 then
- playerLocData[4] = #left
- end if
- end if
- sprite(playerSO).rotation = 0
- case playerLocData[4] of
- #right:
- set the member of sprite playerSO to "Oyster_R" & string(wFrame)
- #left:
- set the member of sprite playerSO to "Oyster_L" & string(wFrame)
- end case
- else
- case playerLocData[4] of
- #left:
- sprite(playerSO).rotation = 0 - 20 + (shotPower * 12)
- #right:
- sprite(playerSO).rotation = 0 + 20 - (shotPower * 12)
- end case
- case playerLocData[4] of
- #right:
- set the member of sprite playerSO to "Oyster_R" & string(wFrame + 2)
- #left:
- set the member of sprite playerSO to "Oyster_L" & string(wFrame + 2)
- end case
- end if
- set the loc of sprite playerSO to point(playerLocData[2] / 10, 365)
- else
- set the member of sprite playerSO to "OysterFront"
- sprite(playerSO).rotation = 0
- end if
- end if
- if random(8) = 1 then
- addparticle(point(playerLocData[2], 3650), 0, 1)
- end if
- if shotPower > 0 then
- shotPower = shotPower - 1
- if shotPower = 0 then
- end if
- else
- if mouseinput = 1 then
- shotPower = 5
- launchBullet()
- else
- end if
- end if
- rendPlayerAsunder = 0
- if playerLocData[1] = 1 then
- pLoc = point(playerLocData[2], 3600)
- repeat with wEnemy = 1 to count(enemyData)
- if (rendPlayerAsunder = 0) and (enemyData[wEnemy][1] = 1) then
- rendDist = findDistance(enemyData[wEnemy][3], pLoc)
- if rendDist <= 200 then
- rendPlayerAsunder = wEnemy
- end if
- end if
- end repeat
- end if
- if (rendPlayerAsunder <> 0) and (playerInvincible = 0) then
- playerLocData[1] = 0
- deathDelay = 40
- repeat with wEffect = 1 to 100
- addparticle(pLoc, 0, 2)
- end repeat
- playerLives = playerLives - 1
- if playerLives < 0 then
- member("Lives Display").text = "0"
- else
- member("Lives Display").text = string(playerLives)
- end if
- playSound("Player Hit", 3)
- end if
- else
- if deathDelay > 1 then
- deathDelay = deathDelay - 1
- set the loc of sprite playerSO to point(-50, -50)
- else
- if playerLives < 0 then
- go(25)
- else
- if mouseinput = 1 then
- playerLocData = [1, 2900, 0, #center]
- deathDelay = deathDelay - 1
- set the blend of sprite playerSO to 100
- else
- set the loc of sprite playerSO to point(290, 365)
- set the blend of sprite playerSO to random(100)
- end if
- end if
- end if
- end if
- if (totalEnemies < simultaneousEnemies) and (enemyArmyleft > 0) then
- enemyArmyleft = enemyArmyleft - 1
- eType = [1, 2, 3, random(3)][playerlevel]
- xSpawn = [-500, 6300][random(2)]
- ySpawn = random(1500)
- addEnemy(eType, point(xSpawn, ySpawn), point(random(20) - 10, 5 - random(20)))
- end if
- moveEnemies()
- moveBullets()
- moveParticles()
- if (totalEnemies + enemyArmyleft) <= 0 then
- if winDelay > 0 then
- winDelay = winDelay - 1
- go(the frame)
- else
- if playerlevel < 4 then
- playerlevel = playerlevel + 1
- go(15)
- else
- go(20)
- end if
- end if
- else
- go(the frame)
- end if
- end
-
- on mouseDown
- global mouseinput
- mouseinput = 1
- end
-
- on mouseUp
- global mouseinput
- mouseinput = 0
- end
-