Combined Code
movieClip 2 EnemyMissile {
#initclip
Object.registerClass('EnemyMissile', EnemyMissile);
#endinitclip
}
movieClip 4 Missile {
#initclip
Object.registerClass('Missile', Missile);
#endinitclip
}
movieClip 6 Enemy_RedFish {
#initclip
Object.registerClass('Enemy_RedFish', Enemy_RedFish);
#endinitclip
}
movieClip 13 Explosion {
#initclip
Object.registerClass('Explosion', Explosion);
#endinitclip
}
movieClip 15 Fish {
#initclip
Object.registerClass('Fish', Fish);
#endinitclip
}
movieClip 17 Background_Addon {
#initclip
Object.registerClass('Background_Addon', Background);
#endinitclip
}
movieClip 19 Background {
#initclip
Object.registerClass('Background', Background);
#endinitclip
}
// unknown tag 88 length 219
movieClip 24 {
}
movieClip 26 {
}
// unknown tag 88 length 112
// unknown tag 88 length 122
movieClip 34 {
}
movieClip 35 {
}
movieClip 36 __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._x += this.speed;
if (this._x > 600) {
this.removeMovieClip();
}
for (var v3 in _root.fish.enemies) {
if (this.hitTest(_root.fish.enemies[v3])) {
this.removeMovieClip();
_root.fish.enemies[v3].explode();
}
}
};
ASSetPropFlags(_global.Missile.prototype, null, 1);
}
#endinitclip
}
movieClip 37 __Packages.Enemy_RedFish {
#initclip
if (!_global.Enemy_RedFish) {
var v1 = function () {
super();
};
_global.Enemy_RedFish = v1;
_global.Enemy_RedFish extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this._x = 700;
this._y = Math.random() * 200 + 50;
this.speed = Math.random() * 5 + 5;
this.shootTimer = 0;
};
v2.onEnterFrame = function () {
this._x -= this.speed;
if (this._x < -100) {
this.removeMovieClip();
}
if (this.hitTest(_root.fish)) {
_root.fish.updateHealth(-20);
this.explode();
}
this.shootTimer += 1;
if (this.shootTimer > 30) {
this.shootTimer = 0;
var v3 = _root.attachMovie('EnemyMissile', 'EnemyMissile' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x - 60;
v3._y = this._y + 2;
}
};
v2.explode = function () {
var v3 = _root.attachMovie('Explosion', 'Explosion' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x;
v3._y = this._y;
this.removeMovieClip();
_root.fish.updateScore(50);
};
ASSetPropFlags(_global.Enemy_RedFish.prototype, null, 1);
}
#endinitclip
}
movieClip 38 __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 39 __Packages.Fish {
#initclip
if (!_global.Fish) {
var v1 = function () {
super();
};
_global.Fish = v1;
_global.Fish extends MovieClip;
var v2 = v1.prototype;
v2.onLoad = function () {
this.enemies = [];
this.velocity = 10;
this.shootLimiter = 0;
this.enemyTimer = 0;
this.resetScore();
this.resetHealth();
_root.gameOverMenu._visible = false;
_root.gameOverMenu.playAgainButton.onPress = function () {
_root.fish.newGame();
};
};
v2.onEnterFrame = function () {
if (this._visible == true) {
this.shootLimiter += 1;
if (Key.isDown(39) && this._x < 550 - this.velocity) {
this._x += this.velocity;
}
if (Key.isDown(37) && this._x > 50 + this.velocity) {
this._x -= this.velocity;
}
if (Key.isDown(38) && this._y > 50 + this.velocity) {
this._y -= this.velocity;
}
if (Key.isDown(40) && this._y < 250 - this.velocity) {
this._y += this.velocity;
}
if (Key.isDown(32) && this.shootLimiter > 8) {
this.shootLimiter = 0;
var v3 = _root.attachMovie('Missile', 'Missile' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v3._x = this._x + 63;
v3._y = this._y + 4;
}
this.enemyTimer += 1;
if (this.enemyTimer > 60) {
this.enemyTimer = 0;
var v4 = _root.attachMovie('Enemy_RedFish', 'Enemy_RedFish' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
this.enemies.push(v4);
}
}
};
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 v4 = _root.attachMovie('Explosion', 'Explosion' + _root.getNextHighestDepth(), _root.getNextHighestDepth());
v4._x = this._x;
v4._y = this._y;
for (var v3 in this.enemies) {
this.enemies[v3].explode();
}
};
v2.newGame = function () {
this._visible = true;
_root.gameOverMenu._visible = false;
this._x = 300;
this._y = 150;
this.resetHealth();
this.resetScore();
};
ASSetPropFlags(_global.Fish.prototype, null, 1);
}
#endinitclip
}
movieClip 40 __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._x -= 1;
if (this._x < -600) {
this._x = 600;
}
};
ASSetPropFlags(_global.Background.prototype, null, 1);
}
#endinitclip
}
movieClip 41 __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 = -20;
};
v2.onEnterFrame = function () {
this._x += this.speed;
if (this.hitTest(_root.fish)) {
_root.fish.updateHealth(-10);
this.removeMovieClip();
}
if (this._x < 0) {
this.removeMovieClip();
}
};
ASSetPropFlags(_global.EnemyMissile.prototype, null, 1);
}
#endinitclip
}