Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("fce42554", this, 10301, true);
mochi.as2.MochiAd.showPreGameAd({id:"16ae409ad47fb3b1", res:"550x400"});
stop();
Frame 2
spkr_mc.onMouseDown = function () {
if (!this.hitTest(_xmouse, _ymouse, false)) {
return(undefined);
}
if (_level0.bkgMusic.getVolume() >= 1) {
_level0.bkgMusic.setVolume(0);
_global.mute = true;
this.gotoAndStop(15);
} else {
this.play();
_level0.bkgMusic.setVolume(40);
_global.mute = false;
}
};
trace("EEEEEEEEE XXJDSKLAFJUASDL:AFDS");
function toggleSFX() {
if (_global.mute == true) {
_global.mute = false;
txt.text = "Sounds off";
var _local2 = new Sound();
_local2.attachSound("unmute");
_local2.start();
} else {
_global.mute = true;
txt.text = "Sounds on";
var _local2 = new Sound();
_local2.attachSound("mute");
_local2.start();
}
}
function gotoWebSite() {
getURL ("http://www.pattmac.com", "_blank");
}
function gotoMusic() {
getURL ("http://www.myspace.com/djsynthr", "_blank");
}
_global.levelFrameOffset = 6;
_global.mute = false;
_global.exppts = 0;
_global.firePower = 1;
_global.shield = false;
_global.bulletSpeed = 8;
_global.shootAgain = 1;
var shared = SharedObject.getLocal("cannoncrusade");
trace("WOOHT:" + shared.data.unlockedLevels);
if (shared.data.unlockedLevels) {
_global.unlockedLevels = shared.data.unlockedLevels;
} else {
_global.unlockedLevels = new Number(1);
}
if (shared.data.gauntletUnlocked) {
_global.gauntletUnlocked = shared.data.gauntletUnlocked;
} else {
_global.gauntletUnlocked = false;
}
if (shared.data.exppts) {
_global.exppts = shared.data.exppts;
}
if (shared.data.firePower) {
_global.firePower = shared.data.firePower;
}
var cm = new ContextMenu();
cm.hideBuiltInItems();
var menuItem2 = new ContextMenuItem("Toggle Sound FX", toggleSFX);
cm.customItems.push(menuItem2);
var menuItem1 = new ContextMenuItem("Game By Pattmac", gotoWebSite);
cm.customItems.push(menuItem1);
var menuItem2 = new ContextMenuItem("Music & SFX by SynthR", gotoMusic);
cm.customItems.push(menuItem2);
this.menu = cm;
_global.fadeIn = function (movie, speed) {
var clip = _level0.attachMovie(movie, String(getTimer()), _level0.getNextHighestDepth());
var extra = _level0.createEmptyMovieClip("extra", _level0.getNextHighestDepth());
if (!speed) {
speed = 5;
}
clip._alpha = 0;
extra.onEnterFrame = function () {
clip._alpha = clip._alpha + speed;
if (clip._alpha >= 100) {
delete extra.onEnterFrame;
extra.removeMovieClip();
}
};
return(clip);
};
_global.fadeOut = function (clip, speed) {
var extra = _level0.createEmptyMovieClip("extra", _level0.getNextHighestDepth());
if (!speed) {
speed = 5;
}
extra.onEnterFrame = function () {
clip._alpha = clip._alpha - speed;
if (clip._alpha >= 0) {
delete extra.onEnterFrame;
extra.removeMovieClip();
clip.removeMovieClip();
}
};
return(clip);
};
_global.resetPowerUps = function () {
i = 0;
while (i < _level0.powerUps.length) {
_global.fadeOut(_level0.powerUps[i], 2);
i++;
}
};
_global.blast = function (sound) {
if (!sound) {
sound = "shot";
}
var _local2 = sound;
var _local1 = new Sound(_level0);
_local1.attachSound(_local2);
_local1.start();
};
_global.sound = function (soundName, vol) {
var _local2 = _level0.createEmptyMovieClip(Sting(getTimer()), 21);
var _local1 = new Sound(_local2);
if (vol != undefined) {
_local1.setVolume(vol);
}
_local1.attachSound(soundName);
_local1.start();
};
_global.bulletRemover = new Object();
AsBroadcaster.initialize(_global.bulletRemover);
_level0.attachMovie("cross_hairs", "mouse_mc", 0);
Frame 3
this.createEmptyMovieClip("bkgMusic_mc", 100);
var bkgMusic = new Sound(bkgMusic_mc);
bkgMusic.attachSound("bkgMusic");
bkgMusic.setVolume(40);
bkgMusic.start(0, 150);
Frame 4
stop();
start_bttn.onRelease = function () {
_level0.gotoAndStop("select");
Mouse.removeListener(start_bttn);
};
Mouse.addListener(start_bttn);
Frame 5
function orderize() {
var _local3 = new Array();
for (name in this) {
if (typeof(this[name]) == "movieclip") {
if (name.indexOf("instance", name) < 0) {
continue;
}
_local3.push(this[name]);
}
}
i = 0;
while (i < _local3.length) {
_local3[i].targetLevel = i;
_local3[i].txt.text = String(_local3[i].targetLevel + 1);
if (i < _global.unlockedLevels) {
_local3[i].work = true;
} else {
_local3[i].work = false;
_local3[i].txt.setTextFormat(black);
}
i++;
}
}
stop();
delete this.onEnterFrame;
orderize();
back_bttn.onRelease = function () {
_level0.gotoAndStop("Main");
Mouse.removeListener(back_bttn);
};
Mouse.addListener(back_bttn);
more_bttn.onRelease = function () {
_level0.gotoAndStop("extra");
Mouse.removeListener(more_bttn);
};
Mouse.addListener(more_bttn);
reset_bttn.onRelease = function () {
_global.unlockedLevels = 1;
_level0.shared.data.unlockedLevels = _global.unlockedLevels;
_global.exppts = 0;
_level0.shared.data.exppts = _global.exppts;
_global.firePower = 1;
_level0.shared.data.firePower = _global.firePower;
orderize();
};
Mouse.addListener(reset_bttn);
if (_global.gauntletUnlocked == false) {
more_bttn._visible = false;
}
Frame 6
_level0.enemies = new Array();
_level0.alternates = new Array();
_level0.powerUps = new Array();
this.gotoAndStop(nextPlace);
Frame 7
stop();
thisLevel = 1;
Frame 8
thisLevel = 2;
Frame 9
thisLevel = 3;
Frame 10
thisLevel = 4;
Frame 11
thisLevel = 5;
Frame 12
thisLevel = 6;
Frame 13
thisLevel = 7;
Frame 14
thisLevel = 8;
Frame 15
thisLevel = 9;
Frame 16
thisLevel = 10;
Frame 17
thisLevel = 11;
Frame 18
thisLevel = 12;
Frame 19
thisLevel = 13;
Frame 20
thisLevel = 14;
Frame 21
thisLevel = 15;
Frame 22
thisLevel = 16;
Frame 23
thisLevel = 17;
special1.bounce = 3;
Frame 24
thisLevel = 18;
Frame 25
thisLevel = 19;
Frame 26
thisLevel = 20;
Frame 27
thisLevel = 21;
mrBlue.bounce = 4;
Frame 28
thisLevel = 22;
Frame 29
thisLevel = 23;
Frame 30
thisLevel = 24;
Frame 31
thisLevel = 25;
Frame 32
thisLevel = 26;
Frame 33
stop();
thisLevel = 27;
this.count = 1;
_global.bulletRemover.broadcastMessage("removeAllBullets");
this.onEnterFrame = function () {
this.count--;
if (this.count <= 0) {
_global.bulletRemover.broadcastMessage("removeAllBullets");
for (name in _level0) {
if ((typeof(_level0[name]) == "movieclip") && (_level0[name].xspeed == 0)) {
trace(_level0[name].bulletSpeed);
_level0[name].hp = 5;
delete _level0[name].onEnterFrame;
_level0[name].stopOperation = true;
}
}
this.onEnterFrame = function () {
if (_level0.enemies.length <= 0) {
_level0.attachMovie("visit", "visit_mc", _level0.getNextHighestDepth(), {_x:275, _y:30});
_level0.attachMovie("xit", "xit_mc", _level0.getNextHighestDepth(), {_x:333, _y:21.7});
_level0.mouse_mc.swapDepths(_level0.xit_mc);
_level0.visit_mc.swapDepths(_level0.xit_mc);
_level0.visit_mc._x = 275;
_level0.visit_mc._y = 50;
xit_mc.onPress = function () {
removeMovieClip(_level0.visit_mc);
this.removeMovieClip();
};
visit_mc.onPress = function () {
getURL ("http://www.pattmac.com", _blank);
};
_root.kongregateStats.submit("popped_all_at_end", 1);
delete this.onEnterFrame;
}
};
}
};
Frame 34
dontFire = true;
stop();
delete this.onEnterFrame;
back_bttn.onRelease = function () {
_level0.gotoAndStop("select");
Mouse.removeListener(back_bttn);
};
Mouse.addListener(back_bttn);
g1.onRelease = function () {
_level0.frozen = false;
_level0.gotoAndStop("gauntlet1");
Mouse.removeListener(g1);
};
Mouse.addListener(back_bttn);
g2.onRelease = function () {
_level0.frozen = false;
_level0.gotoAndStop("gauntlet2");
Mouse.removeListener(g2);
};
Mouse.addListener(back_bttn);
g3.onRelease = function () {
_level0.frozen = false;
_level0.gotoAndStop("gauntlet3");
Mouse.removeListener(g3);
};
Mouse.addListener(back_bttn);
_global.bulletRemover.broadcastMessage("removeAllBullets");
Frame 35
thisLevel = 29;
Frame 36
thisLevel = 30;
Frame 37
thisLevel = 31;
Symbol 3 MovieClip [red_bullet] Frame 1
function removeMe() {
_global.bulletRemover.removeListener(this);
this.removeMovieClip();
}
if (!this.power) {
this.power = 1;
}
if (!this.bounce) {
this.bounce = 2;
}
_global.bulletRemover.addListener(this);
this.removeAllBullets = function () {
removeMe();
};
this.onEnterFrame = function () {
if (_level0.frozen == true) {
return(undefined);
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
if ((((this._x > (_level0.Joey._x + 620)) || (this._x < (_level0.Joey._x - 620))) || (this._y > (_level0.Joey._y + 420))) || (this._y < (_level0.Joey._y - 420))) {
removeMe();
}
if (_level0.Joey.hitTest(this._x, this._y, false)) {
_level0.Joey.damage(this.power);
removeMe();
}
if (_level0.bkg.walls.xx.hitTest(this._x, this._y, true)) {
this.xspeed = this.xspeed * -1;
this.bounce--;
if (this.bounce <= 0) {
removeMe();
}
}
if (_level0.bkg.walls.yy.hitTest(this._x, this._y, true)) {
this.yspeed = this.yspeed * -1;
this.bounce--;
if (this.bounce <= 0) {
removeMe();
}
}
var _local2 = 0;
while (_local2 < _level0.enemies.length) {
if (_level0.enemies[_local2].hitTest(this._x, this._y, true)) {
_level0.enemies[_local2].damage(this.power);
removeMe();
}
_local2++;
}
};
Symbol 5 MovieClip [bullet] Frame 1
function removeMe() {
_global.bulletRemover.removeListener(this);
this.removeMovieClip();
}
if (!this.power) {
this.power = 1;
}
if (!this.bounce) {
this.bounce = 2;
}
_global.bulletRemover.addListener(this);
this.removeAllBullets = function () {
removeMe();
};
this.onEnterFrame = function () {
if (_level0.frozen == true) {
return(undefined);
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
if ((((this._x > (_level0.Joey._x + 620)) || (this._x < (_level0.Joey._x - 620))) || (this._y > (_level0.Joey._y + 420))) || (this._y < (_level0.Joey._y - 420))) {
removeMe();
}
if ((((this._x > 1000) || (this._x < -1000)) || (this._y > 1000)) || (this._y < -1000)) {
removeMe();
}
if (_level0.Joey.hitTest(this._x, this._y, false)) {
_level0.Joey.damage(this.power);
removeMe();
}
if (_level0.bkg.walls.xx.hitTest(this._x, this._y, true)) {
this.xspeed = this.xspeed * -1;
this.bounce--;
if (this.bounce <= 0) {
removeMe();
}
}
if (_level0.bkg.walls.yy.hitTest(this._x, this._y, true)) {
this.yspeed = this.yspeed * -1;
this.bounce--;
if (this.bounce <= 0) {
removeMe();
}
}
var _local2 = 0;
while (_local2 < _level0.enemies.length) {
if (_level0.enemies[_local2].hitTest(this._x, this._y, true)) {
_level0.enemies[_local2].damage(this.power);
removeMe();
}
_local2++;
}
};
Symbol 7 MovieClip [mp] Frame 1
stop();
_level0.powerUps.push(this);
this.frame = _level0._currentframe;
this.onEnterFrame = function () {
if (this.hitTest(_level0.Joey._x, _level0.Joey._y, false)) {
_level0.Joey.firePower++;
_level0.Joey.bulletSize = _level0.Joey.bulletSize + 0.5;
this.removeMovieClip();
delete this.onEnterFrame;
this.gotoAndStop(2);
}
if (_level0._currentframe != this.frame) {
this.removeMovieClip();
delete this.onEnterFrame;
this.gotoAndStop(2);
}
};
Symbol 9 MovieClip [cross_hairs] Frame 1
Mouse.hide();
this.onEnterFrame = function () {
this._x = _level0._xmouse;
this._y = _level0._ymouse;
};
this.onMouseDown = function () {
this._visible = true;
Mouse.hide();
};
Mouse.addListener(this);
this.cacheAsBitmap = true;
Symbol 14 MovieClip Frame 1
this.onMouseDown = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
if (_level0.frozen == true) {
_level0.frozen = false;
} else {
_level0.frozen = true;
}
Mouse.removeListener(this);
delete this.onMouseDown;
this._parent.removeMovieClip();
}
};
this.onEnterFrame = function () {
if (_level0.frozen == false) {
Mouse.removeListener(this);
delete this.onMouseDown;
this._parent.removeMovieClip();
}
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
txt.setTextFormat(yellow);
} else {
txt.setTextFormat(gray);
}
};
var gray = new TextFormat();
gray.color = 13421772 /* 0xCCCCCC */;
var yellow = new TextFormat();
yellow.color = 16777164 /* 0xFFFFCC */;
Symbol 16 MovieClip Frame 1
if (_global.mute == true) {
txt.text = "Sounds on";
} else {
txt.text = "Sounds off";
}
this.onMouseDown = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
if (_global.mute == true) {
_global.mute = false;
txt.text = "Sounds off";
var _local3 = new Sound();
_local3.attachSound("unmute");
_local3.start();
} else {
_global.mute = true;
txt.text = "Sounds on";
var _local3 = new Sound();
_local3.attachSound("mute");
_local3.start();
}
}
};
this.onEnterFrame = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
txt.setTextFormat(yellow);
} else {
txt.setTextFormat(gray);
}
};
var gray = new TextFormat();
gray.color = 13421772 /* 0xCCCCCC */;
var yellow = new TextFormat();
yellow.color = 16777164 /* 0xFFFFCC */;
Symbol 19 MovieClip Frame 1
this.onMouseDown = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
_global.resetPowerUps();
_level0.frozen = false;
_level0.hp_mc.removeMovieClip();
_global.bulletRemover.broadcastMessage("removeAllBullets");
_level0.gotoAndStop("select");
Mouse.removeListener(this);
delete this.onMouseDown;
this._parent.removeMovieClip();
}
};
Mouse.addListener(this);
this.onEnterFrame = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
txt.setTextFormat(yellow);
} else {
txt.setTextFormat(gray);
}
};
var gray = new TextFormat();
gray.color = 13421772 /* 0xCCCCCC */;
var yellow = new TextFormat();
yellow.color = 16776960 /* 0xFFFF00 */;
Symbol 24 MovieClip Frame 1
function returntoLastMenu(retuned) {
_global.fadeIn(retuned._parent.returnto, 100);
_global.bulletRemover.broadcastMessage("removeAllBullets");
retuned._parent.onEnterFrame = function () {
this._alpha = this._alpha - 100;
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
}
this.onMouseDown = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
Mouse.removeListener(this);
delete this.onMouseDown;
var _local2 = new timerObject(0, returntoLastMenu, this);
}
};
Mouse.addListener(this);
this.onEnterFrame = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
txt.setTextFormat(yellow);
} else {
txt.setTextFormat(gray);
}
};
var gray = new TextFormat();
gray.color = 13421772 /* 0xCCCCCC */;
var yellow = new TextFormat();
yellow.color = 16776960 /* 0xFFFF00 */;
Symbol 55 MovieClip [buy_sell_screen] Frame 1
function checkValues() {
if ((_global.exppts < 125) || (_global.firePower > 1)) {
big_bttn.enabled = false;
} else {
big_bttn.enabled = true;
}
if ((_global.exppts < 125) || (_global.gauntletUnlocked == true)) {
unlock_bttn.enabled = false;
} else {
unlock_bttn.enabled = true;
}
if ((_global.exppts < 200) || (_global.firePower < 2)) {
fire_bttn.enabled = false;
} else {
fire_bttn.enabled = true;
}
if (_global.firePower >= 2) {
this.attachMovie("checkmark", getTimer() - 1, this.getNextHighestDepth(), {_x:big_bttn._x, _y:big_bttn._y});
}
if (_global.firePower > 2) {
this.attachMovie("checkmark", getTimer(), this.getNextHighestDepth(), {_x:fire_bttn._x, _y:fire_bttn._y});
}
if (_global.gauntletUnlocked == true) {
this.attachMovie("checkmark", getTimer() + 1, this.getNextHighestDepth(), {_x:unlock_bttn._x, _y:unlock_bttn._y});
}
_level0.shared.data.exppts = _global.exppts;
}
this.swapDepths(_level0.mouse_mc);
this.exp_txt.text = String(_global.exppts);
big_bttn.onRelease = function () {
if ((_global.exppts - 125) < 0) {
return(undefined);
}
_root.kongregateStats.submit("big_bullets", 1);
_global.firePower = 2;
_level0.shared.data.firePower = _global.firePower;
_global.exppts = _global.exppts - 125;
_level0.shared.data.exppts = _global.exppts;
this._parent.exp_txt.text = String(_global.exppts);
trace("TRANSACTION");
checkValues();
};
fire_bttn.onRelease = function () {
if ((_global.exppts - 200) < 0) {
return(undefined);
}
_root.kongregateStats.submit("fire_bullets", 1);
_global.exppts = _global.exppts - 200;
_global.firePower = 5;
_level0.shared.data.firePower = _global.firePower;
_level0.shared.data.exppts = _global.exppts;
trace(_level0.shared.data.exppts);
this._parent.exp_txt.text = String(_global.exppts);
trace("TRANSACTION");
checkValues();
};
unlock_bttn.onRelease = function () {
if ((_global.exppts - 125) < 0) {
return(undefined);
}
_root.kongregateStats.submit("unlocked", 1);
_global.exppts = _global.exppts - 125;
_level0.shared.data.exppts = _global.exppts;
this._parent.exp_txt.text = String(_global.exppts);
_global.gauntletUnlocked = true;
_level0.shared.data.gauntletUnlocked = true;
trace("TRANSACTION");
checkValues();
};
Mouse.addListener(big_bttn);
checkValues();
for (prop in big_bttn) {
trace(prop);
}
Symbol 59 MovieClip Frame 1
this.onMouseDown = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
Mouse.removeListener(this);
_global.resetPowerUps();
_level0.frozen = false;
_level0.hp_mc.removeMovieClip();
_global.bulletRemover.broadcastMessage("removeAllBullets");
_level0.nextPlace = _level0.thisLevel + _global.levelFrameOffset;
_level0.gotoAndStop("blank");
delete this.onMouseDown;
delete this.onEnterFrame;
this._parent.removeMovieClip();
}
};
Mouse.addListener(this);
this.onEnterFrame = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
txt.setTextFormat(yellow);
} else {
txt.setTextFormat(gray);
}
};
var gray = new TextFormat();
gray.color = 13421772 /* 0xCCCCCC */;
var yellow = new TextFormat();
yellow.color = 16777164 /* 0xFFFFCC */;
Symbol 64 MovieClip Frame 1
this.onMouseDown = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
var _local3 = _global.fadeIn("buy_sell_screen", 100);
_local3.returnto = this._parent.ref;
_global.resetPowerUps();
_global.bulletRemover.broadcastMessage("removeAllBullets");
Mouse.removeListener(this);
delete this.onMouseDown;
this._parent.removeMovieClip();
}
};
Mouse.addListener(this);
this.onEnterFrame = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
txt.setTextFormat(yellow);
} else {
txt.setTextFormat(gray);
}
};
var gray = new TextFormat();
gray.color = 13421772 /* 0xCCCCCC */;
var yellow = new TextFormat();
yellow.color = 16776960 /* 0xFFFF00 */;
Symbol 65 MovieClip [already_completed_screen] Frame 1
function randomText(lib) {
return(lib[Math.floor(Math.random() * lib.length)]);
}
var wft = new Array();
wft.push("ALREADY COMPLETED");
wft.push("PREVIOUSLY COMPLETED");
var boss = new Array();
boss.push("Horray! You defeated the evil boss tannk!");
boss.push("Enemy Defeated!");
boss.push("Congratulations!");
this.swapDepths(_level0.mouse_mc);
this.ref = "already_completed_screen";
_level0.frozen = true;
if (_level0.thisLevel < _global.unlockedLevels) {
this.txt.text = randomText(this.wft);
}
if (_level0.thisLevel == 26) {
this.txt.text = randomText(this.boss);
}
_global.bulletRemover.broadcastMessage("removeAllBullets");
pts_txt.text = _global.exppts;
Symbol 69 MovieClip Frame 1
this.onMouseDown = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
_global.resetPowerUps();
_level0.frozen = false;
_level0.hp_mc.removeMovieClip();
_global.bulletRemover.broadcastMessage("removeAllBullets");
_level0.nextPlace = (_level0.thisLevel + _global.levelFrameOffset) + 1;
_level0.gotoAndStop("blank");
Mouse.removeListener(this);
delete this.onMouseDown;
this._parent.removeMovieClip();
}
};
Mouse.addListener(this);
this.onEnterFrame = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
txt.setTextFormat(yellow);
} else {
txt.setTextFormat(gray);
}
};
var gray = new TextFormat();
gray.color = 13421772 /* 0xCCCCCC */;
var yellow = new TextFormat();
yellow.color = 16777164 /* 0xFFFFCC */;
Symbol 70 MovieClip [Win] Frame 1
this.swapDepths(_level0.mouse_mc);
_root.kongregateStats.submit("currentlevel", 27);
Symbol 74 MovieClip Frame 1
this.onMouseDown = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
_global.resetPowerUps();
_level0.hp_mc.removeMovieClip();
_level0.frozen = false;
_global.bulletRemover.broadcastMessage("removeAllBullets");
_level0.nextPlace = (_level0.thisLevel + _global.levelFrameOffset) + 1;
_level0.gotoAndStop("blank");
Mouse.removeListener(this);
delete this.onMouseDown;
this._parent.removeMovieClip();
}
};
Mouse.addListener(this);
this.onEnterFrame = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
txt.setTextFormat(yellow);
} else {
txt.setTextFormat(gray);
}
};
var gray = new TextFormat();
gray.color = 13421772 /* 0xCCCCCC */;
var yellow = new TextFormat();
yellow.color = 16777164 /* 0xFFFFCC */;
Symbol 75 MovieClip [gotoBoss] Frame 1
this.swapDepths(_level0.mouse_mc);
_root.kongregateStats.submit("currentlevel", 26);
Symbol 80 MovieClip Frame 1
this.onMouseDown = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
_global.resetPowerUps();
_level0.frozen = false;
_level0.hp_mc.removeMovieClip();
_global.bulletRemover.broadcastMessage("removeAllBullets");
_level0.nextPlace = (_level0.thisLevel + _global.levelFrameOffset) + 1;
_level0.gotoAndStop("blank");
Mouse.removeListener(this);
delete this.onMouseDown;
this._parent.removeMovieClip();
}
};
Mouse.addListener(this);
this.onEnterFrame = function () {
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
txt.setTextFormat(yellow);
} else {
txt.setTextFormat(gray);
}
};
var gray = new TextFormat();
gray.color = 13421772 /* 0xCCCCCC */;
var yellow = new TextFormat();
yellow.color = 16776960 /* 0xFFFF00 */;
Symbol 81 MovieClip [complete_screen_copy] Frame 1
function randomText(lib) {
return(lib[Math.floor(Math.random() * lib.length)]);
}
_global.bulletRemover.broadcastMessage("removeAllBullets");
var did = new Array();
did.push("LEVEL COMPLETE");
did.push("Nice one.");
did.push("Straight Shooter");
did.push("HOT SHOT");
did.push("Sharp Shooter");
did.push("COMPLETE");
did.push("PRO.");
did.push("BRILLIANT");
did.push("Good Job.");
did.push("Takin' out the bad guys.");
did.push("AWESOME");
did.push("LEVEL-UP");
this.swapDepths(_level0.mouse_mc);
this.ref = "complete_screen_copy";
pts_txt.text = _global.exppts;
Symbol 89 MovieClip [complete_gauntlet] Frame 1
function randomText(lib) {
return(lib[Math.floor(Math.random() * lib.length)]);
}
_global.bulletRemover.broadcastMessage("removeAllBullets");
var did = new Array();
did.push("LEVEL COMPLETE");
_level0.frozen = true;
this.swapDepths(_level0.mouse_mc);
back_bttn.onPress = function () {
_level0.gotoAndStop("extra");
this._parent.removeMovieClip();
Mouse.removeListener(this);
};
Mouse.addListener(back_bttn);
_level0.hp_mc.removeMovieClip();
Symbol 93 MovieClip Frame 1
var gainedPts = (_level0.Joey.hp * 5);
var displayedPts = 0;
var initPts = (_global.exppts - (_level0.Joey.hp * 5));
var hpText = _level0.Joey.hp;
this.count = 10;
pts_txt.text = String((initPts + "+") + displayedPts);
this.onEnterFrame = function () {
this.count--;
if (this.count >= 0) {
return(undefined);
}
displayedPts++;
pts_txt.text = String((initPts + "+") + displayedPts);
if (displayedPts >= gainedPts) {
hp_txt._visible = false;
delete this.onEnterFrame;
}
_level0.hp_mc.bar._width = _level0.hp_mc.bar._width - 4;
};
Symbol 95 MovieClip [complete_screen] Frame 1
function randomText(lib) {
return(lib[Math.floor(Math.random() * lib.length)]);
}
_global.bulletRemover.broadcastMessage("removeAllBullets");
var did = new Array();
did.push("LEVEL COMPLETE");
did.push("Nice one.");
did.push("Straight Shooter");
did.push("HOT SHOT");
did.push("Sharp Shooter");
did.push("COMPLETE");
did.push("PRO.");
did.push("BRILLIANT");
did.push("Good Job.");
did.push("Takin' out the bad guys.");
did.push("AWESOME");
did.push("LEVEL-UP");
if (_global.mute == false) {
_global.sound("select1");
}
this.swapDepths(_level0.mouse_mc);
this.ref = "complete_screen_copy";
_level0.frozen = true;
if (_level0.thisLevel == 25) {
_global.fadeIn("gotoBoss", 100);
this.removeMovieClip();
}
if (_level0.thisLevel == 26) {
_global.fadeIn("Win", 100);
this.removeMovieClip();
}
if ((_level0.thisLevel == _global.unlockedLevels) || (_level0.thisLevel == 27)) {
_global.unlockedLevels = _level0.thisLevel + 1;
_root.kongregateStats.submit("currentlevel", _global.unlockedLevels);
_level0.shared.data.unlockedLevels = _global.unlockedLevels;
_global.exppts = _global.exppts + (_level0.Joey.hp * 5);
_level0.shared.data.exppts = _global.exppts;
this.txt.text = randomText(this.did);
trace("!!!" + _level0.shared.data.exppts);
} else {
trace("ALREADY DONE" + _level0.thisLevel);
if (_level0.thisLevel == 26) {
return(undefined);
}
_global.fadeIn("already_completed_screen", 100);
this.removeMovieClip();
}
Symbol 101 MovieClip Frame 1
this.onMouseDown = function () {
if (this.hitTest(_xmouse + this._x, _ymouse + this._y, true)) {
Mouse.removeListener(this);
_global.resetPowerUps();
_level0.frozen = false;
_level0.hp_mc.removeMovieClip();
_global.bulletRemover.broadcastMessage("removeAllBullets");
_level0.nextPlace = _level0.thisLevel + _global.levelFrameOffset;
_level0.gotoAndStop("blank");
delete this.onMouseDown;
delete this.onEnterFrame;
this._parent.removeMovieClip();
}
};
Mouse.addListener(this);
this.onEnterFrame = function () {
if (this.hitTest(_xmouse + this._x, _ymouse + this._y, true)) {
txt.setTextFormat(yellow);
} else {
txt.setTextFormat(gray);
}
};
var gray = new TextFormat();
gray.color = 13421772 /* 0xCCCCCC */;
var yellow = new TextFormat();
yellow.color = 16776960 /* 0xFFFF00 */;
Symbol 102 MovieClip [die_screen] Frame 1
function randomText(lib) {
return(lib[Math.floor(Math.random() * lib.length)]);
}
_global.bulletRemover.broadcastMessage("removeAllBullets");
_level0.frozen = true;
pts_txt.text = String(_global.exppts);
var yes = new Array();
yes.push("Keep Trying!");
yes.push("Don't Give Up!");
yes.push("You can do it.");
yes.push("Third Time's the Charm");
yes.push("Practice Makes Perfect");
yes.push("If at first you don't succeed...");
yes.push("Almost there...");
yes.push("You were that close!");
yes.push("Quitting isn't an option.");
yes.push("Maybe next time...");
yes.push("Give it another shot.");
var no = new Array();
no.push("Are you sure you've already beat this level?!?");
no.push("Surprising that you can die on a level you already beat...");
no.push("C'mon man, you've done this level before!");
no.push("This level's like algebra: you did it once, but forgot how to do it...");
no.push("YOU DIED");
no.push("YOU DIED ON A LEVEL THAT YOU HAVE ALREADY COMPLETED");
var lastLevel = new Array();
lastLevel.push("WELL, AT LEAST IT'S THE 'BONUS LEVEL'...");
lastLevel.push("AND ON THE BONUS LEVEL YOU DIE!?");
lastLevel.push("NO ONE'S EVEN SHOOTING AT YOU!");
lastLevel.push("YOU KILLED YOURSELF... WHAT DO YOU HAVE TO SAY ABOUT THAT?");
lastLevel.push("TAKE IT EASY, MAN... THEY AREN'T REAL BAD GUYS...");
var gaunt = new Array();
gaunt.push("WELL, THAT WAS TOUGH...");
gaunt.push("BETTER LUCK NEXT TIME....");
gaunt.push("HARD IS HARD...");
gaunt.push("IT'S CALLED THE GAUNTLET FOR A REASON");
gaunt.push("RUN, RUN, RUN!");
gaunt.push("YOU WERE PUMMELLED.");
var boss = new Array();
boss.push("The Boss Owned You");
boss.push("Mu wa ha ha!");
boss.push("Resistance is Futile!");
boss.push("BOSS WINS");
boss.push("That's no way to beat a boss!");
if (_global.mute == false) {
_global.sound("death_enemy");
}
this.swapDepths(_level0.mouse_mc);
this.ref = "die_screen";
if (_level0.thisLevel == _global.unlockedLevels) {
_global.bulletRemover.broadcastMessage("removeAllBullets");
this.txt.text = randomText(this.yes);
} else if (_level0.thisLevel != 27) {
if (_level0.thisLevel < 27) {
this.txt.text = randomText(this.no);
}
if (_level0.thisLevel > 27) {
this.txt.text = randomText(this.gaunt);
}
if (_level0.thisLevel == 26) {
this.txt.text = randomText(this.boss);
}
} else {
this.txt.text = randomText(this.lastLevel);
}
Symbol 104 MovieClip [hp_txt] Frame 1
var my_fmt = new TextFormat();
my_fmt.font = "Gill Embed";
this.txt.embedFonts = true;
this.txt.setTextFormat(my_fmt);
this.onEnterFrame = function () {
this._alpha = this._alpha - 5;
if (this._alpha <= 0) {
delete this.onEnterFrame;
this.removeMovieClip();
}
};
Symbol 120 MovieClip [visit] Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
Symbol 122 MovieClip [xit] Frame 1
this.onPress = function () {
_level0.visit_mc.removeMovieClip();
this.removeMovieClip();
};
Symbol 409 MovieClip [__Packages.timerObject] Frame 0
class timerObject
{
function timerObject (time, doAction, toThis) {
numofTimers++;
var _local2 = _level0.createEmptyMovieClip(String("Timer" + numofTimers), _level0.getNextHighestDepth());
_local2.initialTime = getTimer();
_local2.onEnterFrame = function () {
if ((getTimer() - this.initialTime) > (time * 1000)) {
doAction(toThis);
this.removeMovieClip();
}
};
}
static var numofTimers = 0;
}
Symbol 410 MovieClip [__Packages.mochi.as2.MochiAd] Frame 0
class mochi.as2.MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("3.0 as2");
}
static function showPreGameAd(options) {
trace("EHEHEHEHEHEH YESSSSSSSSSSS");
var _local26 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, no_progress_bar:false, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}, ad_progress:function (percent) {
}};
options = _parseOptions(options, _local26);
if ("c862232051e0a94e1c3609b3916ddb17".substr(0) == "dfeada81ac97cde83665f81c12da7def") {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local22 = 11000;
var _local25 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local6 = chk.createEmptyMovieClip("_mochiad_bar", 4);
if (options.no_progress_bar) {
_local6._visible = false;
delete options.no_progress_bar;
} else {
_local6._x = 10;
_local6._y = _local13 - 20;
}
var _local21 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local23 = options.outline;
delete options.outline;
var _local5 = _local6.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local6.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local21);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local7 = _local6.createEmptyMovieClip("_outline", 3);
_local7.lineStyle(0, _local23, 100);
_local7.moveTo(0, 0);
_local7.lineTo(_local4 - 20, 0);
_local7.lineTo(_local4 - 20, 10);
_local7.lineTo(0, 10);
_local7.lineTo(0, 0);
chk.ad_msec = _local22;
chk.ad_timeout = _local25;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
var sendHostProgress = false;
mc.lc.sendHostLoadProgress = function (lc_name) {
sendHostProgress = true;
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local11 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local2 = (100 * _local8) / _local4;
var _local10 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local13 = Math.min(100, Math.min(_local2 || 0, _local10));
_local13 = Math.max(this.last_pcnt, _local13);
this.last_pcnt = _local13;
_local9._xscale = _local13;
options.ad_progress(_local13);
if (sendHostProgress) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"hostLoadPcnt", pcnt:_local2});
if (_local2 == 100) {
sendHostProgress = false;
}
}
if (!chk.showing) {
var _local7 = _local11.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if ((_local5 > chk.ad_timeout) && (_local2 == 100)) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showClickAwayAd(options) {
var _local9 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showClickAwayAd", res:"300x250", no_bg:true, ad_started:function () {
}, ad_finished:function () {
}, ad_loaded:function (width, height) {
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local9);
var clip = options.clip;
var _local8 = options.ad_timeout;
delete options.ad_timeout;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local4 = _getRes(options);
var _local10 = _local4[0];
var _local7 = _local4[1];
mc._x = _local10 * 0.5;
mc._y = _local7 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_timeout = _local8;
chk.started = getTimer();
chk.showing = false;
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
var _local20 = false;
mc.lc.regContLC = function (lc_name) {
mc._containerLCName = lc_name;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
_local2 = true;
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local2) {
delete this.onEnterFrame;
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochiAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}, ad_skipped:function () {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
mochi.as2.MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adSkipped = options.ad_skipped;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
mc.lc.rpc = function (callbackID, arg) {
mochi.as2.MochiAd.rpc(clip, callbackID, arg);
};
mc.rpcTestFn = function (s) {
trace("[MOCHIAD rpcTestFn] " + s);
return(s);
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local7 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local7._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
if (_local7._url.indexOf("http") != 0) {
trace("[MochiAd] NOTE: Security Sandbox Violation errors below are normal");
}
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
mochi.as2.MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
if (clip._mochiad._containerLCName != undefined) {
clip._mochiad.lc.send(clip._mochiad._containerLCName, "notify", {id:"unload"});
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
static function rpc(clip, callbackID, arg) {
switch (arg.id) {
case "setValue" :
setValue(clip, arg.objectName, arg.value);
break;
case "getValue" :
var _local4 = getValue(clip, arg.objectName);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local4);
break;
case "runMethod" :
var _local3 = runMethod(clip, arg.method, arg.args);
clip._mochiad.lc.send(clip._mochiad._containerLCName, "rpcResult", callbackID, _local3);
break;
default :
trace("[mochiads rpc] unknown rpc id: " + arg.id);
}
}
static function setValue(base, objectName, value) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
base[_local2[_local1]] = value;
}
static function getValue(base, objectName) {
var _local2 = objectName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
return(base[_local2[_local1]]);
}
static function runMethod(base, methodName, argsArray) {
var _local2 = methodName.split(".");
var _local1;
_local1 = 0;
while (_local1 < (_local2.length - 1)) {
if ((base[_local2[_local1]] == undefined) || (base[_local2[_local1]] == null)) {
return(undefined);
}
base = base[_local2[_local1]];
_local1++;
}
if (typeof(base[_local2[_local1]]) == "function") {
return(base[_local2[_local1]].apply(base, argsArray));
}
return(undefined);
}
}
Symbol 411 MovieClip [__Packages.mx.transitions.OnEnterFrameBeacon] Frame 0
class mx.transitions.OnEnterFrameBeacon
{
function OnEnterFrameBeacon () {
}
static function init() {
var _local4 = _global.MovieClip;
if (!_root.__OnEnterFrameBeacon) {
mx.transitions.BroadcasterMX.initialize(_local4);
var _local3 = _root.createEmptyMovieClip("__OnEnterFrameBeacon", 9876);
_local3.onEnterFrame = function () {
_global.MovieClip.broadcastMessage("onEnterFrame");
};
}
}
static var version = "1.1.0.52";
}
Symbol 412 MovieClip [__Packages.mx.transitions.BroadcasterMX] Frame 0
class mx.transitions.BroadcasterMX
{
var _listeners;
function BroadcasterMX () {
}
static function initialize(o, dontCreateArray) {
if (o.broadcastMessage != undefined) {
delete o.broadcastMessage;
}
o.addListener = mx.transitions.BroadcasterMX.prototype.addListener;
o.removeListener = mx.transitions.BroadcasterMX.prototype.removeListener;
if (!dontCreateArray) {
o._listeners = new Array();
}
}
function addListener(o) {
removeListener(o);
if (broadcastMessage == undefined) {
broadcastMessage = mx.transitions.BroadcasterMX.prototype.broadcastMessage;
}
return(_listeners.push(o));
}
function removeListener(o) {
var _local2 = _listeners;
var _local3 = _local2.length;
while (_local3--) {
if (_local2[_local3] == o) {
_local2.splice(_local3, 1);
if (!_local2.length) {
broadcastMessage = undefined;
}
return(true);
}
}
return(false);
}
function broadcastMessage() {
var _local5 = String(arguments.shift());
var _local4 = _listeners.concat();
var _local6 = _local4.length;
var _local3 = 0;
while (_local3 < _local6) {
_local4[_local3][_local5].apply(_local4[_local3], arguments);
_local3++;
}
}
static var version = "1.1.0.52";
}
Symbol 131 MovieClip Frame 2
stop();
Symbol 133 MovieClip Frame 1
function fire() {
if (_level0.dontFire == true) {
return(undefined);
}
if (_global.mute == false) {
_global.blast();
}
var _local3 = (this._rotation / 180) * Math.PI;
var _local5 = (Math.cos(_local3) * this.p._x) + this._x;
var _local4 = (Math.sin(_local3) * this.p._x) + this._y;
_local3 = _local3 + ((Math.random() * this.accuracyVar) - (Math.random() * this.accuracyVar));
var _local7 = (-bulletSpeed) * Math.cos(_local3);
var _local6 = (-bulletSpeed) * Math.sin(_local3);
_level0.attachMovie("bullet", getTimer(), _level0.getNextHighestDepth(), {_x:_local5, _y:_local4, xspeed:_local7, yspeed:_local6, power:this.firePower});
}
function damage(impact) {
this.hp = this.hp - impact;
if (this.hp <= 0) {
this._visible = false;
i = 0;
while (i < _level0.enemies.length) {
if (_level0.enemies[i] == this) {
_level0.enemies.splice(i, 1);
}
i++;
}
howManyLeft();
if (_global.mute == false) {
_global.sound("explosion1");
}
delete this.onEnterFrame;
}
}
function asessTarget() {
var _local10 = Math.sqrt(((this._x - _level0.Joey._x) * (this._x - _level0.Joey._x)) + ((this._y - _level0.Joey._y) * (this._y - _level0.Joey._y)));
var _local12 = Math.atan((this._y - _level0.Joey._y) / (this._x - _level0.Joey._x));
if ((this._x - _level0.Joey._x) < 0) {
_local12 = Math.PI + _local12;
}
var _local9 = -Math.cos(_local12);
var _local8 = -Math.sin(_local12);
var _local7 = false;
i = 0;
while (i < _local10) {
var _local4 = (_local9 * i) + this._x;
var _local5 = (_local8 * i) + this._y;
if (_level0.bkg.walls.hitTest(_local4, _local5, true)) {
_local7 = true;
break;
}
i++;
}
if (_local7 == true) {
var _local11;
var _local6 = 1000;
i = 0;
while (i < _level0.alternates.length) {
var _local2 = _level0.alternates[i];
var _local3 = Math.sqrt(((_local2._x - _level0.Joey._x) * (_local2._x - _level0.Joey._x)) + ((_local2._y - _level0.Joey._y) * (_local2._y - _level0.Joey._y)));
if (this.affinity == true) {
_local3 = Math.sqrt(((_local2._x - this._x) * (_local2._x - this._x)) + ((_local2._y - this._y) * (_local2._y - this._y)));
}
if (_local3 < _local6) {
_local11 = _local2;
_local6 = _local3;
}
i++;
}
this.focus = _local11;
} else if (this.focus != _level0.Joey) {
this.focus = _level0.Joey;
this.tweening = true;
}
}
function howManyLeft() {
if (_level0.enemies.length <= 0) {
_global.fadeIn("complete_screen", 5);
}
}
_level0.enemies.push(this);
if (!this.affinity) {
this.affinity = false;
}
this.focus = _level0.Joey;
this.tweening = false;
this.hp = 20;
this.firePower = 1;
this.speed = 0.25;
this.rotationspeed = 3;
this.bulletSpeed = 14;
this.count = 40;
this.minWait = 30;
this.maxWait = 60;
this.maxWait = this.maxWait - this.minWait;
this.xspeed = 4;
this.yspeed = 0;
this.xpower = 1;
this.friction = 0.85;
this.accuracyVar = 0;
this.accuracyVar = (this.accuracyVar / 180) * Math.PI;
this.onEnterFrame = function () {
if (_level0.frozen == true) {
return(undefined);
}
this.count--;
if (this._x > 510) {
this.xspeed = -4;
}
if (this._x < 70) {
this.xspeed = 4;
}
this._x = this._x + this.xspeed;
if (this.count <= 0) {
this.fire();
asessTarget();
this.count = Math.ceil((Math.random() * this.maxWait) + this.minWait);
}
if (this.count == 10) {
asessTarget();
}
if (this.count == 20) {
asessTarget();
}
if (this.count == 30) {
asessTarget();
}
if (this.count == 40) {
asessTarget();
}
if (this.count == 50) {
asessTarget();
}
var _local4 = {x:this._x, y:this._y};
var _local3 = Math.atan((_local4.y - this.focus._y) / (_local4.x - this.focus._x));
if ((_local4.x - this.focus._x) < 0) {
_local3 = Math.PI + _local3;
}
var _local2 = Math.ceil((_local3 / Math.PI) * 180);
if ((this.focus == _level0.Joey) && (this.tweening == false)) {
this._rotation = Math.ceil((_local3 / Math.PI) * 180);
}
if (this.focus != _level0.Joey) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
}
if ((this.focus == _level0.Joey) && (this.tweening == true)) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
if (((_local2 - this._rotation) < this.rotationspeed) && ((_local2 - this._rotation) > (-this.rotationspeed))) {
this.tweening = false;
}
}
while (_level0.walls.hitTest(this._x, this._y + (this._height / 2), true)) {
this._y--;
}
while (_level0.walls.hitTest(this._x, this._y - (this._height / 2), true)) {
this._y++;
}
while (_level0.walls.hitTest(this._x + (this._width / 2), this._y, true)) {
this._x--;
}
while (_level0.walls.hitTest(this._x - (this._width / 2), this._y, true)) {
this._x++;
}
};
Symbol 162 MovieClip [sayGo] Frame 1
this.onEnterFrame = function () {
this._x = _level0.Joey._x;
this._y = _level0.Joey._y;
};
Symbol 162 MovieClip [sayGo] Frame 34
_level0.dontFire = false;
Symbol 162 MovieClip [sayGo] Frame 43
stop();
this.removeMovieClip();
Symbol 168 MovieClip Frame 1
function fire() {
if (_level0.dontFire == true) {
return(undefined);
}
if (_global.mute == false) {
_global.blast();
}
var _local3 = (this._rotation / 180) * Math.PI;
var _local5 = (Math.cos(_local3) * this.p._x) + this._x;
var _local4 = (Math.sin(_local3) * this.p._x) + this._y;
_local3 = _local3 + ((Math.random() * this.accuracyVar) - (Math.random() * this.accuracyVar));
var _local7 = (-bulletSpeed) * Math.cos(_local3);
var _local6 = (-bulletSpeed) * Math.sin(_local3);
_level0.attachMovie("bullet", getTimer(), _level0.getNextHighestDepth(), {_x:_local5, _y:_local4, xspeed:_local7, yspeed:_local6, power:this.firePower});
}
function damage(impact) {
this.hp = this.hp - impact;
if (this.hp <= 0) {
this._visible = false;
i = 0;
while (i < _level0.enemies.length) {
if (_level0.enemies[i] == this) {
_level0.enemies.splice(i, 1);
}
i++;
}
howManyLeft();
if (_global.mute == false) {
_global.sound("explosion1");
}
delete this.onEnterFrame;
}
}
function asessTarget() {
var _local10 = Math.sqrt(((this._x - _level0.Joey._x) * (this._x - _level0.Joey._x)) + ((this._y - _level0.Joey._y) * (this._y - _level0.Joey._y)));
var _local12 = Math.atan((this._y - _level0.Joey._y) / (this._x - _level0.Joey._x));
if ((this._x - _level0.Joey._x) < 0) {
_local12 = Math.PI + _local12;
}
var _local9 = -Math.cos(_local12);
var _local8 = -Math.sin(_local12);
var _local7 = false;
i = 0;
while (i < _local10) {
var _local4 = (_local9 * i) + this._x;
var _local5 = (_local8 * i) + this._y;
if (_level0.bkg.walls.hitTest(_local4, _local5, true)) {
_local7 = true;
break;
}
i++;
}
if (_local7 == true) {
var _local11;
var _local6 = 1000;
i = 0;
while (i < _level0.alternates.length) {
var _local2 = _level0.alternates[i];
var _local3 = Math.sqrt(((_local2._x - _level0.Joey._x) * (_local2._x - _level0.Joey._x)) + ((_local2._y - _level0.Joey._y) * (_local2._y - _level0.Joey._y)));
if (this.affinity == true) {
_local3 = Math.sqrt(((_local2._x - this._x) * (_local2._x - this._x)) + ((_local2._y - this._y) * (_local2._y - this._y)));
}
if (_local3 < _local6) {
_local11 = _local2;
_local6 = _local3;
}
i++;
}
this.focus = _local11;
} else if (this.focus != _level0.Joey) {
this.focus = _level0.Joey;
this.tweening = true;
}
}
function howManyLeft() {
if (_level0.enemies.length <= 0) {
_global.fadeIn("complete_screen", 5);
}
}
_level0.enemies.push(this);
if (!this.affinity) {
this.affinity = false;
}
this.focus = _level0.Joey;
this.tweening = false;
this.hp = 20;
this.firePower = 1;
this.speed = 0.25;
this.rotationspeed = 3;
this.bulletSpeed = 8;
this.count = 40;
this.minWait = 30;
this.maxWait = 60;
this.maxWait = this.maxWait - this.minWait;
this.xspeed = 0;
this.yspeed = 0;
this.friction = 0.85;
this.accuracyVar = 0;
this.accuracyVar = (this.accuracyVar / 180) * Math.PI;
this.onEnterFrame = function () {
if (_level0.frozen == true) {
return(undefined);
}
this.count--;
if (this.count <= 0) {
this.fire();
asessTarget();
this.count = Math.ceil((Math.random() * this.maxWait) + this.minWait);
}
if (this.count == 10) {
asessTarget();
}
if (this.count == 20) {
asessTarget();
}
if (this.count == 30) {
asessTarget();
}
if (this.count == 40) {
asessTarget();
}
if (this.count == 50) {
asessTarget();
}
var _local4 = {x:this._x, y:this._y};
var _local3 = Math.atan((_local4.y - this.focus._y) / (_local4.x - this.focus._x));
if ((_local4.x - this.focus._x) < 0) {
_local3 = Math.PI + _local3;
}
var _local2 = Math.ceil((_local3 / Math.PI) * 180);
if ((this.focus == _level0.Joey) && (this.tweening == false)) {
this._rotation = Math.ceil((_local3 / Math.PI) * 180);
}
if (this.focus != _level0.Joey) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
}
if ((this.focus == _level0.Joey) && (this.tweening == true)) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
if (((_local2 - this._rotation) < this.rotationspeed) && ((_local2 - this._rotation) > (-this.rotationspeed))) {
this.tweening = false;
}
}
while (_level0.walls.hitTest(this._x, this._y + (this._height / 2), true)) {
this._y--;
}
while (_level0.walls.hitTest(this._x, this._y - (this._height / 2), true)) {
this._y++;
}
while (_level0.walls.hitTest(this._x + (this._width / 2), this._y, true)) {
this._x--;
}
while (_level0.walls.hitTest(this._x - (this._width / 2), this._y, true)) {
this._x++;
}
};
Symbol 171 MovieClip Frame 1
function fire() {
if (_level0.dontFire == true) {
return(undefined);
}
if (_global.mute == false) {
_global.sound("shot4", 40);
}
var _local3 = (this._rotation / 180) * Math.PI;
var _local5 = (Math.cos(_local3) * this.p._x) + this._x;
var _local4 = (Math.sin(_local3) * this.p._x) + this._y;
_local3 = _local3 + ((Math.random() * this.accuracyVar) - (Math.random() * this.accuracyVar));
var _local7 = (-bulletSpeed) * Math.cos(_local3);
var _local6 = (-bulletSpeed) * Math.sin(_local3);
_level0.attachMovie("bullet", getTimer(), _level0.getNextHighestDepth(), {_x:_local5, _y:_local4, xspeed:_local7, yspeed:_local6, power:this.firePower});
}
function damage(impact) {
this.hp = this.hp - impact;
if (this.hp <= 0) {
this._visible = false;
i = 0;
while (i < _level0.enemies.length) {
if (_level0.enemies[i] == this) {
_level0.enemies.splice(i, 1);
}
i++;
}
howManyLeft();
if (_global.mute == false) {
_global.sound("explosion1");
}
delete this.onEnterFrame;
}
}
function asessTarget() {
var _local10 = Math.sqrt(((this._x - _level0.Joey._x) * (this._x - _level0.Joey._x)) + ((this._y - _level0.Joey._y) * (this._y - _level0.Joey._y)));
var _local12 = Math.atan((this._y - _level0.Joey._y) / (this._x - _level0.Joey._x));
if ((this._x - _level0.Joey._x) < 0) {
_local12 = Math.PI + _local12;
}
var _local9 = -Math.cos(_local12);
var _local8 = -Math.sin(_local12);
var _local7 = false;
i = 0;
while (i < _local10) {
var _local4 = (_local9 * i) + this._x;
var _local5 = (_local8 * i) + this._y;
if (_level0.bkg.walls.hitTest(_local4, _local5, true)) {
_local7 = true;
break;
}
i++;
}
if (_local7 == true) {
var _local11;
var _local6 = 1000;
i = 0;
while (i < _level0.alternates.length) {
var _local2 = _level0.alternates[i];
var _local3 = Math.sqrt(((_local2._x - _level0.Joey._x) * (_local2._x - _level0.Joey._x)) + ((_local2._y - _level0.Joey._y) * (_local2._y - _level0.Joey._y)));
if (this.affinity == true) {
_local3 = Math.sqrt(((_local2._x - this._x) * (_local2._x - this._x)) + ((_local2._y - this._y) * (_local2._y - this._y)));
}
if (_local3 < _local6) {
_local11 = _local2;
_local6 = _local3;
}
i++;
}
this.focus = _local11;
} else if (this.focus != _level0.Joey) {
this.focus = _level0.Joey;
this.tweening = true;
}
}
function howManyLeft() {
if (_level0.enemies.length <= 0) {
_global.fadeIn("complete_screen", 5);
}
}
_level0.enemies.push(this);
if (!this.affinity) {
this.affinity = false;
}
this.tweening = false;
this.focus = _level0.Joey;
this.hp = 40;
this.firePower = 1;
this.speed = 0.25;
this.rotationspeed = 3;
this.bulletSpeed = 12;
this.count = 40;
this.minWait = 25;
this.maxWait = 40;
this.maxWait = this.maxWait - this.minWait;
this.xspeed = 0;
this.yspeed = 0;
this.friction = 0.85;
this.accuracyVar = 0;
this.accuracyVar = (this.accuracyVar / 180) * Math.PI;
this.onEnterFrame = function () {
if (_level0.frozen == true) {
return(undefined);
}
this.count--;
if (this.count <= 0) {
this.fire();
asessTarget();
this.count = Math.ceil((Math.random() * this.maxWait) + this.minWait);
}
if (this.count == 10) {
asessTarget();
}
if (this.count == 20) {
asessTarget();
}
if (this.count == 30) {
asessTarget();
}
if (this.count == 40) {
asessTarget();
}
if (this.count == 50) {
asessTarget();
}
var _local4 = {x:this._x, y:this._y};
var _local3 = Math.atan((_local4.y - this.focus._y) / (_local4.x - this.focus._x));
if ((_local4.x - this.focus._x) < 0) {
_local3 = Math.PI + _local3;
}
var _local2 = Math.ceil((_local3 / Math.PI) * 180);
if ((this.focus == _level0.Joey) && (this.tweening == false)) {
this._rotation = Math.ceil((_local3 / Math.PI) * 180);
}
if (this.focus != _level0.Joey) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
}
if ((this.focus == _level0.Joey) && (this.tweening == true)) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
if (((_local2 - this._rotation) < this.rotationspeed) && ((_local2 - this._rotation) > (-this.rotationspeed))) {
this.tweening = false;
}
}
while (_level0.walls.hitTest(this._x, this._y + (this._height / 2), true)) {
this._y--;
}
while (_level0.walls.hitTest(this._x, this._y - (this._height / 2), true)) {
this._y++;
}
while (_level0.walls.hitTest(this._x + (this._width / 2), this._y, true)) {
this._x--;
}
while (_level0.walls.hitTest(this._x - (this._width / 2), this._y, true)) {
this._x++;
}
};
Symbol 208 MovieClip Frame 1
function addMouseFunctionality(clip) {
clip.onMouseDown = function () {
if (clip.work != true) {
return(undefined);
}
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
if (_global.mute == false) {
_global.sound("select1");
}
_global.resetPowerUps();
_level0.frozen = false;
_global.bulletRemover.broadcastMessage("removeAllBullets");
_level0.nextPlace = (this.targetLevel + _global.levelFrameOffset) + 1;
_level0.gotoAndStop("blank");
Mouse.removeListener(clip);
delete clip.onMouseDown;
clip._parent.removeMovieClip();
}
};
Mouse.addListener(clip);
}
var sot = new timerObject(0.1, addMouseFunctionality, this);
this.onEnterFrame = function () {
if (this.work != true) {
return(undefined);
}
if ((Math.abs(_xmouse) < (this._width / 2)) && (Math.abs(_ymouse) < (this._height / 2))) {
txt.setTextFormat(yellow);
} else {
txt.setTextFormat(gray);
}
};
var gray = new TextFormat();
gray.color = 13421772 /* 0xCCCCCC */;
var yellow = new TextFormat();
yellow.color = 16776960 /* 0xFFFF00 */;
var black = new TextFormat();
black.color = 0;
Symbol 236 MovieClip Frame 1
function fire() {
if (_global.mute == false) {
_global.sound("player_fire");
}
var _local3 = Math.atan((this._y - _level0._ymouse) / (this._x - _level0._xmouse));
if ((this._x - _level0._xmouse) < 0) {
_local3 = Math.PI + _local3;
}
var _local5 = (Math.cos(_local3) * this.p._x) + this._x;
var _local4 = (Math.sin(_local3) * this.p._x) + this._y;
_local3 = _local3 + ((Math.random() * this.accuracyVar) - (Math.random() * this.accuracyVar));
var _local7 = (-bulletSpeed) * Math.cos(_local3);
var _local6 = (-bulletSpeed) * Math.sin(_local3);
if (this.firePower < 5) {
_level0.attachMovie("bullet", getTimer(), _level0.getNextHighestDepth(), {_x:_local5, _y:_local4, xspeed:_local7, yspeed:_local6, power:this.firePower, _xscale:this.bulletSize * 100, _yscale:this.bulletSize * 100});
}
if (this.firePower == 5) {
_level0.attachMovie("red_bullet", getTimer(), _level0.getNextHighestDepth(), {_x:_local5, _y:_local4, xspeed:_local7, yspeed:_local6, power:this.firePower, _xscale:this.bulletSize * 100, _yscale:this.bulletSize * 100});
}
}
function damage(impact) {
if (this.hp <= 0) {
return(undefined);
}
if (this.shield == true) {
this.shield = false;
return(undefined);
}
this.hp = this.hp - impact;
this.gotoAndPlay(2);
if (this.hp > 0) {
var _local3 = _level0.attachMovie("hp_txt", "hptext", _level0.getNextHighestDepth(), {_x:this._x, _y:this._y});
_local3.txt.text = String(this.hp);
}
if (this.hp <= 0) {
this.gotoAndPlay(12);
this.hp = 0;
_global.fadeIn("die_screen", 5);
}
_level0.hp_mc.bar._xscale = (this.hp / 5) * 100;
}
function addShootingFunctionality(clip) {
trace("YOU MAY SHOOT" + getTimer());
clip.onMouseDown = function () {
this.mouseisDown = true;
};
clip.onMouseUp = function () {
this.mouseisDown = false;
};
Mouse.addListener(this);
}
_level0.attachMovie("sayGo", "go_mc", _level0.getNextHighestDepth(), {_x:this._x, _y:this._y});
_level0.dontFire = true;
this.mouseisDown = false;
this.hp = 5;
this.shield = _global.shield;
this.firePower = _global.firePower;
this.bulletSize = Math.floor(_global.firePower);
this.walk = 0.85;
this.run = 1.35;
this.speed = this.walk;
this.initHeight = this._height - 10;
this.bulletSpeed = _global.bulletSpeed;
this.xspeed = 0.01;
this.yspeed = 0;
this.friction = 0.85;
this.accuracyVar = 0;
this.shootAgain = _global.shootAgain;
this.waitToShoot = this.shootAgain;
this.accuracyVar = (this.accuracyVar / 180) * Math.PI;
this.checkForBadGuys = 5;
this.onEnterFrame = function () {
if (_level0.frozen == true) {
return(undefined);
}
this._y = this._y + this.yspeed;
this._x = this._x + this.xspeed;
this.yspeed = this.yspeed * this.friction;
this.xspeed = this.xspeed * this.friction;
if ((Key.isDown(87) == true) || (Key.isDown(38) == true)) {
this.yspeed = this.yspeed - this.speed;
}
if ((Key.isDown(68) == true) || (Key.isDown(39) == true)) {
this.xspeed = this.xspeed + this.speed;
}
if ((Key.isDown(83) == true) || (Key.isDown(40) == true)) {
this.yspeed = this.yspeed + this.speed;
}
if ((Key.isDown(65) == true) || (Key.isDown(37) == true)) {
this.xspeed = this.xspeed - this.speed;
}
while (_level0.bkg.hitTest(this._x, this._y + this.initHeight, true)) {
this._y--;
trace("botton");
}
while (_level0.bkg.hitTest(this._x, this._y - this.initHeight, true)) {
this._y++;
trace("top");
}
while (_level0.bkg.hitTest(this._x + this.initHeight, this._y, true)) {
this._x--;
trace("left");
}
while (_level0.bkg.hitTest(this._x - this.initHeight, this._y, true)) {
this._x++;
trace("RIGHT");
}
waitToShoot--;
if ((this.mouseisDown == true) && (this.waitToShoot <= 0)) {
this.fire();
this.waitToShoot = this.shootAgain;
}
var _local2 = Math.atan((this._y - _level0._ymouse) / (this._x - _level0._xmouse));
if ((this._x - _level0._xmouse) < 0) {
_local2 = Math.PI + _local2;
}
this._rotation = Math.ceil((_local2 / Math.PI) * 180);
if ((this.checkForBadGuys <= 0) && (this._currentframe <= 10)) {
i = 0;
while (i < _level0.enemies.length) {
if (_level0.enemies[i].hitTest(this._x, this._y, true)) {
this.damage(5);
}
i++;
}
this.checkForBadGuys = 5;
}
this.checkForBadGuys--;
};
var to = new timerObject(0.1, addShootingFunctionality, this);
this.onKeyDown = function () {
if (Key.getCode() == 145) {
_global.fadeIn("complete_screen", 5);
_global.bulletRemover.broadcastMessage("removeAllBullets");
}
if (Key.getCode() == 80) {
if (_level0.frozen == false) {
_level0.frozen = true;
_global.fadeIn("pause_screen", 5);
} else {
_level0.frozen = false;
}
}
};
Key.addListener(this);
_level0.attachMovie("newHp", "hp_mc", _level0.getNextHighestDepth(), {_x:23.5, _y:376.4});
this.gotoAndStop(10);
Symbol 236 MovieClip Frame 10
stop();
Symbol 236 MovieClip Frame 25
stop();
Symbol 247 MovieClip Frame 1
stop();
_level0.alternates.push(this);
this._visible = false;
Symbol 249 MovieClip Frame 1
this._visible = false;
var i = 0;
while (i < _level0.enemies.length) {
if (_level0.enemies[i].hitTest(this._x, this._y, false)) {
_level0.enemies[i].affinity = true;
}
i++;
}
Symbol 284 MovieClip Frame 1
function fire() {
if (_level0.dontFire == true) {
return(undefined);
}
if (_global.mute == false) {
_global.blast("shot2");
}
var _local3 = (this._rotation / 180) * Math.PI;
var _local5 = (Math.cos(_local3) * this.p._x) + this._x;
var _local4 = (Math.sin(_local3) * this.p._x) + this._y;
_local3 = _local3 + ((Math.random() * this.accuracyVar) - (Math.random() * this.accuracyVar));
var _local7 = (-bulletSpeed) * Math.cos(_local3);
var _local6 = (-bulletSpeed) * Math.sin(_local3);
_level0.attachMovie("bullet", getTimer(), _level0.getNextHighestDepth(), {_x:_local5, _y:_local4, xspeed:_local7, yspeed:_local6, power:this.firePower, _xscale:400, _yscale:400});
}
function damage(impact) {
this.hp = this.hp - impact;
if (this.hp <= 0) {
this._visible = false;
i = 0;
while (i < _level0.enemies.length) {
if (_level0.enemies[i] == this) {
_level0.enemies.splice(i, 1);
}
i++;
}
howManyLeft();
if (_global.mute == false) {
_global.sound("explosion1");
}
delete this.onEnterFrame;
}
}
function asessTarget() {
var _local10 = Math.sqrt(((this._x - _level0.Joey._x) * (this._x - _level0.Joey._x)) + ((this._y - _level0.Joey._y) * (this._y - _level0.Joey._y)));
var _local12 = Math.atan((this._y - _level0.Joey._y) / (this._x - _level0.Joey._x));
if ((this._x - _level0.Joey._x) < 0) {
_local12 = Math.PI + _local12;
}
var _local9 = -Math.cos(_local12);
var _local8 = -Math.sin(_local12);
var _local7 = false;
i = 0;
while (i < _local10) {
var _local4 = (_local9 * i) + this._x;
var _local5 = (_local8 * i) + this._y;
if (_level0.bkg.walls.hitTest(_local4, _local5, true)) {
_local7 = true;
break;
}
i++;
}
if (_local7 == true) {
var _local11;
var _local6 = 1000;
i = 0;
while (i < _level0.alternates.length) {
var _local2 = _level0.alternates[i];
var _local3 = Math.sqrt(((_local2._x - _level0.Joey._x) * (_local2._x - _level0.Joey._x)) + ((_local2._y - _level0.Joey._y) * (_local2._y - _level0.Joey._y)));
if (this.affinity == true) {
_local3 = Math.sqrt(((_local2._x - this._x) * (_local2._x - this._x)) + ((_local2._y - this._y) * (_local2._y - this._y)));
}
if (_local3 < _local6) {
_local11 = _local2;
_local6 = _local3;
}
i++;
}
this.focus = _local11;
} else if (this.focus != _level0.Joey) {
this.focus = _level0.Joey;
this.tweening = true;
}
}
function howManyLeft() {
if (_level0.enemies.length <= 0) {
_global.fadeIn("complete_screen", 5);
}
}
_level0.enemies.push(this);
if (!this.affinity) {
this.affinity = false;
}
this.tweening = false;
this.focus = _level0.Joey;
this.hp = 40;
this.firePower = 2;
this.speed = 0.25;
this.rotationspeed = 3;
this.bulletSpeed = 4;
this.count = 10;
this.minWait = 50;
this.maxWait = 100;
this.maxWait = this.maxWait - this.minWait;
this.xspeed = 0;
this.yspeed = 0;
this.friction = 0.85;
this.accuracyVar = 0;
this.accuracyVar = (this.accuracyVar / 180) * Math.PI;
this.onEnterFrame = function () {
if (_level0.frozen == true) {
return(undefined);
}
this.count--;
if (this.count <= 0) {
this.fire();
asessTarget();
this.count = Math.ceil((Math.random() * this.maxWait) + this.minWait);
}
if (this.count == 10) {
asessTarget();
}
if (this.count == 20) {
asessTarget();
}
if (this.count == 30) {
asessTarget();
}
if (this.count == 40) {
asessTarget();
}
if (this.count == 50) {
asessTarget();
}
var _local4 = {x:this._x, y:this._y};
var _local3 = Math.atan((_local4.y - this.focus._y) / (_local4.x - this.focus._x));
if ((_local4.x - this.focus._x) < 0) {
_local3 = Math.PI + _local3;
}
var _local2 = Math.ceil((_local3 / Math.PI) * 180);
if ((this.focus == _level0.Joey) && (this.tweening == false)) {
this._rotation = Math.ceil((_local3 / Math.PI) * 180);
}
if (this.focus != _level0.Joey) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
}
if ((this.focus == _level0.Joey) && (this.tweening == true)) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
if (((_local2 - this._rotation) < this.rotationspeed) && ((_local2 - this._rotation) > (-this.rotationspeed))) {
this.tweening = false;
}
}
while (_level0.walls.hitTest(this._x, this._y + (this._height / 2), true)) {
this._y--;
}
while (_level0.walls.hitTest(this._x, this._y - (this._height / 2), true)) {
this._y++;
}
while (_level0.walls.hitTest(this._x + (this._width / 2), this._y, true)) {
this._x--;
}
while (_level0.walls.hitTest(this._x - (this._width / 2), this._y, true)) {
this._x++;
}
};
Symbol 308 MovieClip Frame 1
function fire() {
if (_level0.dontFire == true) {
return(undefined);
}
if (_global.mute == false) {
_global.blast("shot3");
}
var _local3 = (this._rotation / 180) * Math.PI;
var _local5 = (Math.cos(_local3) * this.p._x) + this._x;
var _local4 = (Math.sin(_local3) * this.p._x) + this._y;
_local3 = _local3 + ((Math.random() * this.accuracyVar) - (Math.random() * this.accuracyVar));
var _local7 = (-bulletSpeed) * Math.cos(_local3);
var _local6 = (-bulletSpeed) * Math.sin(_local3);
_level0.attachMovie("red_bullet", getTimer(), _level0.getNextHighestDepth(), {_x:_local5, _y:_local4, xspeed:_local7, yspeed:_local6, bounce:this.bounce, power:this.firePower, _xscale:600, _yscale:600});
}
function damage(impact) {
this.hp = this.hp - impact;
if (this.hp <= 0) {
this._visible = false;
i = 0;
while (i < _level0.enemies.length) {
if (_level0.enemies[i] == this) {
_level0.enemies.splice(i, 1);
}
i++;
}
howManyLeft();
if (_global.mute == false) {
_global.sound("explosion1");
}
delete this.onEnterFrame;
}
}
function asessTarget() {
var _local10 = Math.sqrt(((this._x - _level0.Joey._x) * (this._x - _level0.Joey._x)) + ((this._y - _level0.Joey._y) * (this._y - _level0.Joey._y)));
var _local12 = Math.atan((this._y - _level0.Joey._y) / (this._x - _level0.Joey._x));
if ((this._x - _level0.Joey._x) < 0) {
_local12 = Math.PI + _local12;
}
var _local9 = -Math.cos(_local12);
var _local8 = -Math.sin(_local12);
var _local7 = false;
i = 0;
while (i < _local10) {
var _local4 = (_local9 * i) + this._x;
var _local5 = (_local8 * i) + this._y;
if (_level0.bkg.walls.hitTest(_local4, _local5, true)) {
_local7 = true;
break;
}
i++;
}
if (_local7 == true) {
var _local11;
var _local6 = 1000;
i = 0;
while (i < _level0.alternates.length) {
var _local2 = _level0.alternates[i];
var _local3 = Math.sqrt(((_local2._x - _level0.Joey._x) * (_local2._x - _level0.Joey._x)) + ((_local2._y - _level0.Joey._y) * (_local2._y - _level0.Joey._y)));
if (this.affinity == true) {
_local3 = Math.sqrt(((_local2._x - this._x) * (_local2._x - this._x)) + ((_local2._y - this._y) * (_local2._y - this._y)));
}
if (_local3 < _local6) {
_local11 = _local2;
_local6 = _local3;
}
i++;
}
this.focus = _local11;
} else if (this.focus != _level0.Joey) {
this.focus = _level0.Joey;
this.tweening = true;
}
}
function howManyLeft() {
if (_level0.enemies.length <= 0) {
_global.fadeIn("complete_screen", 5);
}
}
_level0.enemies.push(this);
if (!this.affinity) {
this.affinity = false;
}
if (!this.bounce) {
this.bounce = 2;
}
this.tweening = false;
this.focus = _level0.Joey;
this.hp = 150;
this.firePower = 5;
this.speed = 0.25;
this.rotationspeed = 4;
this.bulletSpeed = 6;
this.count = 40;
this.minWait = 40;
this.maxWait = 60;
this.maxWait = this.maxWait - this.minWait;
this.xspeed = 0;
this.yspeed = 0;
this.friction = 0.85;
this.accuracyVar = 0;
this.accuracyVar = (this.accuracyVar / 180) * Math.PI;
this.onEnterFrame = function () {
if (_level0.frozen == true) {
return(undefined);
}
this.count--;
if (this.count <= 0) {
this.fire();
asessTarget();
this.count = Math.ceil((Math.random() * this.maxWait) + this.minWait);
}
if (this.count == 10) {
asessTarget();
}
if (this.count == 20) {
asessTarget();
}
if (this.count == 30) {
asessTarget();
}
if (this.count == 40) {
asessTarget();
}
if (this.count == 50) {
asessTarget();
}
var _local4 = {x:this._x, y:this._y};
var _local3 = Math.atan((_local4.y - this.focus._y) / (_local4.x - this.focus._x));
if ((_local4.x - this.focus._x) < 0) {
_local3 = Math.PI + _local3;
}
var _local2 = Math.ceil((_local3 / Math.PI) * 180);
if ((this.focus == _level0.Joey) && (this.tweening == false)) {
this._rotation = Math.ceil((_local3 / Math.PI) * 180);
}
if (this.focus != _level0.Joey) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
}
if ((this.focus == _level0.Joey) && (this.tweening == true)) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
if (((_local2 - this._rotation) < this.rotationspeed) && ((_local2 - this._rotation) > (-this.rotationspeed))) {
this.tweening = false;
}
}
while (_level0.walls.hitTest(this._x, this._y + (this._height / 2), true)) {
this._y--;
}
while (_level0.walls.hitTest(this._x, this._y - (this._height / 2), true)) {
this._y++;
}
while (_level0.walls.hitTest(this._x + (this._width / 2), this._y, true)) {
this._x--;
}
while (_level0.walls.hitTest(this._x - (this._width / 2), this._y, true)) {
this._x++;
}
};
Symbol 334 MovieClip Frame 1
function fire() {
if (_level0.dontFire == true) {
return(undefined);
}
if (this.focus != _level0.Joey) {
return(undefined);
}
if (_global.mute == false) {
_global.sound("shot5", 10);
}
var _local3 = (this._rotation / 180) * Math.PI;
var _local5 = (Math.cos(_local3) * this.p._x) + this._x;
var _local4 = (Math.sin(_local3) * this.p._x) + this._y;
_local3 = _local3 + ((Math.random() * this.accuracyVar) - (Math.random() * this.accuracyVar));
var _local7 = (-bulletSpeed) * Math.cos(_local3);
var _local6 = (-bulletSpeed) * Math.sin(_local3);
_level0.attachMovie("bullet", getTimer(), _level0.getNextHighestDepth(), {_x:_local5, _y:_local4, xspeed:_local7, yspeed:_local6, power:this.firePower});
}
function damage(impact) {
this.hp = this.hp - impact;
if (this.hp <= 0) {
this._visible = false;
i = 0;
while (i < _level0.enemies.length) {
if (_level0.enemies[i] == this) {
_level0.enemies.splice(i, 1);
}
i++;
}
howManyLeft();
if (_global.mute == false) {
_global.sound("explosion1");
}
delete this.onEnterFrame;
}
}
function asessTarget() {
var _local10 = Math.sqrt(((this._x - _level0.Joey._x) * (this._x - _level0.Joey._x)) + ((this._y - _level0.Joey._y) * (this._y - _level0.Joey._y)));
var _local12 = Math.atan((this._y - _level0.Joey._y) / (this._x - _level0.Joey._x));
if ((this._x - _level0.Joey._x) < 0) {
_local12 = Math.PI + _local12;
}
var _local9 = -Math.cos(_local12);
var _local8 = -Math.sin(_local12);
var _local7 = false;
i = 0;
while (i < _local10) {
var _local4 = (_local9 * i) + this._x;
var _local5 = (_local8 * i) + this._y;
if (_level0.bkg.walls.hitTest(_local4, _local5, true)) {
_local7 = true;
break;
}
i++;
}
if (_local7 == true) {
var _local11;
var _local6 = 1000;
i = 0;
while (i < _level0.alternates.length) {
var _local2 = _level0.alternates[i];
var _local3 = Math.sqrt(((_local2._x - _level0.Joey._x) * (_local2._x - _level0.Joey._x)) + ((_local2._y - _level0.Joey._y) * (_local2._y - _level0.Joey._y)));
if (this.affinity == true) {
_local3 = Math.sqrt(((_local2._x - this._x) * (_local2._x - this._x)) + ((_local2._y - this._y) * (_local2._y - this._y)));
}
if (_local3 < _local6) {
_local11 = _local2;
_local6 = _local3;
}
i++;
}
this.focus = _local11;
} else if (this.focus != _level0.Joey) {
this.focus = _level0.Joey;
this.tweening = true;
}
}
function howManyLeft() {
if (_level0.enemies.length <= 0) {
_global.fadeIn("complete_screen", 5);
}
}
_level0.enemies.push(this);
if (!this.affinity) {
this.affinity = false;
}
this.focus = _level0.Joey;
this.tweening = false;
this.hp = 50;
this.firePower = 1;
this.speed = 0.25;
this.rotationspeed = 3;
this.bulletSpeed = 8;
this.count = 30;
this.minWait = 3;
this.maxWait = 4;
this.maxWait = this.maxWait - this.minWait;
this.xspeed = 0;
this.yspeed = 0;
this.friction = 0.85;
this.accuracyVar = 0;
this.accuracyVar = (this.accuracyVar / 180) * Math.PI;
this.onEnterFrame = function () {
if (_level0.frozen == true) {
return(undefined);
}
this.count--;
if (this.count <= 0) {
this.fire();
asessTarget();
this.count = Math.ceil((Math.random() * this.maxWait) + this.minWait);
}
if (this.count == 10) {
asessTarget();
}
if (this.count == 20) {
asessTarget();
}
if (this.count == 30) {
asessTarget();
}
if (this.count == 40) {
asessTarget();
}
if (this.count == 50) {
asessTarget();
}
var _local4 = {x:this._x, y:this._y};
var _local3 = Math.atan((_local4.y - this.focus._y) / (_local4.x - this.focus._x));
if ((_local4.x - this.focus._x) < 0) {
_local3 = Math.PI + _local3;
}
var _local2 = Math.ceil((_local3 / Math.PI) * 180);
if ((this.focus == _level0.Joey) && (this.tweening == false)) {
this._rotation = Math.ceil((_local3 / Math.PI) * 180);
}
if (this.focus != _level0.Joey) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
}
if ((this.focus == _level0.Joey) && (this.tweening == true)) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
if (((_local2 - this._rotation) < this.rotationspeed) && ((_local2 - this._rotation) > (-this.rotationspeed))) {
this.tweening = false;
}
}
while (_level0.walls.hitTest(this._x, this._y + (this._height / 2), true)) {
this._y--;
}
while (_level0.walls.hitTest(this._x, this._y - (this._height / 2), true)) {
this._y++;
}
while (_level0.walls.hitTest(this._x + (this._width / 2), this._y, true)) {
this._x--;
}
while (_level0.walls.hitTest(this._x - (this._width / 2), this._y, true)) {
this._x++;
}
};
Symbol 337 MovieClip Frame 1
function fire() {
if (_level0.dontFire == true) {
return(undefined);
}
if (_global.mute == false) {
_global.sound("shot", 10);
}
var _local3 = (this._rotation / 180) * Math.PI;
var _local5 = (Math.cos(_local3) * this.p._x) + this._x;
var _local4 = (Math.sin(_local3) * this.p._x) + this._y;
_local3 = _local3 + ((Math.random() * this.accuracyVar) - (Math.random() * this.accuracyVar));
var _local7 = (-bulletSpeed) * Math.cos(_local3);
var _local6 = (-bulletSpeed) * Math.sin(_local3);
_level0.attachMovie("bullet", getTimer(), _level0.getNextHighestDepth(), {_x:_local5, _y:_local4, xspeed:_local7, yspeed:_local6, power:this.firePower});
}
function damage(impact) {
this.hp = this.hp - impact;
if (this.hp <= 0) {
this._visible = false;
i = 0;
while (i < _level0.enemies.length) {
if (_level0.enemies[i] == this) {
_level0.enemies.splice(i, 1);
}
i++;
}
howManyLeft();
if (_global.mute == false) {
_global.sound("explosion1");
}
delete this.onEnterFrame;
}
}
function asessTarget() {
var _local10 = Math.sqrt(((this._x - _level0.Joey._x) * (this._x - _level0.Joey._x)) + ((this._y - _level0.Joey._y) * (this._y - _level0.Joey._y)));
var _local12 = Math.atan((this._y - _level0.Joey._y) / (this._x - _level0.Joey._x));
if ((this._x - _level0.Joey._x) < 0) {
_local12 = Math.PI + _local12;
}
var _local9 = -Math.cos(_local12);
var _local8 = -Math.sin(_local12);
var _local7 = false;
i = 0;
while (i < _local10) {
var _local4 = (_local9 * i) + this._x;
var _local5 = (_local8 * i) + this._y;
if (_level0.bkg.walls.hitTest(_local4, _local5, true)) {
_local7 = true;
break;
}
i++;
}
if (_local7 == true) {
var _local11;
var _local6 = 1000;
i = 0;
while (i < _level0.alternates.length) {
var _local2 = _level0.alternates[i];
var _local3 = Math.sqrt(((_local2._x - _level0.Joey._x) * (_local2._x - _level0.Joey._x)) + ((_local2._y - _level0.Joey._y) * (_local2._y - _level0.Joey._y)));
if (this.affinity == true) {
_local3 = Math.sqrt(((_local2._x - this._x) * (_local2._x - this._x)) + ((_local2._y - this._y) * (_local2._y - this._y)));
}
if (_local3 < _local6) {
_local11 = _local2;
_local6 = _local3;
}
i++;
}
this.focus = _local11;
} else if (this.focus != _level0.Joey) {
this.focus = _level0.Joey;
this.tweening = true;
}
}
function howManyLeft() {
if (_level0.enemies.length <= 0) {
_global.fadeIn("complete_screen", 5);
}
}
_level0.enemies.push(this);
if (!this.affinity) {
this.affinity = false;
}
this.focus = _level0.Joey;
this.tweening = false;
this.hp = 60;
this.firePower = 1;
this.speed = 0.25;
this.rotationspeed = 3;
this.bulletSpeed = 15;
this.count = 5;
this.minWait = 5;
this.maxWait = 6;
this.maxWait = this.maxWait - this.minWait;
this.xspeed = 0;
this.yspeed = 0;
this.friction = 0.85;
this.accuracyVar = 0;
this.accuracyVar = (this.accuracyVar / 180) * Math.PI;
this.onEnterFrame = function () {
if (_level0.frozen == true) {
return(undefined);
}
this.count--;
if (this.count <= 0) {
this.fire();
asessTarget();
this.count = Math.ceil((Math.random() * this.maxWait) + this.minWait);
}
if (this.count == 10) {
asessTarget();
}
if (this.count == 20) {
asessTarget();
}
if (this.count == 30) {
asessTarget();
}
if (this.count == 40) {
asessTarget();
}
if (this.count == 50) {
asessTarget();
}
var _local4 = {x:this._x, y:this._y};
var _local3 = Math.atan((_local4.y - this.focus._y) / (_local4.x - this.focus._x));
if ((_local4.x - this.focus._x) < 0) {
_local3 = Math.PI + _local3;
}
var _local2 = Math.ceil((_local3 / Math.PI) * 180);
if ((this.focus == _level0.Joey) && (this.tweening == false)) {
this._rotation = Math.ceil((_local3 / Math.PI) * 180);
}
if (this.focus != _level0.Joey) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
}
if ((this.focus == _level0.Joey) && (this.tweening == true)) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
if (((_local2 - this._rotation) < this.rotationspeed) && ((_local2 - this._rotation) > (-this.rotationspeed))) {
this.tweening = false;
}
}
while (_level0.walls.hitTest(this._x, this._y + (this._height / 2), true)) {
this._y--;
}
while (_level0.walls.hitTest(this._x, this._y - (this._height / 2), true)) {
this._y++;
}
while (_level0.walls.hitTest(this._x + (this._width / 2), this._y, true)) {
this._x--;
}
while (_level0.walls.hitTest(this._x - (this._width / 2), this._y, true)) {
this._x++;
}
};
Symbol 381 MovieClip Frame 1
function fire() {
if (this.focus != _level0.Joey) {
return(undefined);
}
if (_global.mute == false) {
_global.blast();
}
var _local3 = (this._rotation / 180) * Math.PI;
var _local5 = (Math.cos(_local3) * this.p._x) + this._x;
var _local4 = (Math.sin(_local3) * this.p._x) + this._y;
_local3 = _local3 + ((Math.random() * this.accuracyVar) - (Math.random() * this.accuracyVar));
var _local7 = (-bulletSpeed) * Math.cos(_local3);
var _local6 = (-bulletSpeed) * Math.sin(_local3);
_level0.attachMovie("bullet", String(Math.random()), _level0.getNextHighestDepth(), {_x:_local5, _y:_local4, xspeed:_local7, yspeed:_local6, power:this.firePower});
}
function damage(impact) {
this.hp = this.hp - impact;
_level0.boss_hp_mc.hp_txt.text = String(this.hp);
_level0.boss_hp_mc.bar._width = (this.hp / 500) * 100;
if (this.hp <= 0) {
this._visible = false;
i = 0;
while (i < _level0.enemies.length) {
if (_level0.enemies[i] == this) {
_level0.enemies.splice(i, 1);
}
i++;
}
_root.kongregateStats.submit("boss", 1);
howManyLeft();
if (_global.mute == false) {
_global.sound("explosion1");
}
delete this.onEnterFrame;
}
}
function asessTarget() {
var _local13 = (this._rotation / 180) * Math.PI;
this.xv = (-Math.cos(_local13)) * this.speed;
this.yv = (-Math.sin(_local13)) * this.speed;
var _local10 = Math.sqrt(((this._x - _level0.Joey._x) * (this._x - _level0.Joey._x)) + ((this._y - _level0.Joey._y) * (this._y - _level0.Joey._y)));
var _local12 = Math.atan((this._y - _level0.Joey._y) / (this._x - _level0.Joey._x));
if ((this._x - _level0.Joey._x) < 0) {
_local12 = Math.PI + _local12;
}
var _local9 = -Math.cos(_local12);
var _local8 = -Math.sin(_local12);
var _local7 = false;
i = 0;
while (i < _local10) {
var _local4 = (_local9 * i) + this._x;
var _local5 = (_local8 * i) + this._y;
if (_level0.bkg.walls.hitTest(_local4, _local5, true)) {
_local7 = true;
break;
}
i++;
}
if (_local7 == true) {
var _local11;
var _local6 = 1000;
i = 0;
while (i < _level0.alternates.length) {
var _local2 = _level0.alternates[i];
var _local3 = Math.sqrt(((_local2._x - _level0.Joey._x) * (_local2._x - _level0.Joey._x)) + ((_local2._y - _level0.Joey._y) * (_local2._y - _level0.Joey._y)));
if (this.affinity == true) {
_local3 = Math.sqrt(((_local2._x - this._x) * (_local2._x - this._x)) + ((_local2._y - this._y) * (_local2._y - this._y)));
}
if (_local3 < _local6) {
_local11 = _local2;
_local6 = _local3;
}
i++;
}
this.focus = _local11;
} else if (this.focus != _level0.Joey) {
this.focus = _level0.Joey;
this.tweening = true;
}
}
function howManyLeft() {
if (_level0.enemies.length <= 0) {
_level0.boss_hp_mc.removeMovieClip();
_global.fadeIn("complete_screen", 5);
}
}
function changeBehavior() {
this.replaceTime = Math.floor(Math.random() * 100) + 80;
this.minWait = Math.floor(Math.random() * 5);
this.maxWait = this.minWait + Math.floor(Math.random() * 10);
this.maxWait = this.maxWait - this.minWait;
this.maxFires = Math.ceil(Math.random() * 2);
this.accuracyVar = Math.floor(Math.random() * 90);
this.accuracyVar = (this.accuracyVar / 180) * Math.PI;
this.bulletSpeed = 10 / this.maxFires;
this.speed = 0.5 + Math.random();
}
function specialFire() {
i = 0;
while (i < maxFires) {
fire();
i++;
}
}
_level0.enemies.push(this);
if (!this.affinity) {
this.affinity = false;
}
this.focus = _level0.Joey;
this.tweening = false;
this.hp = 500;
this.firePower = 1;
this.speed = 0.25;
this.rotationspeed = 3;
this.bulletSpeed = 8;
this.count = 25;
this.minWait = 3;
this.maxWait = 4;
this.maxWait = this.maxWait - this.minWait;
this.xspeed = 2.25;
this.yspeed = 1.3;
this.xv = 0.25;
this.yv = 0.25;
this.friction = 0.85;
this.accuracyVar = 0;
this.accuracyVar = (this.accuracyVar / 180) * Math.PI;
this.replaceTime = 125;
this.maxFires = 1;
this.speed = 1;
this.onEnterFrame = function () {
if (_level0.frozen == true) {
return(undefined);
}
this.yspeed = this.yspeed + this.yv;
this.xspeed = this.xspeed + this.xv;
this._y = this._y + this.yspeed;
this._x = this._x + this.xspeed;
this.yspeed = this.yspeed * this.friction;
this.xspeed = this.xspeed * this.friction;
this.count--;
this.replaceTime--;
if (replaceTime <= 0) {
changeBehavior();
}
if (this.count <= 0) {
this.specialFire();
asessTarget();
this.count = Math.ceil((Math.random() * this.maxWait) + this.minWait);
}
if (this.count == 10) {
asessTarget();
}
if (this.count == 20) {
asessTarget();
}
if (this.count == 30) {
asessTarget();
}
if (this.count == 40) {
asessTarget();
}
if (this.count == 50) {
asessTarget();
}
var _local4 = {x:this._x, y:this._y};
var _local3 = Math.atan((_local4.y - this.focus._y) / (_local4.x - this.focus._x));
if ((_local4.x - this.focus._x) < 0) {
_local3 = Math.PI + _local3;
}
var _local2 = Math.ceil((_local3 / Math.PI) * 180);
if ((this.focus == _level0.Joey) && (this.tweening == false)) {
this._rotation = Math.ceil((_local3 / Math.PI) * 180);
}
if (this.focus != _level0.Joey) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
}
if ((this.focus == _level0.Joey) && (this.tweening == true)) {
if (_local2 > 180) {
_local2 = _local2 - 360;
}
if ((_local2 - this._rotation) > this.rotationspeed) {
this._rotation = this._rotation + this.rotationspeed;
}
if ((_local2 - this._rotation) < (-this.rotationspeed)) {
this._rotation = this._rotation - this.rotationspeed;
}
if (((_local2 - this._rotation) < this.rotationspeed) && ((_local2 - this._rotation) > (-this.rotationspeed))) {
this.tweening = false;
}
}
while (_level0.bkg.walls.hitTest(this._x, this._y + (this._height / 2), true)) {
this._y--;
this.yspeed = 0;
this.yv = Math.abs(this.yv) * -1;
}
while (_level0.bkg.walls.hitTest(this._x, this._y - (this._height / 2), true)) {
this._y++;
this.yspeed = 0;
this.yv = Math.abs(this.yv);
}
while (_level0.bkg.walls.hitTest(this._x + (this._width / 2), this._y, true)) {
this._x--;
this.xspeed = 0;
this.xv = Math.abs(this.xv) * -1;
}
while (_level0.bkg.walls.hitTest(this._x - (this._width / 2), this._y, true)) {
this._x++;
this.xspeed = 0;
this.xv = Math.abs(this.xv);
}
};
_level0.boss_hp_mc.removeMovieClip();
_level0.attachMovie("boss_hp", "boss_hp_mc", _level0.getNextHighestDepth(), {_x:420.5, _y:366.4});