Symbol 42 MovieClip [luckGirl] Frame 50
this.removeMovieClip();
Symbol 44 MovieClip [Missile] Frame 1
#initclip 29
Object.registerClass("Missile", Missile);
#endinitclip
Symbol 46 MovieClip [EnemyShip] Frame 1
#initclip 13
Object.registerClass("EnemyShip", EnemyShip);
#endinitclip
Symbol 63 MovieClip [Explosion] Frame 1
#initclip 14
Object.registerClass("Explosion", Explosion);
#endinitclip
Symbol 65 MovieClip [EnemyMissile] Frame 1
#initclip 15
Object.registerClass("EnemyMissile", EnemyMissile);
#endinitclip
Symbol 69 MovieClip [RewardPoints] Frame 1
#initclip 16
Object.registerClass("RewardPoints", Icon);
#endinitclip
Symbol 73 MovieClip [PowerUp] Frame 1
#initclip 17
Object.registerClass("PowerUp", PowerUp);
#endinitclip
Symbol 75 MovieClip [MiniBoss] Frame 1
#initclip 18
Object.registerClass("MiniBoss", MiniBoss);
#endinitclip
Symbol 77 MovieClip [NukeIcon] Frame 1
#initclip 19
Object.registerClass("NukeIcon", Icon);
#endinitclip
Symbol 79 MovieClip [RapidFireIcon] Frame 1
#initclip 20
Object.registerClass("RapidFireIcon", Icon);
#endinitclip
Symbol 81 MovieClip [ShieldIcon] Frame 1
#initclip 21
Object.registerClass("ShieldIcon", Icon);
#endinitclip
Symbol 83 MovieClip [Boss] Frame 1
#initclip 22
Object.registerClass("Boss", Boss);
#endinitclip
Symbol 85 MovieClip [HomingMissile] Frame 1
#initclip 23
Object.registerClass("HomingMissile", HomingMissile);
#endinitclip
Symbol 89 MovieClip [goodLuck] Frame 1
#initclip 24
Object.registerClass("goodLuck", Icon);
#endinitclip
Symbol 97 MovieClip [NukeBlast] Frame 1
#initclip 25
Object.registerClass("NukeBlast", Explosion);
#endinitclip
Symbol 163 MovieClip [shipHit] Frame 1
this.stop();
Symbol 163 MovieClip [shipHit] Frame 24
this._visible = false;
this.gotoAndStop(1);
Symbol 167 MovieClip [Ship] Frame 1
#initclip 26
Object.registerClass("Ship", Ship);
#endinitclip
Symbol 169 MovieClip [BgOverlay] Frame 1
#initclip 27
Object.registerClass("BgOverlay", BgOverlay);
#endinitclip
Symbol 172 MovieClip [Background] Frame 1
#initclip 28
Object.registerClass("Background", Background);
#endinitclip
Symbol 176 MovieClip [__Packages.EnemyShip] Frame 0
class EnemyShip extends MovieClip
{
var _x, _y, speed, shootTimer, removeMovieClip, hitTest;
function EnemyShip () {
super();
}
function onLoad() {
_x = 700;
_y = (Math.random() * 200) + 94;
speed = (Math.random() * 5) + 5;
shootTimer = 0;
}
function onEnterFrame() {
shootTimer = shootTimer + 1;
if (shootTimer > 30) {
shootTimer = 0;
var _local3 = _root.attachMovie("EnemyMissile", "EnemyMissile" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x - 30;
_local3._y = _y + 18;
}
_x = _x - speed;
if (_x < -100) {
removeMovieClip();
}
if (hitTest(_root.ship)) {
if (_root.ship.shield._visible == false) {
_root.ship.updateHealth(-20);
}
explode();
}
}
function explode() {
var _local3 = _root.attachMovie("RewardPoints", "RewardPoints" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
_local3.gotoAndStop(1);
var _local4 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local4._x = _x;
_local4._y = _y;
_root.soundFX.attachSound("explode");
_root.soundFX.start();
removeMovieClip();
_root.ship.updateScore(50);
_root.ship.kills = _root.ship.kills + 1;
}
function takeDamage() {
explode();
}
}
Symbol 177 MovieClip [__Packages.Explosion] Frame 0
class Explosion extends MovieClip
{
var _totalframes, _currentframe, removeMovieClip;
function Explosion () {
super();
}
function onEnterFrame() {
if (_currentframe == _totalframes) {
removeMovieClip();
}
}
}
Symbol 178 MovieClip [__Packages.EnemyMissile] Frame 0
class EnemyMissile extends MovieClip
{
var speed, _x, hitTest, removeMovieClip;
function EnemyMissile () {
super();
}
function onLoad() {
speed = -20;
}
function onEnterFrame() {
_x = _x + speed;
if (hitTest(_root.ship)) {
removeMovieClip();
if (_root.ship.shield._visible == false) {
_root.ship.updateHealth(-10);
}
}
if (_x < 0) {
removeMovieClip();
}
}
}
Symbol 179 MovieClip [__Packages.Icon] Frame 0
class Icon extends MovieClip
{
var _y, _alpha, removeMovieClip;
function Icon () {
super();
}
function onEnterFrame() {
_y = _y - 1;
_alpha = _alpha - 2;
if ((_alpha < 0) | (_y < 0)) {
removeMovieClip();
}
}
}
Symbol 180 MovieClip [__Packages.PowerUp] Frame 0
class PowerUp extends MovieClip
{
var speed, ptype, _x, _y, gotoAndStop, _rotation, hitTest, removeMovieClip;
function PowerUp () {
super();
}
function onLoad() {
speed = 2;
ptype = Math.floor((Math.random() * 4) + 1);
_x = 650;
_y = (Math.random() * 200) + 94;
if (ptype == 1) {
gotoAndStop(2);
} else if (ptype == 2) {
gotoAndStop(3);
} else if ((ptype == 3) | (ptype == 4)) {
gotoAndStop(1);
}
}
function onEnterFrame() {
if (_root.ship._visible == true) {
_x = _x - speed;
_rotation = _rotation - 5;
if (hitTest(_root.ship)) {
if (ptype == 1) {
if ((_root.ship.health + 20) > 100) {
_root.ship.updateHealth(100 - _root.ship.health);
} else if ((_root.ship.health + 20) < 100) {
_root.ship.updateHealth(20);
}
}
if (ptype == 2) {
if (_root.ship.shield._visible == false) {
_root.ship.explode();
}
var _local4 = _root.attachMovie("NukeBlast", "NukeBlast" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local4._x = _x;
_local4._y = _y;
_root.soundFX.attachSound("nuke");
_root.soundFX.start();
var _local5 = _root.attachMovie("NukeIcon", "NukeIcon" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local5._x = _x;
_local5._y = _y;
removeMovieClip();
for (var _local3 in _root.ship.enemies) {
_root.ship.enemies[_local3].explode();
}
}
if (ptype == 3) {
_root.soundFX.attachSound("tink");
_root.soundFX.start();
if (_root.ship.shield._visible == false) {
_root.ship.shield._visible = true;
_root.ship.shield._alpha = 0;
}
var _local5 = _root.attachMovie("ShieldIcon", "ShieldIcon" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local5._x = _x;
_local5._y = _y;
_root.ship.updateShieldTimer();
}
if (ptype == 4) {
_root.soundFX.attachSound("tink");
_root.soundFX.start();
_root.ship.rapidFire = true;
_root.ship.updateRapidFireTimer();
var _local5 = _root.attachMovie("RapidFireIcon", "RapidFireIcon" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local5._x = _x;
_local5._y = _y;
}
removeMovieClip();
}
if (_x < -30) {
removeMovieClip();
}
} else if (_root.ship._visible == false) {
removeMovieClip();
}
}
}
Symbol 181 MovieClip [__Packages.MiniBoss] Frame 0
class MiniBoss extends MovieClip
{
var _x, _y, speed, ySpeed, shootTimer, health, gun, hitTest, removeMovieClip;
function MiniBoss () {
super();
}
function onLoad() {
_x = 700;
_y = (Math.random() * 100) + 144;
speed = 2;
ySpeed = 2;
shootTimer = 0;
health = 100;
gun = 1;
_root.enemyHealthMeter._visible = true;
_root.enemyHealthMeter.gotoAndStop(health);
}
function onEnterFrame() {
_y = _y + ySpeed;
if ((ySpeed > 0) && (_y > 294)) {
ySpeed = ySpeed * -1;
} else if ((ySpeed < 0) && (_y < 94)) {
ySpeed = ySpeed * -1;
}
shootTimer = shootTimer + 1;
if (shootTimer > 30) {
shootTimer = 0;
var _local3 = _root.attachMovie("EnemyMissile", "EnemyMissile" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
if (gun == 1) {
gun = 2;
_local3._x = _x - 30;
_local3._y = _y + 18;
} else if (gun == 2) {
gun = 1;
_local3._x = _x + 5;
_local3._y = _y - 9;
}
}
_x = _x - speed;
if (_x < 400) {
speed = 0;
}
if (hitTest(_root.ship)) {
if (_root.ship.shield._visible == false) {
_root.ship.updateHealth(-20);
}
takeDamage();
}
}
function takeDamage() {
health = health - 5;
_root.enemyHealthMeter.gotoAndStop(health);
if (health < 1) {
explode();
}
}
function explode() {
var _local3 = _root.attachMovie("RewardPoints", "RewardPoints" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
_local3.gotoAndStop(2);
var _local4 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local4._x = _x;
_local4._y = _y;
_root.soundFX.attachSound("explode");
_root.soundFX.start();
removeMovieClip();
_root.ship.updateScore(200);
_root.enemyHealthMeter._visible = false;
_root.ship.kills = _root.ship.kills + 1;
}
}
Symbol 182 MovieClip [__Packages.Boss] Frame 0
class Boss extends MovieClip
{
var _x, _y, speed, ySpeed, gunTimer, health, missileTimer, hitTest, removeMovieClip;
function Boss () {
super();
}
function onLoad() {
_x = 700;
_y = (Math.random() * 100) + 144;
speed = 2;
ySpeed = 2;
gunTimer = 0;
health = 100;
missileTimer = 0;
_root.enemyHealthMeter._visible = true;
_root.enemyHealthMeter.gotoAndStop(health);
}
function onEnterFrame() {
_y = _y + ySpeed;
if ((ySpeed > 0) && (_y > 294)) {
ySpeed = ySpeed * -1;
} else if ((ySpeed < 0) && (_y < 94)) {
ySpeed = ySpeed * -1;
}
gunTimer = gunTimer + 1;
if (gunTimer > 15) {
gunTimer = 0;
var _local4 = _root.attachMovie("EnemyMissile", "EnemyMissile" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local4._x = _x + 5;
_local4._y = _y - 15;
}
missileTimer = missileTimer + 1;
if (missileTimer > 60) {
missileTimer = 0;
var _local3 = _root.attachMovie("HomingMissile", "HomingMissile" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
_root.ship.enemies.push(_local3);
}
_x = _x - speed;
if (_x < 400) {
speed = 0;
}
if (hitTest(_root.ship)) {
if (_root.ship.shield._visible == false) {
_root.ship.updateHealth(-20);
}
takeDamage();
}
}
function takeDamage() {
health = health - 1;
_root.enemyHealthMeter.gotoAndStop(health);
if (health < 1) {
explode();
}
}
function explode() {
var _local3 = _root.attachMovie("RewardPoints", "RewardPoints" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
_local3.gotoAndStop(3);
_root.ship.bossCountdown = 3;
var _local4 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local4._x = _x;
_local4._y = _y;
_root.soundFX.attachSound("explode");
_root.soundFX.start();
removeMovieClip();
_root.ship.updateScore(1000);
_root.enemyHealthMeter._visible = false;
_root.ship.kills = _root.ship.kills + 1;
}
}
Symbol 183 MovieClip [__Packages.HomingMissile] Frame 0
class HomingMissile extends MovieClip
{
var xSpeed, ySpeed, _x, hitTest, removeMovieClip, _y;
function HomingMissile () {
super();
}
function onLoad() {
xSpeed = -5;
ySpeed = 3;
}
function onEnterFrame() {
_x = _x + xSpeed;
if (hitTest(_root.ship)) {
takeDamage();
if (_root.ship.shield._visible == false) {
_root.ship.updateHealth(-20);
}
}
if (_x < 0) {
removeMovieClip();
}
if (_x > _root.ship._x) {
if (_y > (_root.ship._y + 6)) {
_y = _y - ySpeed;
} else if (_y < (_root.ship._y - 6)) {
_y = _y + ySpeed;
}
}
}
function takeDamage() {
var _local3 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
_root.soundFX.attachSound("explode");
_root.soundFX.start();
removeMovieClip();
}
}
Symbol 184 MovieClip [__Packages.Ship] Frame 0
class Ship extends MovieClip
{
var musicLimiter, music, kills, shotsFired, velocity, shootLimiter, enemyTimer, miniBossTimer, bossCountdown, shieldTimer, enemies, powerUps, powerupTimer, rapidFireTimer, rapidFire, _x, _y, _visible, health, score;
function Ship () {
super();
}
function onLoad() {
musicLimiter = 0;
music = true;
kills = 0;
shotsFired = 0;
velocity = 10;
shootLimiter = 0;
enemyTimer = 0;
miniBossTimer = 0;
bossCountdown = 3;
shieldTimer = 0;
enemies = [];
powerUps = [];
resetScore();
resetHealth();
powerupTimer = 0;
rapidFireTimer = 0;
rapidFire = false;
_root.enemyHealthMeter._visible = false;
_root.helpMenu._visible = false;
_root.gameOverMenu._visible = false;
_root.gameOverMenu.playAgainButton.onRelease = function () {
_root.ship.newGame();
};
_root.gameOverMenu.closeMenuButton.onRelease = function () {
_root.gameOverMenu._visible = false;
_root.startMenu._visible = true;
};
_root.startMenu._visible = true;
_root.startMenu.startButton.onRelease = function () {
_root.startMenu._visible = false;
_root.ship.newGame();
};
_root.startMenu.helpButton.onRelease = function () {
_root.startMenu._visible = false;
_root.helpMenu._visible = true;
};
_root.helpMenu.closeMenuButton.onRelease = function () {
_root.helpMenu._visible = false;
_root.startMenu._visible = true;
};
_root.ship.shield._visible = false;
_root.ship.shipHit._visible = false;
_x = -35;
_y = 150;
_root.soundFX = new Sound();
_root.backgroundMusic = new Sound();
_root.backgroundMusic.attachSound("bgMusic");
_root.backgroundMusic.start(0, 1000);
_root.backgroundMusic.setVolume(50);
_visible = false;
}
function onEnterFrame() {
if (_visible == true) {
if (rapidFire == true) {
rapidFireTimer = rapidFireTimer + 1;
if (rapidFireTimer > 300) {
rapidFireTimer = 0;
rapidFire = false;
}
}
if (_root.ship.shield._visible == true) {
shieldTimer = shieldTimer + 1;
if (shieldTimer > 200) {
_root.ship.shield._alpha = _root.ship.shield._alpha - 1;
if (_root.ship.shield._alpha < 0) {
_root.ship.shield._visible = false;
_root.ship.shield._alpha = 100;
shieldTimer = 0;
}
} else if (((_root.ship.shield._alpha + 1) < 100) && (shieldTimer < 200)) {
_root.ship.shield._alpha = _root.ship.shield._alpha + 5;
}
}
powerupTimer = powerupTimer + 1;
if (powerupTimer > ((Math.random() * 100) + 150)) {
powerupTimer = 0;
var _local3 = _root.attachMovie("PowerUp", "PowerUp" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
powerUps.push(_local3);
}
if (!_root.boss) {
enemyTimer = enemyTimer + 1;
if (enemyTimer > 60) {
enemyTimer = 0;
var _local4 = _root.attachMovie("EnemyShip", "EnemyShip" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
enemies.push(_local4);
}
if (!_root.miniBoss) {
miniBossTimer = miniBossTimer + 1;
if (miniBossTimer > 300) {
miniBossTimer = 0;
if (bossCountdown == 0) {
var _local4 = _root.attachMovie("Boss", "boss", _root.getNextHighestDepth());
enemies.push(_local4);
} else {
var _local4 = _root.attachMovie("MiniBoss", "miniBoss", _root.getNextHighestDepth());
enemies.push(_local4);
bossCountdown = bossCountdown - 1;
}
}
}
}
shootLimiter = shootLimiter + 1;
musicLimiter = musicLimiter + 1;
if (_x < 55) {
_x = _x + 5;
}
if (Key.isDown(77)) {
if ((musicLimiter > 8) && (music == true)) {
_root.backgroundMusic.stop();
music = false;
musicLimiter = 0;
} else if ((musicLimiter > 8) && (music == false)) {
_root.backgroundMusic.start(0, 1000);
_root.backgroundMusic.setVolume(50);
music = true;
musicLimiter = 0;
}
}
if (Key.isDown(39) && ((_x + velocity) < 563)) {
_x = _x + velocity;
}
if (Key.isDown(37) && ((_x - velocity) > 45)) {
_x = _x - velocity;
}
if (Key.isDown(38) && ((_y - velocity) > 70)) {
_y = _y - velocity;
}
if (Key.isDown(40) && ((_y + velocity) < 314)) {
_y = _y + velocity;
}
if (Key.isDown(32)) {
if ((shootLimiter > 2) && (rapidFire == true)) {
fire();
} else if ((shootLimiter > 8) && (rapidFire == false)) {
fire();
}
}
_root.healthMeter.gotoAndStop(health);
}
}
function updateScore(points) {
score = score + points;
_root.scoreText.text = score;
}
function resetScore() {
score = 0;
_root.scoreText.text = score;
kills = 0;
shotsFired = 0;
}
function updateHealth(points) {
if (points < 0) {
_root.ship.shipHit._visible = true;
_root.ship.shipHit.gotoAndPlay(2);
}
health = health + points;
if (health < 1) {
health = 0;
explode();
}
}
function explode() {
_root.healthMeter.gotoAndStop(101);
_visible = false;
var _local4 = _root.attachMovie("Explosion", "Explosion" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local4._x = _x;
_local4._y = _y;
_root.soundFX.attachSound("explode");
_root.soundFX.start();
for (var _local3 in enemies) {
enemies[_local3].explode();
}
_root.gameOverMenu._visible = true;
_root.gameOverMenu.killsText.text = kills;
_root.gameOverMenu.shotsFiredText.text = shotsFired;
_root.gameOverMenu.hitRatioText.text = int((kills / shotsFired) * 100) + "%";
}
function resetHealth() {
health = 100;
_root.healthMeter.gotoAndStop(health);
}
function newGame() {
_visible = true;
_root.gameOverMenu._visible = false;
resetHealth();
resetScore();
bossCountdown = 3;
miniBossTimer = 0;
_x = -35;
_y = 150;
var _local3 = _root.attachMovie("goodLuck", "goodLuck" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = 160;
_local3._y = 160;
}
function fire() {
shootLimiter = 0;
var _local3 = _root.attachMovie("Missile", "Missile" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x + 55;
_local3._y = _y + 4;
_root.soundFX.attachSound("laser");
_root.soundFX.start();
_root.soundFX.setVolume(75);
shotsFired = shotsFired + 1;
}
function updateShieldTimer() {
shieldTimer = 0;
}
function updateRapidFireTimer() {
rapidFireTimer = 0;
}
}
Symbol 185 MovieClip [__Packages.BgOverlay] Frame 0
class BgOverlay extends MovieClip
{
var _x;
function BgOverlay () {
super();
}
function onEnterFrame() {
_x = _x - 3;
if (_x < -1660) {
_x = 0;
}
}
}
Symbol 186 MovieClip [__Packages.Background] Frame 0
class Background extends MovieClip
{
var _x;
function Background () {
super();
}
function onEnterFrame() {
_x = _x - 1;
if (_x < -5060) {
_x = 0;
}
}
}
Symbol 187 MovieClip [__Packages.Missile] Frame 0
class Missile extends MovieClip
{
var speed, _x, hitTest, removeMovieClip, _y;
function Missile () {
super();
}
function onLoad() {
speed = 20;
}
function onEnterFrame() {
_x = _x + speed;
for (var _local7 in _root.ship.enemies) {
if (hitTest(_root.ship.enemies[_local7])) {
removeMovieClip();
_root.ship.enemies[_local7].takeDamage();
}
}
for (var _local6 in _root.ship.powerUps) {
if (hitTest(_root.ship.powerUps[_local6]) && (_root.ship.powerUps[_local6].ptype == 2)) {
_root.ship.powerUps[_local6].removeMovieClip();
var _local3 = _root.attachMovie("NukeBlast", "NukeBlast" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local3._x = _x;
_local3._y = _y;
_root.soundFX.attachSound("nuke");
_root.soundFX.start();
var _local4 = _root.attachMovie("NukeIcon", "NukeIcon" + _root.getNextHighestDepth(), _root.getNextHighestDepth());
_local4._x = _x;
_local4._y = _y;
removeMovieClip();
for (var _local5 in _root.ship.enemies) {
_root.ship.enemies[_local5].explode();
}
}
}
if (_x > 600) {
removeMovieClip();
}
}
}