Frame 1
_quality = "medium";
men = new ContextMenu();
hi = new ContextMenuItem("Quality: High", function () {
_quality = "HIGH";
});
med = new ContextMenuItem("Quality: Medium", function () {
_quality = "MEDIUM";
});
lo = new ContextMenuItem("Quality: Low", function () {
_quality = "LOW";
});
sfb = new ContextMenuItem("SuperFlashBros.net", function () {
getURL ("http://www.superflashbros.net", "_blank");
}, true);
agms = new ContextMenuItem("ArmorGames.com", function () {
getURL ("http://www.armorgames.com", "_blank");
});
agm = new ContextMenuItem("Play More Games!", function () {
getURL ("http://www.armorgames.com", "_blank");
});
men.hideBuiltInItems();
men.customItems.push(hi);
men.customItems.push(med);
men.customItems.push(lo);
men.customItems.push(sfb);
men.customItems.push(agms);
men.customItems.push(agm);
_root.menu = men;
_root.tabEnabled = false;
Instance of Symbol 117 MovieClip in Frame 1
onClipEvent (enterFrame) {
var num = (1 + Math.floor((32 * _root.getBytesLoaded()) / _root.getBytesTotal()));
this.gotoAndStop(num);
if (num == 33) {
_root.gotoAndStop("menu");
}
}
Frame 2
gotoAndPlay (1);
Frame 3
_root.level = 1;
stopAllSounds();
stop();
Instance of Symbol 129 MovieClip in Frame 3
onClipEvent (load) {
this.onRelease = function () {
getURL ("http://www.armorgames.com/", "_blank");
};
}
Instance of Symbol 156 MovieClip in Frame 3
onClipEvent (load) {
saved = SharedObject.getLocal("DefendAtlantis");
if (!saved.data.unlocked) {
this._alpha = 50;
this.enabled = false;
}
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onPress = function () {
this.gotoAndStop(3);
};
this.onRelease = function () {
_root.free = true;
_root.level = 6;
_root.gotoAndStop("game");
};
}
Frame 4
_quality = "medium";
Frame 328
_root.hud.setBubbleType("normal");
_quality = "medium";
_root.level = 1;
_root.free = false;
stop();
Instance of Symbol 297 MovieClip in Frame 328
onClipEvent (load) {
this.onRelease = function () {
_root.gotoAndStop("menu");
};
}
Frame 331
_root.hud.setBubbleType("normal");
stop();
Instance of Symbol 396 MovieClip "enemies" in Frame 331
onClipEvent (load) {
spawn_count = 0;
enemy_count = 0;
if (_root.level == 1) {
enemy_range = 3.99;
} else if ((_root.level == 2) || (_root.level == 3)) {
enemy_range = 5.99;
} else {
enemy_range = 7.99;
}
enemy_types = ["Enemy Diver Green", "Enemy Diver Red", "Enemy Barrel Green", "Enemy Barrel Red", "Enemy Mine Green", "Enemy Mine Red", "Enemy Sub Green", "Enemy Sub Red"];
}
onClipEvent (enterFrame) {
spawn_count++;
if (((_root.level != 1) && (spawn_count > 50)) || (spawn_count > 70)) {
spawn_count = 0;
var pick = enemy_types[Math.floor(Math.random() * enemy_range)];
var enemy = this.attachMovie(pick, "enemy" + (enemy_count++), enemy_count);
enemy._x = 125 + (Math.random() * 300);
enemy._y = 30;
}
}
Instance of Symbol 297 MovieClip in Frame 331
onClipEvent (load) {
this.onRelease = function () {
stopAllSounds();
_root.gotoAndStop("menu");
};
}
Instance of Symbol 401 MovieClip "hb" in Frame 331
onClipEvent (load) {
health = 100;
this.hurt = function (p_ammount) {
_root.crack.play();
_root.city.play();
this.health = this.health - p_ammount;
if (this.health <= 0) {
stopAllSounds();
_root.gotoAndPlay("over");
} else {
this.bar.barc._xscale = this.health;
}
};
}
Instance of Symbol 407 MovieClip "timer" in Frame 331
onClipEvent (load) {
if (!_root.free) {
start_time = getTimer();
min = 0;
min_up = false;
ended = false;
this.onEnterFrame = function () {
now = getTimer();
time = 120000 - (now - start_time);
secs = Math.round(time / 1000);
if (secs < 60) {
min = 0;
}
if ((secs == 0) && (min == 0)) {
}
if (secs > 59) {
min = 1;
secs = secs - 60;
}
if (secs > 59) {
min = 2;
secs = secs - 60;
}
if ((secs == 0) && (min == 0)) {
stopAllSounds();
if (_root.level != 6) {
_root.gotoAndStop("message");
} else {
saved = SharedObject.getLocal("DefendAtlantis");
saved.data.unlocked = true;
saved.flush();
_root.gotoAndPlay("end");
}
ended = true;
_visible = false;
}
if (secs < 10) {
secs = "0" + secs;
}
display = (min + ":") + secs;
if (!ended) {
this.txt.text = display;
}
};
} else {
_visible = false;
}
}
Frame 332
_root.hud.setBubbleType("normal");
stop();
Instance of Symbol 297 MovieClip in Frame 332
onClipEvent (load) {
this.onRelease = function () {
_root.gotoAndStop("menu");
};
}
Instance of Symbol 417 MovieClip in Frame 332
onClipEvent (load) {
_root.level++;
this.gotoAndStop(_root.level - 1);
}
Instance of Symbol 424 MovieClip in Frame 333
onClipEvent (load) {
this.gotoAndStop(_root.level - 1);
}
Instance of Symbol 424 MovieClip in Frame 334
onClipEvent (load) {
this.gotoAndStop(_root.level - 1);
}
Frame 347
stop();
Instance of Symbol 441 MovieClip in Frame 347
onClipEvent (load) {
this.onRelease = function () {
stopAllSounds();
_root.gotoAndStop("game");
};
}
Instance of Symbol 269 MovieClip in Frame 347
onClipEvent (load) {
var i = 7;
while (i > _root.level) {
this["s" + i]._visible = false;
i--;
}
}
Instance of Symbol 273 MovieClip in Frame 347
onClipEvent (load) {
this.onRollOver = function () {
_root.descr.gotoAndStop(1);
};
this.onRollOut = function () {
_root.descr.gotoAndStop(8);
};
}
Instance of Symbol 273 MovieClip in Frame 347
onClipEvent (load) {
if (_root.level > 1) {
} else {
_alpha = 20;
}
this.onRollOver = function () {
_root.descr.gotoAndStop(2);
};
this.onRollOut = function () {
_root.descr.gotoAndStop(8);
};
}
Instance of Symbol 273 MovieClip in Frame 347
onClipEvent (load) {
if (_root.level > 2) {
} else {
_alpha = 20;
}
this.onRollOver = function () {
_root.descr.gotoAndStop(3);
};
this.onRollOut = function () {
_root.descr.gotoAndStop(8);
};
}
Instance of Symbol 273 MovieClip in Frame 347
onClipEvent (load) {
if (_root.level > 4) {
} else {
_alpha = 20;
}
this.onRollOver = function () {
_root.descr.gotoAndStop(5);
};
this.onRollOut = function () {
_root.descr.gotoAndStop(8);
};
}
Instance of Symbol 273 MovieClip in Frame 347
onClipEvent (load) {
if (_root.level > 3) {
} else {
_alpha = 20;
}
this.onRollOver = function () {
_root.descr.gotoAndStop(4);
};
this.onRollOut = function () {
_root.descr.gotoAndStop(8);
};
}
Instance of Symbol 273 MovieClip in Frame 347
onClipEvent (load) {
if (_root.level > 5) {
} else {
_alpha = 20;
}
this.onRollOver = function () {
_root.descr.gotoAndStop(6);
};
this.onRollOut = function () {
_root.descr.gotoAndStop(8);
};
}
Instance of Symbol 424 MovieClip in Frame 347
onClipEvent (load) {
this.gotoAndStop(_root.level - 1);
}
Instance of Symbol 448 MovieClip in Frame 347
onClipEvent (load) {
this.gotoAndStop(_root.level);
}
onClipEvent (enterFrame) {
this.gotoAndStop(_root.level);
}
Frame 348
stop();
Instance of Symbol 441 MovieClip in Frame 348
onClipEvent (load) {
this.onRelease = function () {
stopAllSounds();
_root.gotoAndStop("game");
};
}
Instance of Symbol 476 MovieClip in Frame 348
onClipEvent (load) {
this.onRelease = function () {
stopAllSounds();
_root.gotoAndStop("menu");
};
}
Instance of Symbol 521 MovieClip in Frame 462
onClipEvent (load) {
this.onRelease = function () {
_root.free = true;
_root.level = 6;
_root.gotoAndStop("game");
};
}
Instance of Symbol 524 MovieClip in Frame 471
onClipEvent (load) {
this.onRelease = function () {
_root.gotoAndStop("introm");
};
}
Instance of Symbol 527 MovieClip in Frame 475
onClipEvent (load) {
this.onRelease = function () {
_root.gotoAndStop("menu");
};
}
Instance of Symbol 530 MovieClip in Frame 480
onClipEvent (load) {
this.onRelease = function () {
getURL ("http://www.armorgames.com", "_blank");
};
}
Frame 611
stop();
Symbol 22 MovieClip [Enemy Sub Green] Frame 1
#initclip 23
Object.registerClass("Enemy Sub Green", Sub);
#endinitclip
stop();
Symbol 37 MovieClip [Explosion] Frame 1
#initclip 13
Object.registerClass("Explosion", Explosion);
#endinitclip
Symbol 37 MovieClip [Explosion] Frame 11
this.removeMovieClip();
Symbol 38 MovieClip [Enemy Barrel Red] Frame 1
#initclip 14
Object.registerClass("Enemy Barrel Red", Barrel);
#endinitclip
stop();
Symbol 43 MovieClip [Enemy Mine Green] Frame 1
#initclip 15
Object.registerClass("Enemy Mine Green", Mine);
#endinitclip
stop();
Symbol 48 MovieClip [Enemy Mine Red] Frame 1
#initclip 16
Object.registerClass("Enemy Mine Red", Mine);
#endinitclip
stop();
Symbol 53 MovieClip [Enemy Sub Red] Frame 1
#initclip 17
Object.registerClass("Enemy Sub Red", Sub);
#endinitclip
stop();
Symbol 55 MovieClip [Enemy Barrel Green] Frame 1
#initclip 18
Object.registerClass("Enemy Barrel Green", Barrel);
#endinitclip
stop();
Symbol 75 MovieClip [Enemy Diver Red] Frame 1
#initclip 19
Object.registerClass("Enemy Diver Red", Diver);
#endinitclip
stop();
Symbol 89 MovieClip [Enemy Diver Green] Frame 1
#initclip 20
Object.registerClass("Enemy Diver Green", Diver);
#endinitclip
stop();
Symbol 99 MovieClip Frame 51
_parent._parent.pop();
Symbol 102 MovieClip Frame 1
if (((_parent._parent.radius = _parent._parent.radius - 1)) < 15) {
_parent._parent.pop();
} else if (_parent._parent.radius < 25) {
var killed = false;
for (var i in _parent._parent.contents) {
if (_parent._parent.contents[i] instanceof Diver) {
_parent._parent.contents[i].removeMovieClip();
killed = true;
}
}
if (killed) {
this.gotoAndPlay(3);
}
}
Symbol 102 MovieClip Frame 2
this.gotoAndPlay(1);
Symbol 102 MovieClip Frame 3
if (((_parent._parent.radius = _parent._parent.radius - 1)) < 15) {
_parent._parent.pop();
}
Symbol 102 MovieClip Frame 4
this.gotoAndPlay(3);
Symbol 105 MovieClip Frame 1
stop();
Symbol 108 MovieClip [Bubble Clip] Frame 1
#initclip 21
Object.registerClass("Bubble Clip", Bubble);
#endinitclip
stop();
Symbol 108 MovieClip [Bubble Clip] Frame 4
this.removeMovieClip();
Symbol 112 MovieClip [Shockwave] Frame 1
#initclip 22
Object.registerClass("Shockwave", Shockwave);
#endinitclip
Symbol 112 MovieClip [Shockwave] Frame 11
this.removeMovieClip();
Symbol 117 MovieClip Frame 1
stop();
Symbol 531 MovieClip [__Packages.Enemy] Frame 0
class Enemy extends MovieClip
{
var onEnterFrame, _height, _width, _x, _y, hitTest, removeMovieClip, _alpha;
function Enemy () {
super();
onEnterFrame = actInWater;
rect_angle = Math.atan(_width / _height);
init_height = _height / 2;
}
function contain(p_container) {
contained = true;
container = p_container;
onEnterFrame = actInBubble;
}
function unContain() {
contained = false;
container = null;
onEnterFrame = actInWater;
for (var _local6 in _root.bubbles) {
if (_root.bubbles[_local6]._currentframe == 1) {
var _local3 = _root.bubbles[_local6].angleTo(this);
var _local5 = init_height * (-Math.sin(_local3));
var _local4 = init_height * Math.cos(_local3);
if (_root.bubbles[_local6].hitTest(_x + _local5, _y + _local4, this)) {
contain(_root.bubbles[_local6]);
_root.bubbles[_local6].contents.push(this);
break;
}
}
}
}
function bottomOfBubble() {
var _local4 = container.angleTo(this);
var _local6 = init_height * Math.sin(_local4);
var _local5 = init_height * (-Math.cos(_local4));
if (!container.hitTest(_x + _local6, _y + _local5, true)) {
container.hitInside(this);
}
for (var _local3 in container.contents) {
if ((this != container.contents[_local3]) && (hitTest(container.contents[_local3]))) {
interact(container.contents[_local3], true);
}
}
for (var _local3 in _root.explosions) {
if (_root.explosions[_local3].hitTest(_x, _y, true)) {
interact(_root.explosions[_local3], false);
}
}
}
function checkWater() {
if ((++check_count) >= 3) {
check_count = 0;
for (var _local6 in _root.enemies) {
if ((this != _root.enemies[_local6]) && (hitTest(_root.enemies[_local6]))) {
interact(_root.enemies[_local6], true);
}
}
for (var _local6 in _root.bubbles) {
if (_root.bubbles[_local6].hitTest(this)) {
var _local3 = _root.bubbles[_local6].angleTo(this);
var _local5 = init_height * (-Math.sin(_local3));
var _local4 = init_height * Math.cos(_local3);
if (_root.bubbles[_local6].hitTest(_x + _local5, _y + _local4, this)) {
_root.bubbles[_local6].hitOutside(this);
}
}
}
for (var _local6 in _root.explosions) {
if (_root.explosions[_local6].hitTest(_x, _y, true)) {
interact(_root.explosions[_local6], false);
}
}
}
}
function moveAbout() {
if (speed_x > 3) {
speed_x = 3;
} else if (speed_x < -3) {
speed_x = -3;
}
_x = _x + speed_x;
_y = _y + speed_y;
if (((_x < -50) || (_x > 600)) || (_y > 450)) {
removeMovieClip();
}
checkCity();
}
function distanceTo(p_clip) {
var _local2 = p_clip._x - _x;
var _local3 = _y - p_clip._y;
var _local4 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
return(_local4);
}
function checkCity() {
if (_root.city.hitTest(_x, _y, true)) {
_root.hb.hurt(20);
onEnterFrame = damageCity;
}
}
function damageCity() {
_alpha = _alpha - 30;
if (_alpha <= 0) {
removeMovieClip();
}
}
function interact(p_with, p_back) {
}
function actInBubble() {
}
function actInWater() {
}
function poison() {
}
function getBlasted() {
}
var rect_angle = 0;
var init_height = 0;
var contained = false;
var container = null;
var speed_x = 0;
var speed_y = 0;
var spikey = false;
var check_count = 0;
}
Symbol 532 MovieClip [__Packages.Bubble] Frame 0
class Bubble extends MovieClip
{
var contents, onEnterFrame, onRelease, _height, _width, radius, _x, _y, hitTest, gotoAndStop, removeMovieClip, type_clip, _currentframe, gotoAndPlay;
function Bubble () {
super();
contents = new Xrray();
onEnterFrame = act;
onRelease = pop;
}
function initBubble(p_drawn_line) {
setType(_root.bubble_type);
if (explosive || (shockwave)) {
_root.hud.useBubbleMixture(10);
}
_height = p_drawn_line._height;
_width = p_drawn_line._width;
radius = (_height + _width) / 2;
var _local4 = p_drawn_line.getBounds(_root);
_x = _local4.xMax - (p_drawn_line._width / 2);
_y = _local4.yMax - (p_drawn_line._height / 2);
checkInBubble();
}
function checkInBubble() {
for (var _local3 in _root.enemies) {
if ((!_root.enemies[_local3].contained) && (hitTest(_root.enemies[_local3]._x, _root.enemies[_local3]._y, true))) {
_root.enemies[_local3].contain(this);
contents.push(_root.enemies[_local3]);
}
}
}
function angleTo(p_clip) {
var _local3 = p_clip._x - _x;
var _local4 = _y - p_clip._y;
var _local2 = Math.atan2(_local3, _local4);
return(_local2);
}
function float() {
if (speed_y > -1.5) {
speed_y = speed_y - 0.03;
} else {
speed_y = -1.5;
}
_y = _y + speed_y;
if (_y < 0) {
gotoAndStop(2);
for (var _local2 in contents) {
contents[_local2].unContain();
}
removeMovieClip();
}
}
function wobble() {
speed_width = speed_width - ((_width - radius) / 5);
speed_height = speed_height - ((_height - radius) / 5);
_width = _width + (speed_width - ((_width - radius) / 15));
_height = _height + (speed_height - ((_height - radius) / 15));
}
function hitInside(p_hitter) {
if ((metal || (!p_hitter.spikey)) && (onEnterFrame != blast)) {
p_hitter.speed_x = 0;
p_hitter.speed_y = 0;
var _local7 = angleTo(p_hitter);
var _local3 = Math.sin(_local7);
var _local4 = Math.cos(_local7);
var _local6 = p_hitter.init_height * _local3;
var _local5 = p_hitter.init_height * (-_local4);
while (!hitTest(p_hitter._x + _local6, p_hitter._y + _local5, true)) {
p_hitter._x = p_hitter._x - (_local3 * 4);
p_hitter._y = p_hitter._y + (_local4 * 4);
p_hitter.speed_x = p_hitter.speed_x + ((-_local3) * 2);
p_hitter.speed_y = p_hitter.speed_y + (_local4 * 2);
}
p_hitter._rotation = 180 + ((180 * _local7) / Math.PI);
} else {
pop();
}
}
function hitOutside(p_hitter) {
if ((metal || (!p_hitter.spikey)) && (onEnterFrame != blast)) {
p_hitter.speed_x = 0;
p_hitter.speed_y = 0;
var _local7 = angleTo(p_hitter);
var _local3 = Math.sin(_local7);
var _local4 = Math.cos(_local7);
var _local6 = p_hitter.init_height * (-_local3);
var _local5 = p_hitter.init_height * _local4;
while (hitTest(p_hitter._x + _local6, p_hitter._y + _local5, true)) {
p_hitter._x = p_hitter._x + (_local3 * 4);
p_hitter._y = p_hitter._y - (_local4 * 4);
p_hitter.speed_x = p_hitter.speed_x + (_local3 * 2);
p_hitter.speed_y = p_hitter.speed_y + ((-_local4) * 2);
}
p_hitter._rotation = (180 * _local7) / Math.PI;
} else {
pop();
}
}
function setType(p_type) {
this[p_type] = true;
type_clip.gotoAndStop(type_list[p_type]);
}
function pop() {
if (_currentframe == 1) {
gotoAndPlay(2);
if (explosive) {
for (var _local3 in contents) {
if (contents[_local3] instanceof Sub) {
contents[_local3].unContain();
} else if (contents[_local3] instanceof Diver) {
contents[_local3].removeMovieClip();
} else {
contents[_local3].explode();
}
}
_root.explosions.attachMovie("Explosion", "Explosion" + _root.explosions.getNextHighestDepth(), _root.explosions.getNextHighestDepth()).setExplosion(this);
removeMovieClip();
} else if (shockwave) {
for (var _local3 in contents) {
contents[_local3].unContain();
}
_root.explosions.attachMovie("Shockwave", "Shockwave" + _root.explosions.getNextHighestDepth(), _root.explosions.getNextHighestDepth()).setShockwave(this);
removeMovieClip();
} else {
_root.hud.regainMixture(12);
for (var _local3 in contents) {
contents[_local3].unContain();
}
}
return(true);
}
return(false);
}
function act() {
wobble();
float();
}
function blast() {
_width = radius;
_height = radius;
for (var _local3 in _root.bubbles) {
if (hitTest(_root.bubbles[_local3])) {
_root.bubbles[_local3].pop();
}
}
for (var _local3 in _root.enemies) {
if (hitTest(_root.enemies[_local3]._x, _root.enemies[_local3]._y, true)) {
_root.enemies[_local3].interact(new Mine());
}
}
}
var speed_width = 0;
var speed_height = 0;
var speed_y = 0;
var normal = false;
var metal = false;
var shrinking = false;
var poison = false;
var shockwave = false;
var explosive = false;
var type_list = {normal:1, metal:2, poison:3, explosive:4, shrinking:5, shockwave:6};
}
Symbol 533 MovieClip [__Packages.Xrray] Frame 0
class Xrray extends Array
{
var length;
function Xrray () {
super();
}
function addAfter(p_to_add, p_after) {
var _local3 = new Xrray();
var _local4 = new Xrray();
var _local2 = 0;
while (this[_local2] != p_after) {
_local3.push(this[_local2]);
_local2++;
if (_local2 >= length) {
return(false);
}
}
while (_local2 < length) {
_local4.push(this[_local2]);
_local2++;
}
_local3.push(p_to_add);
_local3.concat(_local4);
this=_local3;//parameter overwritten
return(true);
}
function addBefore(p_to_add, p_before) {
var _local3 = new Xrray();
var _local4 = new Xrray();
var _local2 = 0;
while (this[_local2] != p_before) {
_local3.push(this[_local2]);
_local2++;
if (_local2 >= length) {
return(false);
}
}
_local3.pop();
_local2--;
while (_local2 < length) {
_local4.push(this[_local2]);
_local2++;
}
_local3.push(p_to_add);
_local3.concat(_local4);
this=_local3;//parameter overwritten
return(true);
}
function remove(p_element) {
var _local3 = new Xrray();
var _local4 = new Xrray();
var _local2 = 0;
while (this[_local2] != p_element) {
_local3.push(this[_local2]);
_local2++;
if (_local2 >= length) {
return(false);
}
}
_local3.pop();
while (_local2 < length) {
_local4.push(this[_local2]);
_local2++;
}
_local3.concat(_local4);
this=_local3;//parameter overwritten
return(true);
}
function moveInto(p_element, p_xrray) {
if (remove(p_element)) {
p_xrray.push(p_element);
return(true);
}
return(false);
}
function hasElement(p_element) {
for (var _local2 in this) {
if (this[_local2] == p_element) {
return(true);
}
}
return(false);
}
function hasSameElement(p_element, p_xrray) {
return(hasElement(p_element) && (p_xrray.hasElement(p_element)));
}
}
Symbol 534 MovieClip [__Packages.Sub] Frame 0
class Sub extends Enemy
{
var spikey, container, gotoAndStop, speed_y, moveAbout, bottomOfBubble, _rotation, checkWater, _x, _xscale, speed_x, _alpha, removeMovieClip;
function Sub () {
super();
spikey = true;
}
function actInBubble() {
if (container.poison) {
gotoAndStop(3);
poison();
} else {
gotoAndStop(2);
}
if (speed_y < 3) {
speed_y = speed_y + 0.15;
if (speed_y < -3) {
speed_y = -3;
}
} else {
speed_y = 3;
}
moveAbout();
bottomOfBubble();
}
function actInWater() {
_rotation = 0;
gotoAndStop(1);
if (speed_y < 1) {
speed_y = speed_y + 0.06;
if (speed_y < -1) {
speed_y = -1;
}
} else {
speed_y = 1;
}
swim();
moveAbout();
checkWater();
_rotation = 0;
}
function swim() {
if (_x > 275) {
_xscale = -100;
} else {
_xscale = 100;
}
speed_x = speed_x - ((_x - 275) / 4000);
for (var _local3 in _root.enemies) {
if (_root.enemies[_local3] instanceof Mine) {
speed_x = speed_x + ((((_x - _root.enemies[_local3]._x) * (_x - _root.enemies[_local3]._x)) * (_x - _root.enemies[_local3]._x)) / 85000000000);
} else if (_root.enemies[_local3] instanceof Barrel) {
speed_x = speed_x + ((((_x - _root.enemies[_local3]._x) * (_x - _root.enemies[_local3]._x)) * (_x - _root.enemies[_local3]._x)) / 85000000000);
} else if (_root.enemies[_local3] instanceof Sub) {
speed_x = speed_x + ((((_x - _root.enemies[_local3]._x) * (_x - _root.enemies[_local3]._x)) * (_x - _root.enemies[_local3]._x)) / 85000000000);
}
}
}
function poison() {
health = health - 2;
if (health <= 0) {
gotoAndStop(4);
_alpha = _alpha - 5;
if (_alpha <= 0) {
container.contents.remove(this);
removeMovieClip();
}
}
}
function interact(p_with, p_back) {
if (p_with instanceof Explosion) {
explode();
} else if (p_with instanceof Shockwave) {
p_with.pushAway(this);
} else if (((p_with instanceof Sub) || (p_with instanceof Mine)) || (p_with instanceof Barrel)) {
if (p_back) {
p_with.interact(this, false);
}
explode();
}
}
function explode() {
_root.explosions.attachMovie("Explosion", "Explosion" + _root.explosions.getNextHighestDepth(), _root.explosions.getNextHighestDepth()).setExplosion(this);
removeMovieClip();
}
var health = 100;
}
Symbol 535 MovieClip [__Packages.Mine] Frame 0
class Mine extends Enemy
{
var spikey, speed_y, moveAbout, bottomOfBubble, checkWater, removeMovieClip;
function Mine () {
super();
spikey = true;
}
function actInBubble() {
if (speed_y < 3) {
speed_y = speed_y + 0.15;
if (speed_y < -3) {
speed_y = -3;
}
} else {
speed_y = 3;
}
moveAbout();
bottomOfBubble();
}
function actInWater() {
if (speed_y < 1.5) {
speed_y = speed_y + 0.05;
if (speed_y < -1.5) {
speed_y = -1.5;
}
} else {
speed_y = 1.5;
}
moveAbout();
checkWater();
}
function interact(p_with, p_back) {
if (p_with instanceof Shockwave) {
p_with.pushAway(this);
} else {
if (p_back) {
p_with.interact(this, false);
}
explode();
}
}
function explode() {
_root.explosions.attachMovie("Explosion", "Explosion" + _root.explosions.getNextHighestDepth(), _root.explosions.getNextHighestDepth()).setExplosion(this);
removeMovieClip();
}
}
Symbol 536 MovieClip [__Packages.Shockwave] Frame 0
class Shockwave extends MovieClip
{
var onEnterFrame, _x, _y, hitTest;
function Shockwave () {
super();
onEnterFrame = blast;
}
function setShockwave(p_source) {
_x = p_source._x;
_y = p_source._y;
}
function blast() {
for (var _local3 in _root.bubbles) {
if ((!_root.bubbles[_local3].metal) && (hitTest(_root.bubbles[_local3]))) {
_root.bubbles[_local3].pop();
}
}
}
function pushAway(p_hitter) {
p_hitter.speed_x = 0;
p_hitter.speed_y = 0;
var _local7 = angleTo(p_hitter);
var _local3 = Math.sin(_local7);
var _local4 = Math.cos(_local7);
var _local6 = p_hitter.init_height * (-_local3);
var _local5 = p_hitter.init_height * _local4;
while (hitTest(p_hitter._x + _local6, p_hitter._y + _local5, true)) {
p_hitter._x = p_hitter._x + (_local3 * 4);
p_hitter._y = p_hitter._y - (_local4 * 4);
p_hitter.speed_x = p_hitter.speed_x + (_local3 * 2);
p_hitter.speed_y = p_hitter.speed_y + ((-_local4) * 2);
}
p_hitter._rotation = (180 * _local7) / Math.PI;
}
function angleTo(p_clip) {
var _local3 = p_clip._x - _x;
var _local4 = _y - p_clip._y;
var _local2 = Math.atan2(_local3, _local4);
return(_local2);
}
}
Symbol 537 MovieClip [__Packages.Barrel] Frame 0
class Barrel extends Enemy
{
var speed_y, moveAbout, bottomOfBubble, checkWater, removeMovieClip;
function Barrel () {
super();
}
function actInBubble() {
if (speed_y < 3) {
speed_y = speed_y + 0.15;
if (speed_y < -3) {
speed_y = -3;
}
} else {
speed_y = 3;
}
moveAbout();
bottomOfBubble();
}
function actInWater() {
if (speed_y < 1.4) {
speed_y = speed_y + 0.05;
if (speed_y < -1.4) {
speed_y = -1.4;
}
} else {
speed_y = 1.4;
}
moveAbout();
checkWater();
}
function interact(p_with, p_back) {
if (p_with instanceof Shockwave) {
p_with.pushAway(this);
} else if (!(p_with instanceof Diver)) {
if (p_back) {
p_with.interact(this, false);
}
explode();
}
}
function explode() {
_root.explosions.attachMovie("Explosion", "Explosion" + _root.explosions.getNextHighestDepth(), _root.explosions.getNextHighestDepth()).setExplosion(this);
removeMovieClip();
}
}
Symbol 538 MovieClip [__Packages.Explosion] Frame 0
class Explosion extends MovieClip
{
var onEnterFrame, _x, _y, hitTest;
function Explosion () {
super();
onEnterFrame = blast;
}
function setExplosion(p_source) {
_x = p_source._x;
_y = p_source._y;
}
function blast() {
for (var _local3 in _root.bubbles) {
if ((!_root.bubbles[_local3].metal) && (hitTest(_root.bubbles[_local3]))) {
_root.bubbles[_local3].pop();
}
}
}
}
Symbol 539 MovieClip [__Packages.Diver] Frame 0
class Diver extends Enemy
{
var container, gotoAndStop, speed_y, moveAbout, bottomOfBubble, _rotation, checkWater, _x, _xscale, speed_x, _alpha, removeMovieClip;
function Diver () {
super();
}
function actInBubble() {
if (container.poison) {
gotoAndStop(3);
poison();
} else {
gotoAndStop(2);
}
if (speed_y < 3) {
speed_y = speed_y + 0.15;
if (speed_y < -3) {
speed_y = -3;
}
} else {
speed_y = 3;
}
moveAbout();
bottomOfBubble();
if (health <= 0) {
die();
}
}
function actInWater() {
_rotation = 0;
gotoAndStop(1);
if (speed_y < 0.9) {
speed_y = speed_y + 0.04;
if (speed_y < -0.9) {
speed_y = -0.9;
}
} else {
speed_y = 0.9;
}
swim();
moveAbout();
checkWater();
_rotation = 0;
if (health <= 0) {
die();
}
}
function swim() {
if (_x > 275) {
_xscale = -100;
} else {
_xscale = 100;
}
speed_x = speed_x - ((_x - 275) / 5000);
for (var _local3 in _root.enemies) {
if (_root.enemies[_local3] instanceof Mine) {
speed_x = speed_x + ((((_x - _root.enemies[_local3]._x) * (_x - _root.enemies[_local3]._x)) * (_x - _root.enemies[_local3]._x)) / 125000000000);
}
}
}
function poison() {
health = health - 2;
}
function die() {
gotoAndStop(4);
_alpha = _alpha - 5;
if (_alpha <= 0) {
container.contents.remove(this);
removeMovieClip();
}
}
function interact(p_with, p_back) {
if (p_with instanceof Explosion) {
removeMovieClip();
} else if (p_with instanceof Shockwave) {
p_with.pushAway(this);
} else if (p_with instanceof Mine) {
if (p_back) {
p_with.interact(this, false);
}
removeMovieClip();
}
}
var health = 100;
}
Symbol 540 MovieClip [__Packages.BubbleDrawer] Frame 0
class BubbleDrawer extends MovieClip
{
var target_clip, targ, line_drawer, createEmptyMovieClip, getNextHighestDepth, onEnterFrame, onMouseDown, onMouseUp, _y, _x, _alpha;
function BubbleDrawer () {
super();
target_clip = targ;
line_drawer = createEmptyMovieClip("line_drawer", getNextHighestDepth());
onEnterFrame = drawBubbles;
onMouseDown = function () {
this.mouse_down = true;
};
onMouseUp = function () {
this.mouse_down = false;
};
}
function drawBubbles() {
max_distance = 200 + (40 * _root.level);
if (!mouse_down) {
distance = 0;
too_long = false;
last_x = 0;
last_y = 0;
target_clip._visible = false;
followMouse();
clearLine();
bubble_drawn = false;
outside_limit = false;
} else if (mouse_down && (_y > 50)) {
drawLine();
}
}
function drawLine() {
if ((!bubble_drawn) && (!too_long)) {
_root.gun.beam._visible = true;
line_drawer.lineStyle(0.5, 16777215, 100);
line_drawer.lineTo(_root._xmouse - _x, _root._ymouse - _y);
if (!outside_limit) {
target_clip._visible = true;
if (!target_clip.hitTest(_root._xmouse, _root._ymouse, true)) {
outside_limit = true;
}
} else if (outside_limit) {
if (target_clip.hitTest(_root._xmouse, _root._ymouse, true)) {
target_clip._visible = false;
outside_limit = false;
bubble_drawn = true;
if (_root.hud.useBubbleMixture(15)) {
makeBubble();
}
clearLine();
}
}
var _local4 = (_root._xmouse - _x) - last_x;
var _local3 = (_root._ymouse - _y) - last_y;
last_x = _root._xmouse - _x;
last_y = _root._ymouse - _y;
distance = distance + Math.sqrt((_local4 * _local4) + (_local3 * _local3));
_alpha = 100 * (1 - (distance / max_distance));
_root.gun.beam._alpha = _alpha;
if (distance > max_distance) {
too_long = true;
target_clip._visible = false;
outside_limit = false;
clearLine();
}
}
}
function makeBubble() {
_root.bubbles.attachMovie("Bubble Clip", "bubble" + _root.bubbles.getNextHighestDepth(), _root.bubbles.getNextHighestDepth()).initBubble(line_drawer);
}
function clearLine() {
_root.gun.beam._visible = false;
_root.gun.beam._alpha = 100;
_alpha = 100;
line_drawer.clear();
line_drawer.moveTo(0, 0);
}
function followMouse() {
_x = _root._xmouse;
_y = _root._ymouse;
}
var mouse_down = false;
var outside_limit = false;
var bubble_drawn = false;
var too_long = false;
var distance = 0;
var last_x = 0;
var last_y = 0;
static var max_distance = 400;
}
Symbol 541 MovieClip [__Packages.HUD] Frame 0
class HUD extends MovieClip
{
var onEnterFrame, bubble_txt, bar, bubble_meter, direct;
function HUD () {
super();
setBubbleMeter(25);
onEnterFrame = act;
}
function setBubbleType(p_type) {
bubble_txt.text = capitalise(p_type) + "\nBubble";
_root.bubble_type = p_type;
var _local3 = 1;
while (_local3 < 7) {
bar["s" + _local3]._visible = false;
_local3++;
}
bar["s" + type_list[p_type]]._visible = true;
}
function capitalise(p_string) {
var _local1 = p_string.slice(0, 1);
_local1 = _local1.toUpperCase();
var _local2 = p_string.slice(1);
return(_local1 + _local2);
}
function setBubbleMeter(p_number) {
bubble_meter.bar.gotoAndStop(101 - Math.floor(p_number));
}
function useBubbleMixture(p_ammount) {
if (bubble_mixture > 15) {
bubble_mixture = bubble_mixture - p_ammount;
if (bubble_mixture < 0) {
bubble_mixture = 0;
}
setBubbleMeter(bubble_mixture);
return(true);
}
return(false);
}
function regainMixture(p_ammount) {
bubble_mixture = bubble_mixture + p_ammount;
if (bubble_mixture > 100) {
bubble_mixture = 100;
}
setBubbleMeter(bubble_mixture);
}
function act() {
regainMixture(0.3);
if (Key.isDown(49)) {
setBubbleType("normal");
} else if (Key.isDown(50) && (_root.level > 1)) {
setBubbleType("metal");
} else if (Key.isDown(51) && (_root.level > 2)) {
setBubbleType("poison");
} else if (Key.isDown(52) && (_root.level > 3)) {
setBubbleType("shrinking");
} else if (Key.isDown(53) && (_root.level > 4)) {
setBubbleType("explosive");
} else if (Key.isDown(54) && (_root.level > 5)) {
setBubbleType("shockwave");
}
if (Key.isDown(37) || (Key.isDown(65))) {
direct = "left";
} else if (Key.isDown(39) || (Key.isDown(68))) {
direct = "right";
} else if (direct == "left") {
direct = "";
var _local4 = type_list[_root.bubble_type];
_local4--;
if (_local4 < 1) {
_local4 = _root.level;
}
for (var _local5 in type_list) {
if (type_list[_local5] == _local4) {
var _local3 = _local5;
setBubbleType(_local3);
}
}
} else if (direct == "right") {
direct = "";
var _local4 = type_list[_root.bubble_type];
_local4++;
if (_local4 > _root.level) {
_local4 = 1;
}
for (var _local5 in type_list) {
if (type_list[_local5] == _local4) {
var _local3 = _local5;
setBubbleType(_local3);
}
}
}
}
var bubble_mixture = 100;
var type_list = {normal:1, metal:2, poison:3, shrinking:4, explosive:5, shockwave:6};
}
Symbol 542 MovieClip [__Packages.BubbleGun] Frame 0
class BubbleGun extends MovieClip
{
var onEnterFrame, _x, _y, _rotation, beam;
function BubbleGun () {
super();
onEnterFrame = aim;
}
function angleTo(p_x, p_y) {
var _local3 = p_x - _x;
var _local4 = _y - p_y;
var _local2 = Math.atan2(_local3, _local4);
return(_local2);
}
function distanceTo(p_x, p_y) {
var _local2 = p_x - _x;
var _local3 = _y - p_y;
var _local4 = Math.sqrt((_local2 * _local2) + (_local3 * _local3));
return(_local4);
}
function aim() {
var _local4 = angleTo(_root._xmouse, _root._ymouse);
_rotation = (180 * _local4) / Math.PI;
var _local3 = distanceTo(_root._xmouse, _root._ymouse);
beam._yscale = _local3 - 53;
}
}
Symbol 142 Button
on (release) {
getURL ("http://superflashbros.net/", "_blank");
}
Symbol 145 Button
on (release) {
getURL ("http://www.armorgames.com/", "_blank");
}
Symbol 152 Button
on (release) {
play();
}
Symbol 156 MovieClip Frame 1
stop();
Symbol 159 Button
on (release) {
getURL ("http://www.armorgames.com/", "_blank");
}
Symbol 162 Button
on (release) {
getURL ("http://superflashbros.net/", "_blank");
}
Symbol 165 Button
on (release) {
getURL ("http://www.armorgames.com/", "_blank");
}
Symbol 182 Button
on (release) {
gotoAndStop ("introm");
}
Symbol 252 MovieClip [Bubble Gun] Frame 1
#initclip 26
Object.registerClass("Bubble Gun", BubbleGun);
#endinitclip
Symbol 255 MovieClip Frame 1
stop();
Symbol 258 MovieClip [Bubble Drawer Clip] Frame 1
#initclip 24
Object.registerClass("Bubble Drawer Clip", BubbleDrawer);
#endinitclip
Symbol 284 MovieClip Frame 1
stop();
Symbol 293 MovieClip [Heads Up Display] Frame 1
#initclip 25
Object.registerClass("Heads Up Display", HUD);
#endinitclip
Instance of Symbol 269 MovieClip "bar" in Symbol 293 MovieClip [Heads Up Display] Frame 1
/* no clip actions */
Instance of Symbol 273 MovieClip in Symbol 293 MovieClip [Heads Up Display] Frame 1
onClipEvent (load) {
this.onRelease = function () {
_parent.setBubbleType("normal");
};
}
Instance of Symbol 273 MovieClip in Symbol 293 MovieClip [Heads Up Display] Frame 1
onClipEvent (load) {
if (_root.level > 1) {
this.onRelease = function () {
_parent.setBubbleType("metal");
};
} else {
_visible = false;
}
}
Instance of Symbol 273 MovieClip in Symbol 293 MovieClip [Heads Up Display] Frame 1
onClipEvent (load) {
if (_root.level > 2) {
this.onRelease = function () {
_parent.setBubbleType("poison");
};
} else {
_visible = false;
}
}
Instance of Symbol 273 MovieClip in Symbol 293 MovieClip [Heads Up Display] Frame 1
onClipEvent (load) {
if (_root.level > 4) {
this.onRelease = function () {
_parent.setBubbleType("explosive");
};
} else {
_visible = false;
}
}
Instance of Symbol 273 MovieClip in Symbol 293 MovieClip [Heads Up Display] Frame 1
onClipEvent (load) {
if (_root.level > 3) {
this.onRelease = function () {
_parent.setBubbleType("shrinking");
};
} else {
_visible = false;
}
}
Instance of Symbol 275 MovieClip in Symbol 293 MovieClip [Heads Up Display] Frame 1
onClipEvent (load) {
if (_root.level > 5) {
this.onRelease = function () {
_parent.setBubbleType("shockwave");
};
} else {
_visible = false;
}
}
Symbol 341 Button
on (release) {
nextFrame();
}
Symbol 344 MovieClip Frame 2
stop();
Symbol 348 MovieClip Frame 3
stop();
Symbol 391 Button
on (release) {
stopAllSounds();
nextFrame();
}
Symbol 395 MovieClip Frame 3
stop();
Symbol 404 MovieClip Frame 2
stop();
Symbol 411 MovieClip Frame 1
stop();
Symbol 417 MovieClip Frame 1
stop();
Symbol 418 Button
on (release) {
play();
}
Symbol 424 MovieClip Frame 1
stop();
Symbol 448 MovieClip Frame 1
stop();
Symbol 468 MovieClip Frame 1
stop();
Symbol 485 MovieClip Frame 265
stop();