Combined Code
movieClip 3 Missile {
#initclip
Object.registerClass('Missile', Missile);
#endinitclip
}
movieClip 8 EnemyShip {
#initclip
Object.registerClass('EnemyShip', EnemyShip);
#endinitclip
}
movieClip 33 Explosion {
#initclip
Object.registerClass('Explosion', Explosion);
#endinitclip
}
movieClip 38 EnemyMissile {
#initclip
Object.registerClass('EnemyMissile', EnemyMissile);
#endinitclip
}
// unknown tag 88 length 147
movieClip 41 RewardPoints {
#initclip
Object.registerClass('RewardPoints', RewardPoints);
#endinitclip
}
movieClip 58 PowerUp {
#initclip
Object.registerClass('PowerUp', PowerUp);
#endinitclip
}
movieClip 63 MiniBoss {
#initclip
Object.registerClass('MiniBoss', MiniBoss);
#endinitclip
}
movieClip 68 EnemyShip2 {
#initclip
Object.registerClass('EnemyShip2', EnemyShip2);
#endinitclip
}
movieClip 71 EnemyMissile2 {
#initclip
Object.registerClass('EnemyMissile2', EnemyMissile2);
#endinitclip
}
movieClip 78 EnemyShip3 {
#initclip
Object.registerClass('EnemyShip3', EnemyShip3);
#endinitclip
}
movieClip 89 EnemyMissile3 {
#initclip
Object.registerClass('EnemyMissile3', EnemyMissile3);
#endinitclip
}
movieClip 94 MiniBoss2 {
#initclip
Object.registerClass('MiniBoss2', MiniBoss2);
#endinitclip
}
movieClip 103 MiniBoss2Missile {
#initclip
Object.registerClass('MiniBoss2Missile', MiniBoss2Missile);
#endinitclip
}
// unknown tag 88 length 94
movieClip 106 creditsButton {
}
movieClip 110 {
}
movieClip 111 playMenu {
}
movieClip 113 {
}
movieClip 116 gameOverMenu {
}
movieClip 119 bar {
}
movieClip 123 healthMeter {
}
movieClip 128 {
}
movieClip 131 Ship {
#initclip
Object.registerClass('Ship', Ship);
#endinitclip
}
movieClip 134 Background {
#initclip
Object.registerClass('Background', Background);
#endinitclip
}
movieClip 136 __Packages.EnemyShip {
#initclip
if (!_global.EnemyShip) {
var v1 = function () {
super();
};
_global.EnemyShip = v1;
_global.EnemyShip extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this._x = Math.random() * 500;
this._y = -700;
this.speed = Math.random() * 5 + 5;
this.shootTimer = 0;
};
v2.onEnterFrame = function () {
this._y += this.speed;
if (this._y > 600) {
this.removeMovieClip();
}
if (this.hitTest(_root.ship)) {
this.explode();
if (_root.ship.shield._visible == false) {
_root.ship.updateHealth(-20);
}
}
this.shootTimer += 1;
if (this.shootTimer > 30) {
this.shootTimer = 0;
var v3 = _root.attachMovie('EnemyMissile', 'EnemyMissile' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x;
v3._y = this._y + 2;
}
};
v2.explode = function () {
var v3 = _root.attachMovie('RewardPoints', 'RewardPoints' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x;
v3._y = this._y;
v3.field.text = 50;
var v4 = _root.attachMovie('Explosion', 'Explosion' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v4._x = this._x;
v4._y = this._y;
this.removeMovieClip();
_root.ship.updateScore(50);
};
v2.takeDamage = function () {
this.explode();
};
ASSetPropFlags(_global.EnemyShip.prototype, null, 1);
}
#endinitclip
}
movieClip 137 __Packages.Explosion {
#initclip
if (!_global.Explosion) {
var v1 = function () {
super();
};
_global.Explosion = v1;
_global.Explosion extends MovieClip;
var v2 = v1.prototype;
v2.onEnterFrame = function () {
if (this._currentframe == this._totalframes) {
this.removeMovieClip();
}
};
ASSetPropFlags(_global.Explosion.prototype, null, 1);
}
#endinitclip
}
movieClip 138 __Packages.EnemyMissile {
#initclip
if (!_global.EnemyMissile) {
var v1 = function () {
super();
};
_global.EnemyMissile = v1;
_global.EnemyMissile extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this.speed = -12;
this.xSpeed = 3;
};
v2.onEnterFrame = function () {
this._y -= this.speed;
if (this._y > 600) {
this.removeMovieClip();
}
this._x += this.xSpeed;
if (this.xSpeed > 0 && this._x > 200) {
this.xSpeed *= -1;
} else {
if (this.xSpeed < 0 && this._x < 150) {
this.xSpeed *= -1;
}
}
if (this.hitTest(_root.ship)) {
this.removeMovieClip();
if (_root.ship.shield._visible == false) {
_root.ship.updateHealth(-10);
}
}
if (this._y < 0) {
this.removeMovieClip();
}
};
ASSetPropFlags(_global.EnemyMissile.prototype, null, 1);
}
#endinitclip
}
movieClip 139 __Packages.RewardPoints {
#initclip
if (!_global.RewardPoints) {
var v1 = function () {
super();
};
_global.RewardPoints = v1;
_global.RewardPoints extends MovieClip;
var v2 = v1.prototype;
v2.onEnterFrame = function () {
this._alpha -= 2;
if (this._alpha < 0) {
this.removeMovieClip();
}
};
ASSetPropFlags(_global.RewardPoints.prototype, null, 1);
}
#endinitclip
}
movieClip 140 __Packages.PowerUp {
#initclip
if (!_global.PowerUp) {
var v1 = function () {
super();
};
_global.PowerUp = v1;
_global.PowerUp extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this.speed = 8;
this.type = Math.floor(Math.random() * 3 + 1);
this._x = Math.random() * 500;
this._y = -700;
};
v2.onEnterFrame = function () {
if (this._y > 600) {
this.removeMovieClip();
}
this._y += this.speed;
if (this.hitTest(_root.ship)) {
if (this.type == 1) {
_root.ship.updateHealth(30);
_root.soundFX.attachSound('Click.wav');
_root.soundFX.start();
}
if (this.type == 2) {
for (var v3 in _root.ship.enemies) {
_root.ship.enemies[v3].explode();
_root.soundFX.attachSound('Click.wav');
_root.soundFX.start();
}
}
if (this.type == 3) {
_root.ship.shield._visible = true;
_root.soundFX.attachSound('Click.wav');
_root.soundFX.start();
}
this.removeMovieClip();
}
};
ASSetPropFlags(_global.PowerUp.prototype, null, 1);
}
#endinitclip
}
movieClip 141 __Packages.MiniBoss {
#initclip
if (!_global.MiniBoss) {
var v1 = function () {
super();
};
_global.MiniBoss = v1;
_global.MiniBoss extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this._x = Math.random() * 500;
this._y = -700;
this.speed = 2;
this.xSpeed = 2;
this.shootTimer = 0;
this.health = 100;
};
v2.onEnterFrame = function () {
this._x += this.xSpeed;
if (this.xSpeed > 0 && this._x > 450) {
this.xSpeed *= -1;
} else {
if (this.xSpeed < 0 && this._x < 50) {
this.xSpeed *= -1;
}
}
this._y += this.speed;
if (this._y > 600) {
this.removeMovieClip();
}
if (this.hitTest(_root.ship)) {
this.explode();
if (_root.ship.shield._visible == false) {
_root.ship.updateHealth(-40);
}
}
this.shootTimer += 1;
if (this.shootTimer > 30) {
this.shootTimer = 0;
var v3 = _root.attachMovie('EnemyMissile', 'EnemyMissile' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x;
v3._y = this._y + 2;
}
};
v2.takeDamage = function () {
this.health -= 10;
if (this.health < 1) {
this.explode();
}
};
v2.explode = function () {
var v3 = _root.attachMovie('RewardPoints', 'RewardPoints' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x;
v3._y = this._y;
v3.field.text = 500;
var v4 = _root.attachMovie('Explosion', 'Explosion' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v4._x = this._x;
v4._y = this._y;
this.removeMovieClip();
_root.ship.updateScore(500);
};
ASSetPropFlags(_global.MiniBoss.prototype, null, 1);
}
#endinitclip
}
movieClip 142 __Packages.EnemyShip2 {
#initclip
if (!_global.EnemyShip2) {
var v1 = function () {
super();
};
_global.EnemyShip2 = v1;
_global.EnemyShip2 extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this._x = Math.random() * 500;
this._y = -700;
this.speed = Math.random() * 5 + 3;
this.xSpeed = 2;
this.shootTimer = 0;
};
v2.onEnterFrame = function () {
this._x += this.xSpeed;
if (this.xSpeed > 0 && this._x > 200) {
this.xSpeed *= -1;
} else {
if (this.xSpeed < 0 && this._x < 150) {
this.xSpeed *= -1;
}
}
this._y += this.speed;
if (this._y > 600) {
this.removeMovieClip();
}
if (this.hitTest(_root.ship)) {
this.explode();
if (_root.ship.shield._visible == false) {
_root.ship.updateHealth(-20);
}
}
this.shootTimer += 1;
if (this.shootTimer > 50) {
this.shootTimer = 0;
var v3 = _root.attachMovie('EnemyMissile2', 'EnemyMissile2' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x;
v3._y = this._y + 2;
}
};
v2.explode = function () {
var v3 = _root.attachMovie('RewardPoints', 'RewardPoints' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x;
v3._y = this._y;
v3.field.text = 50;
var v4 = _root.attachMovie('Explosion', 'Explosion' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v4._x = this._x;
v4._y = this._y;
this.removeMovieClip();
_root.ship.updateScore(50);
_root.soundFX.attachSound('Blast.wav');
_root.soundFX.start();
};
v2.takeDamage = function () {
this.explode();
};
ASSetPropFlags(_global.EnemyShip2.prototype, null, 1);
}
#endinitclip
}
movieClip 143 __Packages.EnemyMissile2 {
#initclip
if (!_global.EnemyMissile2) {
var v1 = function () {
super();
};
_global.EnemyMissile2 = v1;
_global.EnemyMissile2 extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this.speed = -20;
};
v2.onEnterFrame = function () {
this._y -= this.speed;
this._rotation -= 5;
if (this.hitTest(_root.ship)) {
this.removeMovieClip();
if (_root.ship.shield._visible == false) {
_root.ship.updateHealth(-10);
}
}
if (this._y > 600) {
this.removeMovieClip();
}
if (this._y < 0) {
this.removeMovieClip();
}
};
ASSetPropFlags(_global.EnemyMissile2.prototype, null, 1);
}
#endinitclip
}
movieClip 144 __Packages.EnemyShip3 {
#initclip
if (!_global.EnemyShip3) {
var v1 = function () {
super();
};
_global.EnemyShip3 = v1;
_global.EnemyShip3 extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this._x = Math.random() * 500;
this._y = -700;
this.speed = Math.random() * 5 + 5;
this.shootTimer = 0;
};
v2.onEnterFrame = function () {
this._y += this.speed;
if (this._y > 600) {
this.removeMovieClip();
}
if (this.hitTest(_root.ship)) {
this.explode();
if (_root.ship.shield._visible == false) {
_root.ship.updateHealth(-20);
}
}
this.shootTimer += 1;
if (this.shootTimer > 50) {
this.shootTimer = 0;
var v3 = _root.attachMovie('EnemyMissile3', 'EnemyMissile3' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x;
v3._y = this._y + 2;
}
};
v2.explode = function () {
var v3 = _root.attachMovie('RewardPoints', 'RewardPoints' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x;
v3._y = this._y;
v3.field.text = 50;
var v4 = _root.attachMovie('Explosion', 'Explosion' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v4._x = this._x;
v4._y = this._y;
this.removeMovieClip();
_root.ship.updateScore(50);
_root.soundFX.attachSound('Blast.wav');
_root.soundFX.start();
};
v2.takeDamage = function () {
this.explode();
};
ASSetPropFlags(_global.EnemyShip3.prototype, null, 1);
}
#endinitclip
}
movieClip 145 __Packages.EnemyMissile3 {
#initclip
if (!_global.EnemyMissile3) {
var v1 = function () {
super();
};
_global.EnemyMissile3 = v1;
_global.EnemyMissile3 extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this.speed = -10;
this.xSpeed = 3;
};
v2.onEnterFrame = function () {
this._y -= this.speed;
this._x += this.xSpeed;
if (this.xSpeed > 0 && this._x > 150) {
this.xSpeed *= -1;
} else {
if (this.xSpeed < 0 && this._x < 100) {
this.xSpeed *= -1;
}
}
this._rotation -= 5;
if (this.hitTest(_root.ship)) {
this.removeMovieClip();
if (_root.ship.shield._visible == false) {
_root.ship.updateHealth(-10);
}
}
if (this._y < 0) {
this.removeMovieClip();
}
if (this._y > 600) {
this.removeMovieClip();
}
};
ASSetPropFlags(_global.EnemyMissile3.prototype, null, 1);
}
#endinitclip
}
movieClip 146 __Packages.MiniBoss2 {
#initclip
if (!_global.MiniBoss2) {
var v1 = function () {
super();
};
_global.MiniBoss2 = v1;
_global.MiniBoss2 extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this._x = Math.random() * 500;
this._y = -700;
this.speed = 2;
this.xSpeed = 2;
this.shootTimer = 0;
this.health = 100;
};
v2.onEnterFrame = function () {
this._x += this.xSpeed;
if (this.xSpeed > 0 && this._x > 450) {
this.xSpeed *= -1;
} else {
if (this.xSpeed < 0 && this._x < 50) {
this.xSpeed *= -1;
}
}
this._y += this.speed;
if (this._y > 600) {
this.removeMovieClip();
}
if (this.hitTest(_root.ship)) {
this.explode();
if (_root.ship.shield._visible == false) {
_root.ship.updateHealth(-40);
}
}
this.shootTimer += 1;
if (this.shootTimer > 30) {
this.shootTimer = 0;
var v3 = _root.attachMovie('MiniBoss2Missile', 'MiniBoss2Missile' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x;
v3._y = this._y + 2;
}
};
v2.takeDamage = function () {
this.health -= 10;
if (this.health < 1) {
this.explode();
}
};
v2.explode = function () {
var v3 = _root.attachMovie('RewardPoints', 'RewardPoints' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x;
v3._y = this._y;
v3.field.text = 500;
var v4 = _root.attachMovie('Explosion', 'Explosion' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v4._x = this._x;
v4._y = this._y;
this.removeMovieClip();
_root.ship.updateScore(500);
};
ASSetPropFlags(_global.MiniBoss2.prototype, null, 1);
}
#endinitclip
}
movieClip 147 __Packages.MiniBoss2Missile {
#initclip
if (!_global.MiniBoss2Missile) {
var v1 = function () {
super();
};
_global.MiniBoss2Missile = v1;
_global.MiniBoss2Missile extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this.speed = -10;
};
v2.onEnterFrame = function () {
this._y -= this.speed;
this._rotation -= 5;
if (this.hitTest(_root.ship)) {
this.removeMovieClip();
if (_root.ship.shield._visible == false) {
_root.ship.updateHealth(-10);
}
}
if (this._y < 0) {
this.removeMovieClip();
}
if (this._y < 0) {
this.removeMovieClip();
}
if (this._y > 600) {
this.removeMovieClip();
}
};
ASSetPropFlags(_global.MiniBoss2Missile.prototype, null, 1);
}
#endinitclip
}
movieClip 148 __Packages.Ship {
#initclip
if (!_global.Ship) {
var v1 = function () {
super();
};
_global.Ship = v1;
_global.Ship extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
_root.ship.shield._visible = false;
_root.gameOverMenu._visible = false;
_root.healthMeter._visible = false;
this._visible = false;
_root.playMenu.playButton.onPress = function () {
_root.ship.newGame();
};
_root.gameOverMenu.playAgainButton.onPress = function () {
_root.ship.newGame();
};
};
v2.newGame = function () {
this.velocity = 10;
this.shootLimiter = 0;
this.enemyTimer = 0;
this.enemyTimer2 = 0;
this.enemyTimer3 = 0;
this.miniBossTimer = 0;
this.miniBossTimer2 = 0;
this.enemies = [];
this.resetScore();
this.resetHealth();
this.powerupTimer = 0;
_root.playMenu._visible = false;
_root.healthMeter._visible = true;
this._visible = true;
_root.gameOverMenu._visible = false;
this.resetHealth();
this.resetScore();
};
v2.onEnterFrame = function () {
if (this._visible == true) {
this.shootLimiter += 1;
}
if (Key.isDown(37) && this._x > 20) {
this._x -= this.velocity;
}
if (Key.isDown(39) && this._x < 480) {
this._x += this.velocity;
}
if (Key.isDown(38) && this._y > 20) {
this._y -= this.velocity;
}
if (Key.isDown(40) && this._y < 580) {
this._y += this.velocity;
}
if (Key.isDown(32) && this.shootLimiter > 6) {
this.shootLimiter = 0;
var v3 = _root.attachMovie('Missile', 'Missile' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x - 3;
v3._y = this._y - 50;
}
this.enemyTimer += 1;
if (this.enemyTimer > 75 && this.health > 1) {
this.enemyTimer = 0;
var v4 = _root.attachMovie('EnemyShip', 'EnemyShip' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
this.enemies.push(v4);
}
this.enemyTimer2 += 1;
if (this.enemyTimer2 > 105 && this.health > 1) {
this.enemyTimer2 = 0;
v4 = _root.attachMovie('EnemyShip2', 'EnemyShip2' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
this.enemies.push(v4);
}
this.enemyTimer3 += 1;
if (this.enemyTimer3 > 65 && this.health > 1) {
this.enemyTimer3 = 0;
v4 = _root.attachMovie('EnemyShip3', 'EnemyShip3' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
this.enemies.push(v4);
}
if (!_root.miniBoss) {
this.miniBossTimer += 1;
}
if (this.miniBossTimer > 50 && this.health > 1) {
this.miniBossTimer = 0;
_root.attachMovie('MiniBoss', 'miniBoss', _root.getNextHighestDepth());
this.enemies.push(_root.miniBoss);
}
if (!_root.miniBoss2) {
this.miniBossTimer2 += 1;
}
if (this.miniBossTimer2 > 100 && this.health > 1) {
this.miniBossTimer2 = 0;
_root.attachMovie('MiniBoss2', 'miniBoss2', _root.getNextHighestDepth());
this.enemies.push(_root.miniBoss2);
}
this.powerupTimer += 1;
if (this.powerupTimer > 300 && this.health > 1) {
this.powerupTimer = 0;
var v5 = _root.attachMovie('PowerUp', 'PowerUp' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
}
if (_root.ship.shield._visible == true) {
_root.ship.shield._alpha -= 0.5;
if (_root.ship.shield._alpha < 0) {
_root.ship.shield._visible = false;
_root.ship.shield._alpha = 100;
}
}
};
v2.updateScore = function (points) {
this.score += points;
_root.scoreText.text = this.score;
};
v2.resetScore = function () {
this.score = 0;
_root.scoreText.text = this.score;
};
v2.updateHealth = function (points) {
this.health += points;
if (this.health < 1) {
this.health = 0;
_root.gameOverMenu._visible = true;
this.explode();
}
_root.healthMeter.bar._xscale = this.health;
};
v2.resetHealth = function () {
this.health = 100;
_root.healthMeter.bar._xscale = 100;
};
v2.explode = function () {
this._visible = false;
var v3 = _root.attachMovie('Explosion', 'Explosion' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x;
v3._y = this._y;
this.destroyAllEnemies();
};
v2.destroyAllEnemies = function () {
var v2 = 0;
while (v2 < this.enemies.length) {
this.enemies[v2].explode();
++v2;
}
};
ASSetPropFlags(_global.Ship.prototype, null, 1);
}
#endinitclip
}
movieClip 149 __Packages.Background {
#initclip
if (!_global.Background) {
var v1 = function () {
super();
};
_global.Background = v1;
_global.Background extends MovieClip;
var v2 = v1.prototype;
v2.onEnterFrame = function () {
this._y += 3;
if (this._y > 2400) {
this._y = 0;
}
};
ASSetPropFlags(_global.Background.prototype, null, 1);
}
#endinitclip
}
movieClip 150 __Packages.Missile {
#initclip
if (!_global.Missile) {
var v1 = function () {
super();
};
_global.Missile = v1;
_global.Missile extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this.speed = 20;
};
v2.onEnterFrame = function () {
this._y -= this.speed;
for (var v3 in _root.ship.enemies) {
if (this.hitTest(_root.ship.enemies[v3])) {
this.removeMovieClip();
_root.ship.enemies[v3].takeDamage();
}
}
if (this._y < 0) {
this.removeMovieClip();
}
};
ASSetPropFlags(_global.Missile.prototype, null, 1);
}
#endinitclip
}