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;
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);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&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__("2a33e923", this, 10301, true);
mochi.MochiServices.connect("4d04485a7658aca6");
Frame 10
function beginGame() {
levelScores = new Array();
userData = SharedObject.getLocal("vWars");
unlocked = SharedObject.getLocal("vlevels");
bRenderGlow = true;
bCanChange = true;
particleLimit = 4;
if (unlocked.data.levels != undefined) {
unlockedLevels = unlocked.data.levels;
} else {
unlocked.data.levels = 1;
unlockedLevels = 1;
}
if (userData.data.bPlayed != undefined) {
levelScores[0] = 0;
levelScores[1] = userData.data.lvl_1;
levelScores[2] = userData.data.lvl_2;
levelScores[3] = userData.data.lvl_3;
levelScores[4] = userData.data.lvl_4;
levelScores[5] = userData.data.lvl_5;
levelScores[6] = userData.data.lvl_6;
levelScores[7] = userData.data.lvl_7;
levelScores[8] = userData.data.lvl_8;
levelScores[9] = userData.data.lvl_9;
levelScores[10] = userData.data.lvl_10;
levelScores[11] = userData.data.lvl_11;
levelScores[12] = userData.data.lvl_12;
levelScores[13] = userData.data.lvl_13;
levelScores[14] = userData.data.lvl_14;
levelScores[15] = userData.data.lvl_15;
levelScores[16] = userData.data.lvl_16;
levelScores[17] = userData.data.lvl_17;
levelScores[18] = userData.data.lvl_18;
levelScores[19] = userData.data.lvl_19;
levelScores[20] = userData.data.lvl_20;
levelScores[21] = userData.data.lvl_21;
levelScores[22] = userData.data.lvl_22;
levelScores[23] = userData.data.lvl_23;
levelScores[24] = userData.data.lvl_24;
levelScores[25] = userData.data.lvl_25;
levelScores[26] = userData.data.lvl_26;
} else {
userData.data.bPlayed = true;
userData.data.lvl_1 = 0;
userData.data.lvl_2 = 0;
userData.data.lvl_3 = 0;
userData.data.lvl_4 = 0;
userData.data.lvl_5 = 0;
userData.data.lvl_6 = 0;
userData.data.lvl_7 = 0;
userData.data.lvl_8 = 0;
userData.data.lvl_9 = 0;
userData.data.lvl_10 = 0;
userData.data.lvl_11 = 0;
userData.data.lvl_12 = 0;
userData.data.lvl_13 = 0;
userData.data.lvl_14 = 0;
userData.data.lvl_15 = 0;
userData.data.lvl_16 = 0;
userData.data.lvl_17 = 0;
userData.data.lvl_18 = 0;
userData.data.lvl_19 = 0;
userData.data.lvl_20 = 0;
userData.data.lvl_21 = 0;
userData.data.lvl_22 = 0;
userData.data.lvl_23 = 0;
userData.data.lvl_24 = 0;
userData.data.lvl_25 = 0;
userData.data.lvl_26 = 0;
levelScores[1] = userData.data.lvl_1;
levelScores[2] = userData.data.lvl_2;
levelScores[3] = userData.data.lvl_3;
levelScores[4] = userData.data.lvl_4;
levelScores[5] = userData.data.lvl_5;
levelScores[6] = userData.data.lvl_6;
levelScores[7] = userData.data.lvl_7;
levelScores[8] = userData.data.lvl_8;
levelScores[9] = userData.data.lvl_9;
levelScores[10] = userData.data.lvl_10;
levelScores[11] = userData.data.lvl_11;
levelScores[12] = userData.data.lvl_12;
levelScores[13] = userData.data.lvl_13;
levelScores[14] = userData.data.lvl_14;
levelScores[15] = userData.data.lvl_15;
levelScores[16] = userData.data.lvl_16;
levelScores[17] = userData.data.lvl_17;
levelScores[18] = userData.data.lvl_18;
levelScores[19] = userData.data.lvl_19;
levelScores[20] = userData.data.lvl_20;
levelScores[21] = userData.data.lvl_21;
levelScores[22] = userData.data.lvl_22;
levelScores[23] = userData.data.lvl_23;
levelScores[24] = userData.data.lvl_24;
levelScores[25] = userData.data.lvl_25;
levelScores[26] = userData.data.lvl_26;
}
this.framecounter = 0;
if (endScreen != undefined) {
removeMC(endScreen);
}
if (music == undefined) {
bitmap = new flash.display.BitmapData(600, 440, true, 0);
this.createEmptyMovieClip("emty", 1);
blurf = new flash.filters.BlurFilter(45, 45, 1);
emty.filters = [blurf];
emty.attachBitmap(bitmap, 0);
emty._alpha = 60;
attachMovie("music", "music", 21, {_x:0, _y:0});
attachMovie("sfx", "sfx", 22, {_x:0, _y:0});
}
Mouse.hide();
attachMovie("cHair", "cHair", 20, {_x:300, _y:220});
attachMovie("mainMenu", "menu", 11, {_x:300, _y:100});
menu.gotoAndStop(1);
playerScore = 0;
playerLives = 0;
playerMulti = 0;
playerBomb = 0;
levelScore = 0;
}
function newGame() {
bLevelSet = true;
removeMC(menu);
currentLevel = 0;
playerScore = 0;
playerLives = 5;
playerMulti = 1;
bFreeGame = false;
firstPlay = true;
enemyTypes = new Array();
enemys = new Array();
KillCount = 0;
createSpawners();
inf = attachMovie("levelInfo", "inf", _root.getNextHighestDepth(), {_x:0, _y:0});
inf._alpha = 0;
inf.gotoAndStop(28);
firstPlay = false;
}
function startLevel() {
addedScore = 0;
i = 1;
while (i < currentLevel) {
addedScore = addedScore + levelScores[i];
i++;
}
playerScore = addedScore;
hsapi.startGame("Score Attack", currentLevel, addedScore, null);
}
function newFreeGame() {
removeMC(menu);
currentLevel = 0;
playerScore = 0;
playerLives = 5;
playerMulti = 1;
bFreeGame = true;
hsapi.startGame("Arcade", 1, 0, null);
enemyTypes = new Array();
enemys = new Array();
KillCount = 0;
createPlayer();
createSpawners();
spawner.bCanSpawn = true;
getNextLevel();
bLevelSet = false;
}
function createPlayer() {
attachMovie("player", "player", 5, {_x:300, _y:220});
sfx.spawn.start();
playerLives--;
playerBomb = 1;
playerWeapon = 1;
}
function reCreatePlayer() {
player.clearInterval(player.firetimer);
attachMovie("player", "player", 5, {_x:300, _y:220});
sfx.spawn.start();
}
function createSpawners() {
attachMovie("spawner", "spawner", 9, {_x:300, _y:220});
}
function onMouseDown() {
player.bFiring = true;
}
function onMouseUp() {
player.bFiring = false;
}
function removeMC(mc) {
var _local2 = _root.getInstanceAtDepth(0);
mc.swapDepths(0);
mc.removeMovieClip();
if (_local2 != undefined) {
_local2.swapDepths(0);
}
}
function playerDied() {
attachMovie("smartBomb", "sm", _root.getNextHighestDepth(), {_x:0, _y:0});
sfx.playerDeath.start();
removeMC(player);
spawner.bCanSpawn = false;
if (playerLives > 0) {
KillCount = 0;
playerMulti = 0;
playerWeapon = 0;
spawntimer = setInterval(spawntime, 1500);
} else {
endGame();
}
}
function endGame() {
MochiAd.showInterLevelAd({id:"4d04485a7658aca6", res:"600x480", ad_finished:function () {
removeMC(cHair);
Mouse.show();
attachMovie("endScreen", "endScreen", 11, {_x:300, _y:100});
hsapi.endGame(currentLevel, playerScore, null);
}});
}
function createBomb() {
spawner.bCanSpawn = false;
attachMovie("flasher", "flasher", _root.getNextHighestDepth(), {_x:0, _y:0});
attachMovie("smartBomb", "sm", _root.getNextHighestDepth(), {_x:0, _y:0});
sfx.playerDeath.start();
bombtimer = setInterval(bombtime, 1500);
}
function getNextLevel() {
currentLevel++;
setLevel(currentLevel);
unlockedLevels = currentLevel;
if (!bFreeGame) {
spawner.bCanSpawn = false;
attachMovie("smartBomb", "sm", _root.getNextHighestDepth(), {_x:0, _y:0});
player.hideSelf();
inf = attachMovie("levelInfo", "inf", _root.getNextHighestDepth(), {_x:0, _y:0});
inf._alpha = 0;
if (firstPlay == true) {
inf.gotoAndStop(28);
firstPlay = false;
} else {
inf.gotoAndStop(currentLevel);
}
}
spawner.spawnCount = 0;
}
function setLevel(num) {
spawner.spawnCount = 0;
bBosslevel = false;
switch (num) {
case 1 :
maxEnemys = 3;
levelCount = 0;
levelComplete = 50;
enemyTypes.removeAll();
enemyTypes[0] = "enemySquare";
enemyTypes[1] = "enemyCirc";
enemyVar = 2;
break;
case 2 :
maxEnemys = 6;
levelCount = 0;
levelComplete = 70;
enemyTypes.removeAll();
enemyTypes[0] = "enemySquare";
enemyTypes[1] = "enemyCirc";
enemyVar = 2;
break;
case 3 :
maxEnemys = 8;
levelCount = 0;
levelComplete = 90;
enemyTypes.removeAll();
enemyTypes[0] = "enemysquid";
enemyVar = 1;
break;
case 4 :
maxEnemys = 6;
levelCount = 0;
levelComplete = 120;
enemyTypes.removeAll();
enemyTypes[0] = "enemyTracer";
enemyVar = 1;
break;
case 5 :
maxEnemys = 10;
levelCount = 0;
levelComplete = 140;
enemyTypes.removeAll();
enemyTypes[0] = "enemySquare";
enemyTypes[1] = "enemyCirc";
enemyTypes[2] = "enemyCirc";
enemyVar = 3;
break;
case 6 :
maxEnemys = 10;
levelCount = 0;
levelComplete = 160;
enemyTypes.removeAll();
enemyTypes[0] = "enamyTri";
enemyVar = 1;
break;
case 7 :
maxEnemys = 10;
levelCount = 0;
levelComplete = 200;
enemyTypes.removeAll();
enemyTypes[0] = "enamyTri";
enemyTypes[1] = "enemySquare";
enemyTypes[2] = "enemyCirc";
enemyTypes[3] = "enemyTracer";
enemyVar = 4;
break;
case 8 :
maxEnemys = 12;
levelCount = 0;
levelComplete = 200;
enemyTypes.removeAll();
enemyTypes[0] = "enemysquid";
enemyTypes[1] = "enemysquid";
enemyTypes[2] = "enemyCirc";
enemyVar = 3;
break;
case 9 :
maxEnemys = 14;
levelCount = 0;
levelComplete = 250;
enemyTypes.removeAll();
enemyTypes[0] = "enemysquid";
enemyTypes[1] = "enemysquid";
enemyTypes[2] = "enemyCirc";
enemyTypes[3] = "enamyTri";
enemyVar = 4;
break;
case 10 :
maxEnemys = 16;
levelCount = 0;
levelComplete = 250;
enemyTypes.removeAll();
enemyTypes[0] = "enemysquid2";
enemyTypes[1] = "enemysquid2";
enemyTypes[2] = "enemyCirc";
enemyVar = 3;
break;
case 11 :
maxEnemys = 8;
levelCount = 0;
levelComplete = 150;
enemyTypes.removeAll();
enemyTypes[0] = "enemyTracer";
enemyTypes[1] = "enemyTracer";
enemyTypes[2] = "enemyTracer";
enemyTypes[3] = "enemyTracer2";
enemyTypes[4] = "enemyTracer";
enemyTypes[5] = "enemyTracer";
enemyVar = 6;
break;
case 12 :
maxEnemys = 8;
levelCount = 0;
levelComplete = 150;
enemyTypes.removeAll();
enemyTypes[0] = "enemysquid2";
enemyTypes[1] = "enamyTri";
enemyTypes[2] = "enemyTracer2";
enemyVar = 3;
break;
case 13 :
maxEnemys = 8;
levelCount = 0;
levelComplete = 250;
enemyTypes.removeAll();
enemyTypes[0] = "enemySpam";
enemyTypes[1] = "enemySpam";
enemyVar = 2;
break;
case 14 :
maxEnemys = 10;
levelCount = 0;
levelComplete = 150;
enemyTypes.removeAll();
enemyTypes[0] = "enemyTracer";
enemyTypes[1] = "enemyTracer";
enemyTypes[2] = "enemyTracer2";
enemyVar = 3;
break;
case 15 :
maxEnemys = 10;
levelCount = 0;
levelComplete = 200;
enemyTypes.removeAll();
enemyTypes[0] = "enemySquare";
enemyTypes[1] = "enemyCirc";
enemyVar = 2;
break;
case 16 :
maxEnemys = 18;
levelCount = 0;
levelComplete = 200;
enemyTypes.removeAll();
enemyTypes[0] = "enemySquare";
enemyTypes[1] = "enemyCirc";
enemyVar = 2;
break;
case 17 :
maxEnemys = 16;
levelCount = 0;
levelComplete = 250;
enemyTypes.removeAll();
enemyTypes[0] = "enemysquid";
enemyVar = 1;
break;
case 18 :
maxEnemys = 10;
levelCount = 0;
levelComplete = 300;
enemyTypes.removeAll();
enemyTypes[0] = "enemyTracer";
enemyTypes[1] = "enemysquid";
enemyVar = 2;
break;
case 19 :
maxEnemys = 16;
levelCount = 0;
levelComplete = 300;
enemyTypes.removeAll();
enemyTypes[0] = "enemySquare";
enemyTypes[1] = "enemyCirc";
enemyVar = 2;
break;
case 20 :
maxEnemys = 14;
levelCount = 0;
levelComplete = 250;
enemyTypes.removeAll();
enemyTypes[0] = "enamyTri";
enemyTypes[1] = "enamyTri";
enemyTypes[2] = "enemySpam";
enemyVar = 3;
break;
case 21 :
maxEnemys = 16;
levelCount = 0;
levelComplete = 250;
enemyTypes.removeAll();
enemyTypes[0] = "enamyTri";
enemyTypes[1] = "enemySquare";
enemyTypes[2] = "enemyCirc";
enemyTypes[3] = "enemyTracer";
enemyTypes[4] = "enemysquid";
enemyVar = 5;
break;
case 22 :
maxEnemys = 16;
levelCount = 0;
levelComplete = 250;
enemyTypes.removeAll();
enemyTypes[0] = "enemysquid2";
enemyTypes[1] = "enemysquid";
enemyTypes[2] = "enemyCirc";
enemyVar = 3;
break;
case 23 :
maxEnemys = 16;
levelCount = 0;
levelComplete = 300;
enemyTypes.removeAll();
enemyTypes[0] = "enemysquid2";
enemyTypes[1] = "enemysquid";
enemyTypes[2] = "enemyCirc";
enemyTypes[3] = "enamyTri";
enemyVar = 4;
break;
case 24 :
maxEnemys = 12;
levelCount = 0;
levelComplete = 300;
enemyTypes.removeAll();
enemyTypes[0] = "enemysquid2";
enemyTypes[1] = "enamyTri";
enemyTypes[2] = "enemyTracer2";
enemyVar = 3;
break;
case 25 :
maxEnemys = 14;
levelCount = 0;
levelComplete = 300;
enemyTypes.removeAll();
enemyTypes[0] = "enemySpam";
enemyTypes[1] = "enemyCirc";
enemyTypes[2] = "enemysquid2";
enemyVar = 3;
break;
case 26 :
maxEnemys = 20;
levelCount = 0;
levelComplete = 500;
enemyTypes.removeAll();
enemyTypes[0] = "enemySquare";
enemyTypes[1] = "enemyCirc";
enemyTypes[2] = "enemysquid2";
enemyTypes[3] = "enamyTri";
enemyTypes[4] = "enemyTracer2";
enemyVar = 5;
break;
default :
maxEnemys = 14;
levelCount = 0;
levelComplete = 500;
enemyTypes.removeAll();
enemyTypes[0] = "enamyTri";
enemyTypes[1] = "enemySquare";
enemyTypes[2] = "enemyCirc";
enemyTypes[3] = "enemyTracer";
enemyTypes[4] = "enemysquid";
enemyTypes[5] = "enemyTracer2";
enemyVar = 6;
}
currentLevel = num;
if (!bFreeGame) {
startLevel();
}
bLevelSet = false;
}
function saveScores() {
userData.data.lvl_1 = levelScores[1];
userData.data.lvl_2 = levelScores[2];
userData.data.lvl_3 = levelScores[3];
userData.data.lvl_4 = levelScores[4];
userData.data.lvl_5 = levelScores[5];
userData.data.lvl_6 = levelScores[6];
userData.data.lvl_7 = levelScores[7];
userData.data.lvl_8 = levelScores[8];
userData.data.lvl_9 = levelScores[9];
userData.data.lvl_10 = levelScores[10];
userData.data.lvl_11 = levelScores[11];
userData.data.lvl_12 = levelScores[12];
userData.data.lvl_13 = levelScores[13];
userData.data.lvl_14 = levelScores[14];
userData.data.lvl_15 = levelScores[15];
userData.data.lvl_16 = levelScores[16];
userData.data.lvl_17 = levelScores[17];
userData.data.lvl_18 = levelScores[18];
userData.data.lvl_19 = levelScores[19];
userData.data.lvl_20 = levelScores[20];
userData.data.lvl_21 = levelScores[21];
userData.data.lvl_22 = levelScores[22];
userData.data.lvl_23 = levelScores[23];
userData.data.lvl_24 = levelScores[24];
userData.data.lvl_25 = levelScores[25];
userData.data.lvl_26 = levelScores[26];
if (unlocked.data.levels < unlockedLevels) {
unlocked.data.levels = unlockedLevels;
}
hsapi.levelComplete(currentLevel - 1, levelScore, null);
levelScore = 0;
}
this.stop();
beginGame();
spawntime = function () {
clearInterval(spawntimer);
spawner.bCanSpawn = true;
createPlayer();
};
bombtime = function () {
clearInterval(bombtimer);
if (!player.bDestroyed) {
spawner.bCanSpawn = true;
}
};
this.onEnterFrame = function () {
if ((this.framecounter >= 3) && (bRenderGlow == true)) {
bitmap.draw(this);
if (emty._alpha < 60) {
emty._alpha = 60;
}
this.framecounter = 0;
}
if (bRenderGlow == false) {
emty._alpha = 0;
}
this.framecounter++;
if ((this.levelCount >= this.levelComplete) && (bLevelSet == false)) {
bLevelSet = true;
getNextLevel();
}
};
changeTime = function () {
bCanChange = true;
clearInterval(changeTimer);
};
Instance of Symbol 33 MovieClip in Frame 10
on (release) {
getURL ("http://www.yougame.com", "_top");
}
Frame 25
MochiAd.showPreGameAd({id:"4d04485a7658aca6", res:"600x480", ad_finished:function () {
_root.gotoAndStop(10);
}});
Symbol 12 MovieClip [player] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.dirx = 0;
this.diry = 0;
this.accel = 0.5;
this.bSetup = true;
this.aim_x = 0;
this.aim_y = 0;
this.bDestroyed = false;
this.shotSpeed = 100;
this.gotoAndPlay(2);
this.shotScale = 100;
}
if (this._currentframe >= 24) {
this.gotoAndStop(26);
}
if (Key.isDown(38) || (Key.isDown(87))) {
this.diry = this.diry - this.accel;
}
if (Key.isDown(40) || (Key.isDown(83))) {
this.diry = this.diry + this.accel;
}
if (Key.isDown(37) || (Key.isDown(65))) {
this.dirx = this.dirx - this.accel;
}
if (Key.isDown(39) || (Key.isDown(68))) {
this.dirx = this.dirx + this.accel;
}
if (Key.isDown(32) || (Key.isDown(17))) {
if (_root.playerBomb > 0) {
_root.playerBomb--;
_root.createBomb();
}
}
if (this._x < 12) {
this._x = 13;
}
if (this._x > 578) {
this._x = 577;
}
if (this._y < 12) {
this._y = 13;
}
if (this._y > 428) {
this._y = 427;
}
dist_x = _root._xmouse - this._x;
dist_y = _root._ymouse - this._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
angle = Math.atan2(dist_y, dist_x);
this._rotation = (angle * 180) / Math.PI;
this.aim_x = Math.cos(angle) * 15;
this.aim_y = Math.sin(angle) * 15;
this.aim_v = Math.cos(angle + 0.05) * 15;
this.aim_z = Math.sin(angle + 0.05) * 15;
this.aim_a = Math.cos(angle - 0.05) * 15;
this.aim_b = Math.sin(angle - 0.05) * 15;
this.dirx = this.dirx * 0.92;
this.diry = this.diry * 0.92;
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
if ((!this.bfire) && (this.bFiring == true)) {
this.bfire = true;
if (firetimer == undefined) {
}
firetimer = setInterval(fireTime, this.shotSpeed);
this.fire();
}
if (this.bFiring == false) {
this.aimError = 0;
}
if ((_root.KillCount >= 400) && (_root.playerMulti < 8)) {
_root.playerMulti = 8;
this.shotSpeed = 90;
this.shotScale = 130;
_root.sfx.systemV.start();
} else if ((_root.KillCount >= 150) && (_root.playerMulti < 6)) {
_root.playerMulti = 6;
this.shotSpeed = 110;
this.shotScale = 100;
_root.sfx.mad.start();
} else if ((_root.KillCount >= 75) && (_root.playerMulti < 4)) {
_root.playerMulti = 4;
this.shotSpeed = 80;
this.shotScale = 100;
_root.sfx.playVoice.start();
} else if ((_root.KillCount >= 25) && (_root.playerMulti < 2)) {
_root.playerMulti = 2;
this.shotSpeed = 90;
this.shotScale = 100;
_root.sfx.notbad.start();
} else if ((_root.KillCount < 25) && (_root.playerMulti != 1)) {
_root.playerMulti = 1;
this.shotSpeed = 100;
this.shotScale = 100;
}
}
function fire() {
if (_root.playerMulti < 6) {
shot = _root.attachMovie("pulse", "pulse" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
shot.dirx = this.aim_x;
shot.diry = this.aim_y;
shot._xscale = this.shotScale;
shot._yscale = this.shotScale;
shot._rotation = this._rotation;
}
if (_root.playerMulti >= 6) {
shot = _root.attachMovie("multipulse", "pulse" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
shot.dirx = this.aim_v;
shot.diry = this.aim_z;
shot._xscale = this.shotScale;
shot._yscale = this.shotScale;
shot._rotation = this._rotation;
shot = _root.attachMovie("multipulse", "pulse" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
shot.dirx = this.aim_a;
shot.diry = this.aim_b;
shot._xscale = this.shotScale;
shot._yscale = this.shotScale;
shot._rotation = this._rotation;
}
_root.sfx.shotSound.start();
}
function destroyed(flag) {
if (!this.bDestroyed) {
this.bDestroyed = true;
i = 1;
while (i < 6) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = -8 + (Math.random() * 16);
spark.velocity_y = -8 + (Math.random() * 16);
i++;
}
spawner.bCanSpawn = false;
clearInterval(firetimer);
_root.playerDied();
}
}
function hideSelf() {
spawner.bCanSpawn = false;
clearInterval(firetimer);
_root.removeMC(this);
}
fireTime = function () {
bfire = false;
clearInterval(firetimer);
};
Symbol 15 MovieClip [enemysquid] Frame 1
function onEnterFrame() {
if (!bsetup) {
xpseed = 0;
yspeed = 0;
delay = 150;
bsetup = true;
this.bsquare = true;
_root.enemys[_root.enemys.length] = this;
this.frameCount = 0;
this.flockCount = 0;
}
this.flockCount++;
dist_x = _root.player._x - this._x;
dist_y = _root.player._y - this._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((distance < 15) && (!_root.player.bDestroyed)) {
_root.player.destroyed();
this.destroy();
}
angle = Math.atan2(dist_y, dist_x);
if (this._currentframe >= 20) {
this.gotoAndPlay(1);
this._rotation = (angle * 180) / Math.PI;
xspeed = Math.cos(angle) * 5;
yspeed = Math.sin(angle) * 5;
}
if (this._x < 10) {
this._x = 10;
}
if (this._x > 590) {
this._x = 590;
}
if (this._y < 10) {
this._y = 10;
}
if (this._y > 430) {
this._y = 430;
}
this.xspeed = this.xspeed * 0.9;
this.yspeed = this.yspeed * 0.9;
this._x = this._x + xspeed;
this._y = this._y + yspeed;
if (this.flockCount >= 4) {
this.flockCount = 0;
for (i in _root.enemys) {
enemy = _root.enemys[i];
if (enemy != undefined) {
if (enemy.bsquare) {
dist_x = this._x - enemy._x;
dist_y = this._y - enemy._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if (distance < 50) {
angle = Math.atan2(dist_y, dist_x);
enemy._x = enemy._x - (Math.cos(angle) * 0.5);
enemy._y = enemy._y - (Math.sin(angle) * 0.5);
}
}
}
}
}
}
function destroy(flag) {
if (flag == true) {
_root.playerScore = _root.playerScore + (15 * _root.playerMulti);
_root.levelScore = _root.levelScore + (15 * _root.playerMulti);
_root.KillCount++;
_root.levelCount++;
}
i = 1;
while (i < 4) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = -8 + (Math.random() * 16);
spark.velocity_y = -8 + (Math.random() * 16);
i++;
}
for (i in _root.enemys) {
if (_root.enemys[i] == this) {
_root.enemys.splice(i, 1);
}
}
_root.removeMC(this);
}
Symbol 29 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
bar._xscale = PercentLoaded;
} else {
gotoAndPlay ("loaded");
}
Symbol 29 MovieClip Frame 2
gotoAndPlay (1);
Symbol 29 MovieClip Frame 40
_root.gotoAndStop("splash1");
Symbol 267 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.31");
}
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 get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 268 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 269 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
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 _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.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 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_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 _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
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;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_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 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();
}};
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_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;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
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) {
_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 showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(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 _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
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 _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
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;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_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);
}
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++;
}
}
return(_local4);
}
}
Symbol 38 MovieClip [cHair] Frame 1
function onEnterFrame() {
this._x = _root._xmouse;
this._y = _root._ymouse;
}
Symbol 42 MovieClip [enamyTri] Frame 1
function onEnterFrame() {
if (!this.bsetup) {
this.xpseed = 0;
this.yspeed = 0;
delay = 100;
this.frameCount = 0;
this.bsetup = true;
this.bDodge = true;
_root.enemys[_root.enemys.length] = this;
}
this.frameCount++;
if (this.frameCount >= 2) {
this.frameCount = 0;
dist_x = _root.player._x - this._x;
dist_y = _root.player._y - this._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((distance < 15) && (!_root.player.bDestroyed)) {
_root.player.destroyed();
this.destroy(true);
}
angle = Math.atan2(dist_y, dist_x);
this.xspeed = Math.cos(angle) * 2;
this.yspeed = Math.sin(angle) * 2;
for (i in _root.enemys) {
enemy = _root.enemys[i];
if (enemy != undefined) {
if (enemy.bDodge) {
dist_x = this._x - enemy._x;
dist_y = this._y - enemy._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if (distance < 50) {
angle = Math.atan2(dist_y, dist_x);
enemy._x = enemy._x - (Math.cos(angle) * 0.5);
enemy._y = enemy._y - (Math.sin(angle) * 0.5);
}
}
}
}
}
if (this._x < 10) {
this._x = 10;
}
if (this._x > 590) {
this._x = 590;
}
if (this._y < 10) {
this._y = 10;
}
if (this._y > 430) {
this._y = 430;
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
this._rotation = this._rotation + 8;
}
function destroy(flag) {
if (flag == true) {
_root.playerScore = _root.playerScore + (25 * _root.playerMulti);
_root.levelScore = _root.levelScore + (25 * _root.playerMulti);
_root.KillCount++;
_root.levelCount++;
}
i = 1;
while (i < 4) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = -8 + (Math.random() * 16);
spark.velocity_y = -8 + (Math.random() * 16);
i++;
}
for (i in _root.enemys) {
if (_root.enemys[i] == this) {
_root.enemys.splice(i, 1);
}
}
_root.removeMC(this);
}
Symbol 49 MovieClip [endScreen] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.counter = 0;
}
this.counter++;
xpos = Math.random() * 600;
ypos = Math.random() * 440;
if (this.counter >= 2) {
i = 1;
while (i < 4) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:xpos, _y:ypos});
spark.velocity_x = -6 + (Math.random() * 12);
spark.velocity_y = -6 + (Math.random() * 12);
i++;
}
this.counter = 0;
}
}
this.mmButton.onRelease = function () {
_root.beginGame();
};
this.submitButton.onRelease = function () {
mochi.MochiScores.showLeaderboard({boardID:"6e57d1db00ba7216", score:_root.playerScore, onClose:function () {
_root.beginGame();
}});
};
Symbol 52 MovieClip [enemyCirc] Frame 1
function onEnterFrame() {
if (!bsetup) {
bsetup = true;
_root.enemys[_root.enemys.length] = this;
this.xspeed = -3 + (Math.random() * 6);
this.yspeed = -3 + (Math.random() * 6);
this.frameCount = 0;
}
this.frameCount++;
if (this._x < 12) {
this._x = 13;
this.xspeed = this.xspeed * -1;
}
if (this._x > 578) {
this._x = 577;
this.xspeed = this.xspeed * -1;
}
if (this._y < 12) {
this._y = 13;
this.yspeed = this.yspeed * -1;
}
if (this._y > 428) {
this._y = 427;
this.yspeed = this.yspeed * -1;
}
if (this.frameCount >= 2) {
this.frameCount = 0;
dist_x = _root.player._x - this._x;
dist_y = _root.player._y - this._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((distance < 15) && (!_root.player.bDestroyed)) {
_root.player.destroyed();
this.destroy();
}
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
this._rotation = this._rotation + 5;
}
function destroy(flag) {
if (flag == true) {
_root.playerScore = _root.playerScore + (20 * _root.playerMulti);
_root.levelScore = _root.levelScore + (20 * _root.playerMulti);
_root.KillCount++;
_root.levelCount++;
}
i = 1;
while (i < 4) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = -8 + (Math.random() * 16);
spark.velocity_y = -8 + (Math.random() * 16);
i++;
}
for (i in _root.enemys) {
if (_root.enemys[i] == this) {
_root.enemys.splice(i, 1);
}
}
_root.removeMC(this);
}
Symbol 54 MovieClip [enemyShot] Frame 1
function onEnterFrame() {
if (!bsetup) {
bsetup = true;
}
if ((this._x < 12) || (_root.spawner.bCanSpawn == false)) {
this.destroy();
}
if (this._x > 578) {
this.destroy();
}
if (this._y < 12) {
this.destroy();
}
if (this._y > 428) {
this.destroy();
}
dist_x = _root.player._x - this._x;
dist_y = _root.player._y - this._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((distance < 15) && (!_root.player.bDestroyed)) {
_root.player.destroyed();
this.destroy();
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
this._rotation = this._rotation + 5;
}
function destroy(flag) {
i = 1;
while (i < 4) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = -8 + (Math.random() * 16);
spark.velocity_y = -8 + (Math.random() * 16);
i++;
}
_root.removeMC(this);
}
Symbol 55 MovieClip [enemySpam] Frame 1
function onEnterFrame() {
if (!bsetup) {
xpseed = 0;
yspeed = 0;
delay = 150;
bsetup = true;
this.bsquare = true;
_root.enemys[_root.enemys.length] = this;
}
dist_x = _root.player._x - this._x;
dist_y = _root.player._y - this._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((distance < 15) && (!_root.player.bDestroyed)) {
_root.player.destroyed();
this.destroy();
}
angle = Math.atan2(dist_y, dist_x);
xspeed = Math.cos(angle) * 1.5;
yspeed = Math.sin(angle) * 1.5;
if (this._x < 10) {
this._x = 10;
}
if (this._x > 590) {
this._x = 590;
}
if (this._y < 10) {
this._y = 10;
}
if (this._y > 430) {
this._y = 430;
}
this._x = this._x + xspeed;
this._y = this._y + yspeed;
this._rotation = this._rotation + 8;
for (i in _root.enemys) {
enemy = _root.enemys[i];
if (enemy != undefined) {
if (enemy.bsquare) {
dist_x = this._x - enemy._x;
dist_y = this._y - enemy._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if (distance < 50) {
angle = Math.atan2(dist_y, dist_x);
xspeed = Math.cos(angle) * 0.5;
yspeed = Math.sin(angle) * 0.5;
enemy._x = enemy._x - xspeed;
enemy._y = enemy._y - yspeed;
}
}
}
}
}
function destroy(flag) {
if (flag == true) {
_root.playerScore = _root.playerScore + (10 * _root.playerMulti);
_root.levelScore = _root.levelScore + (10 * _root.playerMulti);
_root.KillCount++;
_root.levelCount++;
_root.attachMovie("enamyTri", "star" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x + (Math.random() * 2), _y:this._y});
_root.attachMovie("enamyTri", "star" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
_root.attachMovie("enamyTri", "star" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x + (Math.random() * 2), _y:this._y});
_root.attachMovie("enamyTri", "star" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
}
i = 1;
while (i < 4) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = -8 + (Math.random() * 16);
spark.velocity_y = -8 + (Math.random() * 16);
i++;
}
for (i in _root.enemys) {
if (_root.enemys[i] == this) {
_root.enemys.splice(i, 1);
}
}
_root.removeMC(this);
}
Symbol 58 MovieClip [enemySquare] Frame 1
function onEnterFrame() {
if (!bsetup) {
xpseed = 0;
yspeed = 0;
delay = 150;
bsetup = true;
this.bsquare = true;
_root.enemys[_root.enemys.length] = this;
this.frameCount = 0;
this.flockCount = 0;
}
this.frameCount++;
if (this.frameCount >= 2) {
this.frameCount = 0;
dist_x = _root.player._x - this._x;
dist_y = _root.player._y - this._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((distance < 15) && (!_root.player.bDestroyed)) {
_root.player.destroyed();
this.destroy();
}
angle = Math.atan2(dist_y, dist_x);
xspeed = Math.cos(angle) * 1.5;
yspeed = Math.sin(angle) * 1.5;
if (this._x < 10) {
this._x = 10;
}
if (this._x > 590) {
this._x = 590;
}
if (this._y < 10) {
this._y = 10;
}
if (this._y > 430) {
this._y = 430;
}
}
this._x = this._x + xspeed;
this._y = this._y + yspeed;
this._rotation = this._rotation + 8;
this.flockCount++;
if (this.flockCount >= 4) {
this.flockCount = 0;
for (i in _root.enemys) {
enemy = _root.enemys[i];
if (enemy != undefined) {
if (enemy.bsquare) {
dist_x = this._x - enemy._x;
dist_y = this._y - enemy._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if (distance < 50) {
angle = Math.atan2(dist_y, dist_x);
bspeed = Math.cos(angle);
nspeed = Math.sin(angle);
enemy._x = enemy._x - bspeed;
enemy._y = enemy._y - nspeed;
}
}
}
}
}
}
function destroy(flag) {
if (flag == true) {
_root.playerScore = _root.playerScore + (10 * _root.playerMulti);
_root.levelScore = _root.levelScore + (10 * _root.playerMulti);
_root.KillCount++;
_root.levelCount++;
_root.attachMovie("enemyStar", "star" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x + (Math.random() * 2), _y:this._y});
_root.attachMovie("enemyStar", "star" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
}
i = 1;
while (i < 4) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = -8 + (Math.random() * 16);
spark.velocity_y = -8 + (Math.random() * 16);
i++;
}
for (i in _root.enemys) {
if (_root.enemys[i] == this) {
_root.enemys.splice(i, 1);
}
}
_root.removeMC(this);
}
Symbol 59 MovieClip [enemysquid2] Frame 1
function onEnterFrame() {
if (!bsetup) {
xpseed = 0;
yspeed = 0;
delay = 150;
bsetup = true;
this.bsquare = true;
this.bDodge = true;
_root.enemys[_root.enemys.length] = this;
this.frameCount = 0;
this.flockCount = 0;
}
this.flockCount++;
dist_x = _root.player._x - this._x;
dist_y = _root.player._y - this._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((distance < 15) && (!_root.player.bDestroyed)) {
_root.player.destroyed();
this.destroy();
}
angle = Math.atan2(dist_y, dist_x);
if (this._currentframe >= 20) {
this.gotoAndPlay(1);
this._rotation = (angle * 180) / Math.PI;
xspeed = Math.cos(angle) * 5;
yspeed = Math.sin(angle) * 5;
}
if (this._x < 10) {
this._x = 10;
}
if (this._x > 590) {
this._x = 590;
}
if (this._y < 10) {
this._y = 10;
}
if (this._y > 430) {
this._y = 430;
}
this.xspeed = this.xspeed * 0.9;
this.yspeed = this.yspeed * 0.9;
this._x = this._x + xspeed;
this._y = this._y + yspeed;
if (this.flockCount >= 4) {
this.flockCount = 0;
for (i in _root.enemys) {
enemy = _root.enemys[i];
if (enemy != undefined) {
if (enemy.bsquare) {
dist_x = this._x - enemy._x;
dist_y = this._y - enemy._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if (distance < 50) {
angle = Math.atan2(dist_y, dist_x);
enemy._x = enemy._x - (Math.cos(angle) * 0.5);
enemy._y = enemy._y - (Math.sin(angle) * 0.5);
}
}
}
}
}
}
function destroy(flag) {
if (flag == true) {
_root.playerScore = _root.playerScore + (15 * _root.playerMulti);
_root.levelScore = _root.levelScore + (15 * _root.playerMulti);
_root.KillCount++;
_root.levelCount++;
}
i = 1;
while (i < 4) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = -8 + (Math.random() * 16);
spark.velocity_y = -8 + (Math.random() * 16);
i++;
}
for (i in _root.enemys) {
if (_root.enemys[i] == this) {
_root.enemys.splice(i, 1);
}
}
_root.removeMC(this);
}
Symbol 62 MovieClip [enemyStar] Frame 1
function onEnterFrame() {
if (!bsetup) {
xpseed = 0;
yspeed = 0;
delay = 150;
bsetup = true;
this.bsquare = false;
_root.enemys[_root.enemys.length] = this;
this.frameCount = 0;
}
this.frameCount++;
if (this.frameCount >= 3) {
this.frameCount = 0;
dist_x = _root.player._x - this._x;
dist_y = _root.player._y - this._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((distance < 15) && (!_root.player.bDestroyed)) {
_root.player.destroyed();
this.destroy();
}
angle = Math.atan2(dist_y, dist_x);
xspeed = Math.cos(angle) * 2.5;
yspeed = Math.sin(angle) * 2.5;
if (this._x < 10) {
this._x = 10;
}
if (this._x > 590) {
this._x = 590;
}
if (this._y < 10) {
this._y = 10;
}
if (this._y > 430) {
this._y = 430;
}
}
this._x = this._x + xspeed;
this._y = this._y + yspeed;
this._rotation = this._rotation + 8;
}
function destroy(flag) {
if (flag == true) {
_root.playerScore = _root.playerScore + (5 * _root.playerMulti);
_root.levelScore = _root.levelScore + (5 * _root.playerMulti);
_root.KillCount++;
_root.levelCount++;
}
i = 1;
while (i < 3) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = -8 + (Math.random() * 16);
spark.velocity_y = -8 + (Math.random() * 16);
i++;
}
for (i in _root.enemys) {
if (_root.enemys[i] == this) {
_root.enemys.splice(i, 1);
}
}
_root.removeMC(this);
}
Symbol 65 MovieClip [enemyTracer] Frame 1
function onEnterFrame() {
if (!this.bsetup) {
this.bsetup = true;
_root.enemys[_root.enemys.length] = this;
this.xspeed = -2 + (Math.random() * 4);
this.yspeed = -2 + (Math.random() * 4);
this.frameCount = 75;
this.testCount = 0;
this.spawnCount = 0;
}
this.spawnCount++;
this.frameCount++;
this.testCount++;
if (this._x < 12) {
this._x = 13;
this.xspeed = this.xspeed * -1;
}
if (this._x > 578) {
this._x = 577;
this.xspeed = this.xspeed * -1;
}
if (this._y < 12) {
this._y = 13;
this.yspeed = this.yspeed * -1;
}
if (this._y > 428) {
this._y = 427;
this.yspeed = this.yspeed * -1;
}
if (this.testCount >= 3) {
this.testCount = 0;
dist_x = _root.player._x - this._x;
dist_y = _root.player._y - this._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((distance < 15) && (!_root.player.bDestroyed)) {
_root.player.destroyed();
this.destroy();
}
}
if (this.spawnCount > 5) {
this.spawnCount = 0;
spark = _root.attachMovie("trace", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = 0;
spark.velocity_y = 0;
spark.actor = this;
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
if (this.frameCount > (30 + (Math.random() * 20))) {
newdir = Math.random();
this.frameCount = 0;
if (newdir > 0.75) {
this.xspeed = 4;
this.yspeed = 0;
this._rotation = 0;
} else if (newdir > 0.5) {
this.xspeed = -4;
this.yspeed = 0;
this._rotation = 180;
} else if (newdir > 0.25) {
this.xspeed = 0;
this.yspeed = 4;
this._rotation = 90;
} else {
this.xspeed = 0;
this.yspeed = -4;
this._rotation = -90;
}
}
}
function destroy(flag) {
clearInterval(dirtime);
if (flag == true) {
_root.playerScore = _root.playerScore + (20 * _root.playerMulti);
_root.levelScore = _root.levelScore + (20 * _root.playerMulti);
_root.KillCount++;
_root.levelCount++;
}
i = 1;
while (i < 4) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = -8 + (Math.random() * 16);
spark.velocity_y = -8 + (Math.random() * 16);
i++;
}
for (i in _root.enemys) {
if (_root.enemys[i] == this) {
_root.enemys.splice(i, 1);
}
}
_root.removeMC(this);
}
Symbol 66 MovieClip [enemyTracer2] Frame 1
function onEnterFrame() {
if (!this.bsetup) {
this.bsetup = true;
_root.enemys[_root.enemys.length] = this;
this.xspeed = -2 + (Math.random() * 4);
this.yspeed = -2 + (Math.random() * 4);
this.frameCount = 75;
this.spawnCount = 0;
}
this.spawnCount++;
this.frameCount++;
if (this._x < 12) {
this._x = 13;
this.xspeed = this.xspeed * -1;
}
if (this._x > 578) {
this._x = 577;
this.xspeed = this.xspeed * -1;
}
if (this._y < 12) {
this._y = 13;
this.yspeed = this.yspeed * -1;
}
if (this._y > 428) {
this._y = 427;
this.yspeed = this.yspeed * -1;
}
dist_x = _root.player._x - this._x;
dist_y = _root.player._y - this._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((distance < 15) && (!_root.player.bDestroyed)) {
_root.player.destroyed();
this.destroy();
}
if (this.spawnCount > 5) {
this.spawnCount = 0;
spark = _root.attachMovie("trace", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = 0;
spark.velocity_y = 0;
spark.actor = this;
}
this._x = this._x + this.xspeed;
this._y = this._y + this.yspeed;
if (this.frameCount > (60 + (Math.random() * 20))) {
newdir = Math.random();
this.frameCount = 0;
if (newdir > 0.75) {
this.xspeed = 4;
this.yspeed = 0;
this._rotation = 0;
} else if (newdir > 0.5) {
this.xspeed = -4;
this.yspeed = 0;
this._rotation = 180;
} else if (newdir > 0.25) {
this.xspeed = 0;
this.yspeed = 4;
this._rotation = 90;
} else {
this.xspeed = 0;
this.yspeed = -4;
this._rotation = -90;
}
if (_root.player.dirx != undefined) {
angle = Math.atan2(dist_y, dist_x);
shotxspeed = Math.cos(angle) * 3;
shotyspeed = Math.sin(angle) * 3;
shot = _root.attachMovie("enemyShot", "star" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x + (Math.random() * 2), _y:this._y});
shot.xspeed = shotxspeed;
shot.yspeed = shotyspeed;
}
}
}
function destroy(flag) {
clearInterval(dirtime);
if (flag == true) {
_root.playerScore = _root.playerScore + (25 * _root.playerMulti);
_root.levelScore = _root.levelScore + (25 * _root.playerMulti);
_root.KillCount++;
_root.levelCount++;
}
i = 1;
while (i < 4) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = -8 + (Math.random() * 16);
spark.velocity_y = -8 + (Math.random() * 16);
i++;
}
for (i in _root.enemys) {
if (_root.enemys[i] == this) {
_root.enemys.splice(i, 1);
}
}
_root.removeMC(this);
}
Symbol 69 MovieClip [flasher] Frame 1
function onEnterFrame() {
if (this._currentframe >= 3) {
_root.removeMC(this);
}
}
Symbol 82 MovieClip [hud] Frame 1
function onEnterFrame() {
this.scoreTxt.text = _root.playerScore;
this.multiTxt.text = _root.playerMulti;
this.livesTxt.text = _root.playerLives;
this.bombsTxt.text = _root.playerBomb;
this.progressBar._xscale = (_root.levelCount / _root.levelComplete) * 100;
}
Symbol 180 MovieClip [levelInfo] Frame 1
function onEnterFrame() {
if (_root.levelScore > _root.levelScores[_root.currentLevel - 1]) {
_root.levelScores[_root.currentLevel - 1] = _root.levelScore;
}
this.thisScore.text = _root.levelScore;
this.bestScore.text = _root.levelScores[_root.currentLevel - 1];
if (this.bFade) {
this._alpha = this._alpha - 10;
if (this._alpha <= 0) {
_root.removeMC(this);
}
}
if (!this.bFade) {
if (this._alpha < 100) {
this._alpha = this._alpha + 5;
}
}
if (this._currentframe == 28) {
this.lastLevel = _root.unlocked.data.levels;
}
if (this.lastLevel < 27) {
this.lvl27B._alpha = 0;
}
if (this.lastLevel < 26) {
this.lvl26B._alpha = 0;
}
if (this.lastLevel < 25) {
this.lvl25B._alpha = 0;
}
if (this.lastLevel < 24) {
this.lvl24B._alpha = 0;
}
if (this.lastLevel < 23) {
this.lvl23B._alpha = 0;
}
if (this.lastLevel < 22) {
this.lvl22B._alpha = 0;
}
if (this.lastLevel < 21) {
this.lvl21B._alpha = 0;
}
if (this.lastLevel < 20) {
this.lvl20B._alpha = 0;
}
if (this.lastLevel < 19) {
this.lvl19B._alpha = 0;
}
if (this.lastLevel < 18) {
this.lvl18B._alpha = 0;
}
if (this.lastLevel < 17) {
this.lvl17B._alpha = 0;
}
if (this.lastLevel < 16) {
this.lvl16B._alpha = 0;
}
if (this.lastLevel < 15) {
this.lvl15B._alpha = 0;
}
if (this.lastLevel < 14) {
this.lvl14B._alpha = 0;
}
if (this.lastLevel < 13) {
this.lvl13B._alpha = 0;
}
if (this.lastLevel < 12) {
this.lvl12B._alpha = 0;
}
if (this.lastLevel < 11) {
this.lvl11B._alpha = 0;
}
if (this.lastLevel < 10) {
this.lvl10B._alpha = 0;
}
if (this.lastLevel < 9) {
this.lvl9B._alpha = 0;
}
if (this.lastLevel < 8) {
this.lvl8B._alpha = 0;
}
if (this.lastLevel < 7) {
this.lvl7B._alpha = 0;
}
if (this.lastLevel < 6) {
this.lvl6B._alpha = 0;
}
if (this.lastLevel < 5) {
this.lvl5B._alpha = 0;
}
if (this.lastLevel < 4) {
this.lvl4B._alpha = 0;
}
if (this.lastLevel < 3) {
this.lvl3B._alpha = 0;
}
if (this.lastLevel < 2) {
this.lvl2B._alpha = 0;
}
}
this.goButton.onRelease = function () {
_root.unlockedLevels = this._parent._currentframe;
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.saveScores();
this._parent.bFade = true;
};
this.lvl1B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(1);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 1;
this._parent.bFade = true;
}
};
this.lvl2B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(2);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 2;
this._parent.bFade = true;
}
};
this.lvl3B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(3);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 3;
this._parent.bFade = true;
}
};
this.lvl4B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(4);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 4;
this._parent.bFade = true;
}
};
this.lvl5B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(5);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 5;
this._parent.bFade = true;
}
};
this.lvl6B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(6);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 6;
this._parent.bFade = true;
}
};
this.lvl7B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(7);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 7;
this._parent.bFade = true;
}
};
this.lvl8B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(8);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 8;
this._parent.bFade = true;
}
};
this.lvl9B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(9);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 9;
this._parent.bFade = true;
}
};
this.lvl10B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(10);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 10;
this._parent.bFade = true;
}
};
this.lvl11B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(11);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 11;
this._parent.bFade = true;
}
};
this.lvl12B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(12);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 12;
this._parent.bFade = true;
}
};
this.lvl13B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(13);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 13;
this._parent.bFade = true;
}
};
this.lvl14B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(14);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 14;
this._parent.bFade = true;
}
};
this.lvl15B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(15);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 15;
this._parent.bFade = true;
}
};
this.lvl16B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(16);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 16;
this._parent.bFade = true;
}
};
this.lvl17B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(17);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 17;
this._parent.bFade = true;
}
};
this.lvl18B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(18);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 18;
this._parent.bFade = true;
}
};
this.lvl19B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(19);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 19;
this._parent.bFade = true;
}
};
this.lvl20B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(20);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 20;
this._parent.bFade = true;
}
};
this.lvl21B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(21);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 21;
this._parent.bFade = true;
}
};
this.lvl22B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(22);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 22;
this._parent.bFade = true;
}
};
this.lvl23B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(23);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 23;
this._parent.bFade = true;
}
};
this.lvl24B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(24);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 24;
this._parent.bFade = true;
}
};
this.lvl25B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(25);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 25;
this._parent.bFade = true;
}
};
this.lvl26B.onRelease = function () {
if (this._alpha > 75) {
_root.setLevel(26);
_root.reCreatePlayer();
_root.spawner.bCanSpawn = true;
_root.levelScore = 0;
_root.currentLevel = 26;
this._parent.bFade = true;
}
};
this.mmButton.onRelease = function () {
_root.beginGame();
this._parent.bFade = true;
};
Symbol 196 Button
on (release) {
Mouse.show();
mochi.MochiScores.showLeaderboard({boardID:"6e57d1db00ba7216", onClose:function () {
Mouse.hide();
}});
}
Symbol 200 Button
on (release) {
getURL ("http://www.yougame.com", "_top");
}
Symbol 204 Button
on (release) {
getURL ("http://www.yougame.com", "_top");
}
Symbol 226 MovieClip [mainMenu] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.counter = 0;
}
this.counter++;
xpos = Math.random() * 600;
ypos = Math.random() * 440;
if (this.counter >= 2) {
i = 1;
while (i < 4) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:xpos, _y:ypos});
spark.velocity_x = -6 + (Math.random() * 12);
spark.velocity_y = -6 + (Math.random() * 12);
i++;
}
this.counter = 0;
}
}
this.startButton.onRelease = function () {
_root.newGame();
};
this.arcadeButton.onRelease = function () {
_root.newFreeGame();
};
this.backupButton.onRelease = function () {
this._parent.gotoAndStop(1);
};
this.ctrlsButton.onRelease = function () {
this._parent.gotoAndStop(2);
};
this.setButton.onRelease = function () {
this._parent.gotoAndStop(3);
};
Symbol 226 MovieClip [mainMenu] Frame 2
this.backupButton.onRelease = function () {
this._parent.gotoAndStop(1);
};
Symbol 226 MovieClip [mainMenu] Frame 3
function onEnterFrame() {
this.part.text = _root.particleLimit;
this.aud.text = _root.music.ogm.getVolume();
this.fx.text = _root.sfx.mad.getVolume();
}
this.backupButton.onRelease = function () {
this._parent.gotoAndStop(1);
};
this.cButton.onRelease = function () {
if (_root.bRenderGlow == true) {
_root.bRenderGlow = false;
this._parent.bgfx.text = "off";
} else {
_root.bRenderGlow = true;
this._parent.bgfx.text = "on";
}
};
this.addButton.onRelease = function () {
if (_root.particleLimit < 15) {
_root.particleLimit++;
}
};
this.minButton.onRelease = function () {
if (_root.particleLimit > 1) {
_root.particleLimit--;
}
};
this.volUpButton.onRelease = function () {
curVol = _root.music.ogm.getVolume();
if (curVol < 100) {
_root.music.ogm.setVolume(curVol + 10);
}
};
this.volDnButton.onRelease = function () {
curVol = _root.music.ogm.getVolume();
if (curVol > 0) {
_root.music.ogm.setVolume(curVol - 10);
}
};
this.fxUpButton.onRelease = function () {
curVol = _root.sfx.mad.getVolume();
if (curVol < 100) {
_root.sfx.mad.setVolume(curVol + 10);
}
};
this.fxDnButton.onRelease = function () {
curVol = _root.sfx.mad.getVolume();
if (curVol > 0) {
_root.sfx.mad.setVolume(curVol - 10);
}
};
Symbol 229 MovieClip [multipulse] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.counter = 0;
this.colCounter = 0;
hitSound = new Sound();
hitSound.attachSound("hit");
hitSound2 = new Sound();
hitSound2.attachSound("hit2");
}
this.counter++;
this.colCounter++;
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
if ((((this._x < 10) || (this._x > 590)) || (this._y < 10)) || (this._y > 430)) {
this.destroy();
}
for (i in _root.enemys) {
enemy = _root.enemys[i];
if (enemy != undefined) {
dist_x = this._x - enemy._x;
if ((dist_x > -60) && (dist_x < 60)) {
dist_y = this._y - enemy._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((distance < 100) && (this.counter > 5)) {
if (enemy.bDodge) {
angle = Math.atan2(dist_y, dist_x);
xspeed = Math.cos(angle) * 2;
yspeed = Math.sin(angle) * 2;
enemy._x = enemy._x - xspeed;
enemy._y = enemy._y - yspeed;
}
}
if (distance < 15) {
enemy.destroy(true);
if (Math.random() > 0.5) {
hitSound.start();
} else {
hitSound2.start();
}
this.destroy();
}
}
}
}
}
function destroy() {
i = 1;
while (i < _root.particleLimit) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = -6 + (Math.random() * 12);
spark.velocity_y = -6 + (Math.random() * 12);
i++;
}
_root.removeMC(this);
}
Symbol 230 MovieClip [pulse] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.counter = 0;
this.colCounter = 0;
}
this.counter++;
this.colCounter++;
this._x = this._x + this.dirx;
this._y = this._y + this.diry;
if ((((this._x < 10) || (this._x > 590)) || (this._y < 10)) || (this._y > 430)) {
this.destroy();
}
for (i in _root.enemys) {
enemy = _root.enemys[i];
if (enemy != undefined) {
dist_x = this._x - enemy._x;
if ((dist_x > -100) && (dist_x < 100)) {
dist_y = this._y - enemy._y;
distance = Math.sqrt((dist_x * dist_x) + (dist_y * dist_y));
if ((distance < 100) && (this.counter > 5)) {
if (enemy.bDodge) {
angle = Math.atan2(dist_y, dist_x);
xspeed = Math.cos(angle) * 2;
yspeed = Math.sin(angle) * 2;
enemy._x = enemy._x - xspeed;
enemy._y = enemy._y - yspeed;
}
}
if (distance < 15) {
enemy.destroy(true);
if (Math.random() > 0.5) {
_root.sfx.hitSound.start();
} else {
_root.sfx.hitSound2.start();
}
this.destroy();
}
}
}
}
}
function destroy() {
i = 1;
while (i < _root.particleLimit) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = -6 + (Math.random() * 12);
spark.velocity_y = -6 + (Math.random() * 12);
i++;
}
_root.removeMC(this);
}
Symbol 231 MovieClip [smartBomb] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.counter = 0;
}
this.counter++;
for (i in _root.enemys) {
enemy = _root.enemys[i];
if ((enemy != undefined) && (!_root.bBosslevel)) {
enemy.destroy(false);
_root.enemys.splice(i, 1);
}
}
if (this.counter >= 50) {
_root.removeMC(this);
}
}
Symbol 234 MovieClip [spark] Frame 1
function onEnterFrame() {
this.velocity_x = this.velocity_x * 0.995;
this.velocity_y = this.velocity_y * 0.99;
this._xscale = this._xscale * 0.95;
this._yscale = this._yscale * 0.95;
if (this._xscale < 2) {
_root.removeMC(this);
}
if (this._x < 10) {
this._x = 11;
this.velocity_x = this.velocity_x * -1;
}
if (this._x > 590) {
this._x = 589;
this.velocity_x = this.velocity_x * -1;
}
if (this._y < 10) {
this._y = 11;
this.velocity_y = this.velocity_y * -1;
}
if (this._y > 430) {
this._y = 429;
this.velocity_y = this.velocity_y * -1;
}
this._x = this._x + this.velocity_x;
this._y = this._y + this.velocity_y;
}
Symbol 236 MovieClip [spawner] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.spawnCount = 0;
}
this.enemyCount = 0;
if (this.bCanSpawn) {
for (i in _root.enemys) {
if (_root.enemys[i] != undefined) {
this.enemyCount++;
}
}
if (this.enemyCount < _root.maxEnemys) {
spawnRandomEnemy();
}
if (_root.bBosslevel && (!this.bBossed)) {
this.bBossed = true;
i = 0;
while (i < _root.levelComplete) {
_root.attachMovie(type, "enemy" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:xpos, _y:ypos});
i++;
}
}
}
}
function spawnRandomEnemy() {
pos = Math.random() * 4;
if (pos >= 3) {
xpos = 15;
ypos = 15;
} else if (pos >= 2) {
xpos = 15;
ypos = 425;
} else if (pos >= 1) {
xpos = 585;
ypos = 425;
} else if (pos >= 0) {
xpos = 585;
ypos = 15;
}
type = _root.enemyTypes[Math.floor(Math.random() * _root.enemyVar)];
if ((type != undefined) && (!_root.bBosslevel)) {
_root.attachMovie(type, "enemy" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:xpos, _y:ypos});
this.spawnCount++;
}
}
Symbol 239 MovieClip [trace] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.counter = 75;
this.frameCount = 0;
}
this.counter--;
this.frameCount++;
if (this.actor.xspeed == undefined) {
this.destroy();
}
if ((this.counter <= 2) || (_root.spawner.bCanSpawn == false)) {
_root.removeMC(this);
}
if (this.frameCount >= 3) {
this.frameCount = 0;
if (this.hitTest(_root.player)) {
_root.player.destroyed();
}
}
}
function destroy() {
i = 1;
while (i < 2) {
spark = _root.attachMovie("spark", "spark" + _root.getNextHighestDepth(), _root.getNextHighestDepth(), {_x:this._x, _y:this._y});
spark.velocity_x = -8 + (Math.random() * 16);
spark.velocity_y = -8 + (Math.random() * 16);
i++;
}
_root.removeMC(this);
}
Symbol 240 MovieClip [music] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
this.bSetup = true;
this.ogm = new Sound(this);
this.ogm.attachSound("geo");
this.ogm.start();
this.ogm.setVolume(60);
this.ogm.onSoundComplete = function () {
this.start();
};
}
}
Symbol 241 MovieClip [sfx] Frame 1
function onEnterFrame() {
if (!this.bSetup) {
playVoice = new Sound(this);
playVoice.attachSound("play");
notbad = new Sound(this);
notbad.attachSound("notbad");
systemV = new Sound(this);
systemV.attachSound("system");
mad = new Sound(this);
mad.attachSound("mad");
playerDeath = new Sound(this);
playerDeath.attachSound("lec");
shotSound = new Sound(this);
shotSound.attachSound("blaster");
hitSound = new Sound(this);
hitSound.attachSound("hit");
hitSound2 = new Sound(this);
hitSound2.attachSound("hit2");
spawn = new Sound(this);
spawn.attachSound("spawn");
}
}
Symbol 247 MovieClip Frame 1
function onEnterFrame() {
if (_root.music.ogm.getVolume() < 1) {
this.gotoAndStop(2);
} else {
this.gotoAndStop(1);
}
}
function onRelease() {
if (_root.music.ogm.getVolume() < 1) {
_root.music.ogm.setVolume(50);
_root.sfx.mad.setVolume(100);
} else {
_root.music.ogm.setVolume(0);
_root.sfx.mad.setVolume(0);
}
}
Symbol 266 MovieClip Frame 1
Symbol 266 MovieClip Frame 258
_root.gotoAndStop("splash2");