Frame 1
var my_cm = new ContextMenu();
my_cm.hideBuiltInItems();
this.menu = my_cm;
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
pfixEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(pfixEnd, domain.length);
if (domain == "bubblebox.com") {
play();
} else {
stop();
}
Frame 116
play();
Frame 124
function loading() {
var _local2 = getBytesLoaded();
var _local3 = getBytesTotal();
var _local1 = _local2 / _local3;
tarLoad_mc._x = 600 - (600 * _local1);
if (_local2 >= _local3) {
clearInterval(loadInt);
play();
}
}
var loadInt = setInterval(this, "loading", 100);
stop();
Frame 135
Frame 154
start_btn.onRollOver = function () {
start_btn.gotoAndStop(2);
};
start_btn.onRollOut = (start_btn.onDragOut = function () {
start_btn.gotoAndStop(1);
});
start_btn.onPress = function () {
stopAllSounds();
gotoAndStop ("startGame");
};
link_btn.onPress = function () {
getURL ("http://www.bulletpattern.com", "_blank");
};
stop();
Frame 166
function clearTarget(clip) {
var _local1 = unitActiveAry.length;
while (_local1--) {
var _local2 = unitActiveAry[_local1].targ;
var _local5 = unitActiveAry[_local1].dmgDealt;
if (_local2 == clip) {
var _local4 = unitActiveAry[_local1].clr;
var _local3 = unitActiveAry[_local1].clip;
unitActiveAry[_local1].targ = findUnitTarget(_local3, _local4);
if (unitActiveAry[_local1].targ == undefined) {
unitDmgWasted = unitDmgWasted + (unitMaxDmg - unitActiveAry[_local1].dmgDealt);
}
}
}
}
function unitMake() {
var _local21 = 50;
var _local22 = 10;
var _local20 = 5;
var _local8 = 0;
var _local3 = 0;
var _local6 = 0;
while (_local6 < _local21) {
var _local2 = _root.attachMovie("seed", "u" + unitCount, unitCount);
_local2.gotoAndStop("inactive");
var _local5 = (_local3 * 20) + 50;
var _local4 = (_local8 * 26) + unitStartY;
_local2._x = _local5;
_local2._y = _local4;
_local2.theclip = _local2;
var _local7 = {clip:_local2, x:_local5, y:_local4, vx:0, vy:0, vr:0, a:0, targ:undefined, dmgDealt:0, active:false, clr:undefined};
unitAry.push(_local7);
_local3++;
if (_local3 >= _local20) {
_local8++;
_local3 = 0;
}
unitCount++;
_local6++;
}
}
function unitAddRowTimer() {
unitAddCount++;
if ((unitAddCount % unitAddInt) == 0) {
unitAdd(unitAddCount);
}
if (unitAddCount > (unitAddInt * 10)) {
unitAddCount = 0;
unitAddCol();
}
}
function unitAdd(unitAddCount) {
var _local2 = _root.attachMovie("seed", "u" + unitCount, unitCount);
var _local4 = 15;
var _local3 = (((unitAddCount / unitAddInt) - 1) * 26) + unitStartY;
_local2._x = _local4;
_local2._y = _local3;
var _local5 = {clip:_local2, x:_local4, y:_local3, vx:0, vy:0, vr:0, a:0, targ:undefined, dmgDealt:0, active:false, clr:undefined};
unitNewAry.push(_local5);
sndUnitNew.start();
unitCount++;
}
function unitAddCol() {
var _local4 = 0;
var _local3 = unitAry.length;
unitDestroyAry = new Array();
while (_local3--) {
if (unitAry[_local3].clip._x >= 130) {
_local4++;
unitDmgWasted = unitDmgWasted + unitMaxDmg;
unitDestroyAry.push(unitAry[_local3]);
}
}
if (_local4 > 0) {
_local3 = unitDestroyAry.length;
while (_local3--) {
var _local2 = searchArrayForClip(unitAry, unitDestroyAry[_local3].clip);
replaceInArray(unitAry, _local2, -1);
}
}
if (unitAddAnimInt != undefined) {
clearInterval(unitAddAnimInt);
}
unitAddAnimInt = setInterval(this, "unitAddColAnim", 30);
sndUnitNewCol.start();
}
function unitAddColAnim() {
var _local2 = unitAry.length;
while (_local2--) {
unitAry[_local2].clip._x = unitAry[_local2].clip._x + 4;
unitAry[_local2].x = unitAry[_local2].x + 4;
}
_local2 = unitDestroyAry.length;
while (_local2--) {
unitDestroyAry[_local2].clip._x = unitDestroyAry[_local2].clip._x + 5;
unitDestroyAry[_local2].x = unitDestroyAry[_local2].x + 5;
}
_local2 = unitNewAry.length;
while (_local2--) {
var _local1 = unitNewAry[_local2];
_local1.clip.gotoAndPlay("beInactive");
_local1.clip._x = _local1.clip._x + 7;
}
unitAddAnimCnt++;
if (unitAddAnimCnt == 5) {
unitAddAnimCnt = 0;
clearInterval(unitAddAnimInt);
_local2 = unitNewAry.length;
while (_local2--) {
var _local1 = unitNewAry[_local2];
unitAry.push(_local1);
}
_local2 = unitDestroyAry.length;
while (_local2--) {
var _local1 = unitDestroyAry[_local2];
_local1.clip.gotoAndPlay("wasted");
}
unitDestroyAry = new Array();
unitNewAry = new Array();
}
}
function soundInit() {
createEmptyMovieClip("sounds_mc", getNextHighestDepth());
sndMainLoop = new Sound(soundClipMake());
sndMainLoop.attachSound("sMainLoop");
sndLevelWin = new Sound(soundClipMake());
sndLevelWin.attachSound("sLevelWin");
sndEndSting = new Sound(soundClipMake());
sndEndSting.attachSound("sEndSting");
sndMusicBoss = new Sound(soundClipMake());
sndMusicBoss.attachSound("sMusicBoss");
sndWinSting = new Sound(soundClipMake());
sndWinSting.attachSound("sWinSting");
sndUnitSelect = new Sound(soundClipMake());
sndUnitSelect.attachSound("sUnitSelect");
sndUnitNew = new Sound(soundClipMake());
sndUnitNew.attachSound("sUnitNew");
sndUnitNew.setVolume(10);
sndUnitNewCol = new Sound(soundClipMake());
sndUnitNewCol.attachSound("sUnitNewCol");
sndUnitHit = new Sound(soundClipMake());
sndUnitHit.attachSound("sUnitHit");
sndUnitHitCnt = 0;
sndUnitHitMax = 2;
sndUnitHit.onSoundComplete = function () {
if (sndUnitHitCnt != 0) {
sndUnitHitCnt--;
}
};
sndEnemyFeet = new Sound(soundClipMake());
sndEnemyFeet.attachSound("sBugFeet");
sndEnemyFeetCnt = 0;
sndEnemyFeetMax = 1;
sndEnemyFeet.onSoundComplete = function () {
if (sndEnemyFeetCnt != 0) {
sndEnemyFeetCnt--;
}
};
sndEnemyGoal = new Sound(soundClipMake());
sndEnemyGoal.attachSound("sEnemyGoal");
sndHelpOpen = new Sound(soundClipMake());
sndHelpOpen.attachSound("sHelpOpen");
sndScoreCount = new Sound(soundClipMake());
sndScoreCount.attachSound("sScoreCount");
}
function soundClipMake() {
var _local1 = sounds_mc.createEmptyMovieClip("snd" + sndCount, sndCount);
sndCount++;
return(_local1);
}
function searchArrayForClip(ary, mc) {
var _local1 = ary.length;
while (_local1--) {
if (ary[_local1].clip == mc) {
return(_local1);
}
}
return(-1);
}
function unitRemove(unit) {
var _local1 = unitActiveAry.length;
while (_local1--) {
if (unitActiveAry[_local1].clip == unit) {
unitDmgWasted = unitDmgWasted + (unitMaxDmg - unitActiveAry[_local1].dmgDealt);
totalDmgWasted = totalDmgWasted + unitDmgWasted;
unitActiveAry[_local1].clip.gotoAndPlay("die");
replaceInArray(unitActiveAry, _local1, -1);
break;
}
}
}
function unitActivate(num, clr) {
var _local1 = unitAry[num];
var _local2 = _local1.clip;
var _local5 = _local1.y;
unitAry[num].clr = clr;
_local1.active = true;
_local1.targ = findUnitTarget(_local1.clip, clr);
if (_local1.targ == null) {
} else {
unitActiveAry.push(_local1);
replaceInArray(unitAry, num, -1);
_local2.gotoAndStop(clr);
}
}
function findUnitTarget(mc, clr) {
var _local5 = enemyAry.length;
var _local6 = 1000000 /* 0x0F4240 */;
var _local8;
while (_local5--) {
if (enemyAry[_local5].clr == clr) {
var _local1 = enemyAry[_local5].clip;
var _local4 = mc._x - _local1._x;
var _local3 = mc._y - _local1._y;
var _local2 = (_local4 * _local4) + (_local3 * _local3);
if (_local2 <= _local6) {
_local6 = _local2;
_local8 = _local1;
}
}
}
return(_local8);
}
function unitMove() {
var _local7 = unitActiveAry.length;
while (_local7--) {
var _local5 = unitActiveAry[_local7];
if (unitActiveAry[_local7].active) {
var _local2 = _local5.clip;
var _local3 = _local5.targ;
var _local15 = _local5.clr;
var _local22 = _local5.clip._x;
var _local21 = _local5.clip._y;
var _local9 = _local5.vx;
var _local8 = _local5.vy;
var _local10 = _local5.vr;
var _local29 = _local5.a;
var _local11 = _local5.dmgDealt;
var _local14 = _local3._x - _local22;
var _local13 = _local3._y - _local21;
var _local17 = (_local14 * _local14) + (_local13 * _local13);
if (_local17 < 100) {
var _local16 = _root.attachMovie("explode", "hit", _root.getNextHighestDepth());
_local16._x = (_local3._x + random(10)) - 5;
_local16._y = (_local3._y + random(10)) - 5;
_local11++;
var _local18 = new Color(_local2.main_mc);
var _local4 = Math.floor((_local11 / unitMaxDmg) * 100);
_local4 = 100 - _local4;
if (_local15 == "red") {
var _local20 = {ra:_local4, rb:"150", ga:_local4, gb:"0", ba:_local4, bb:"0"};
} else if (_local15 == "blue") {
var _local20 = {ra:_local4, rb:"0", ga:_local4, gb:"0", ba:_local4, bb:"120"};
} else if (_local15 == "yellow") {
var _local20 = {ra:_local4, rb:"220", ga:_local4, gb:"130", ba:_local4, bb:"0"};
}
_local18.setTransform(_local20);
if (_local11 > unitMaxDmg) {
unitRemove(_local2);
}
_local3.lifebar_mc.nextFrame();
if (_local3.lifebar_mc._currentframe == 100) {
_local3.gotoAndPlay("die");
var _local19 = _local3._x;
if (_local19 < SCORE_CLOSEX) {
scoreClose(_local3);
}
enemyRemove(_local3);
clearTarget(_local3);
}
if (sndUnitHitCnt < sndUnitHitMax) {
sndUnitHit.start();
sndUnitHit.setVolume(20);
sndUnitHitCnt++;
}
}
var _local12 = Math.atan2(_local13, _local14);
var _local6 = ((_local12 * 180) / myPI) - _local2._rotation;
while (_local6 > 180) {
_local6 = _local6 - 360;
}
while (_local6 < -180) {
_local6 = _local6 + 360;
}
_local10 = _local10 + (_local6 * 0.99999);
_local10 = _local10 * 0.8;
_local2._rotation = _local2._rotation + _local10;
_local12 = (_local2._rotation * myPI) / 180;
_local9 = _local9 + (Math.cos(_local12) * 1);
_local8 = _local8 + (Math.sin(_local12) * 1);
_local9 = _local9 * 0.97;
_local8 = _local8 * 0.97;
_local2._x = _local2._x + _local9;
_local2._y = _local2._y + _local8;
unitActiveAry[_local7].x = _local2._x;
unitActiveAry[_local7].y = _local2._y;
unitActiveAry[_local7].vx = _local9;
unitActiveAry[_local7].vy = _local8;
unitActiveAry[_local7].vr = _local10;
unitActiveAry[_local7].dmgDealt = _local11;
if (_local3 == undefined) {
if ((((_local2._x > 610) || (_local2._x < -10)) || (_local2._y < -10)) || (_local2._y > 410)) {
_local2.removeMovieClip();
replaceInArray(unitActiveAry, _local7, -1);
}
}
}
}
}
function waterDamage(num) {
waterLifeCurrent = waterLifeCurrent - num;
if (waterLifeCurrent < 0) {
waterLifeCurrent = 0;
}
var _local1 = "dmg" + ((50 - waterLifeCurrent) / 10);
water_mc.gotoAndPlay(_local1);
scoreLevelEff = 0;
if (waterLifeCurrent <= 0) {
gameOver();
}
}
function waterReset() {
waterLifeCurrent = waterLifeMax;
water_mc.gotoAndStop(1);
}
function gameOver() {
setGameState(3);
delete _root.onEnterFrame;
stopAllSounds();
sndEndSting.start();
var _local3 = unitActiveAry.length;
while (_local3--) {
unitActiveAry[_local3].clip.gotoAndPlay("die");
}
setTimeout(this, "killAllUnits", 30);
setTimeout(this, "doGameOver", 5000);
}
function killAllUnits() {
var _local2 = unitAry.shift();
_local2.clip.gotoAndPlay("wasted");
if (unitAry.length > 0) {
setTimeout(this, "killAllUnits", 30);
}
}
function doGameOver() {
dataClearAll();
gotoAndStop ("gameover");
}
function gameContinue() {
retryingLevel = true;
stopAllSounds();
gotoAndStop ("replay");
helpOpen();
}
function gameReset() {
stopAllSounds();
gotoAndStop ("startGame");
}
function helpMake() {
var _local2 = _root.attachMovie("help", "help_mc", 10000);
_local2._x = 75;
_local2._y = 50;
}
function helpOpen() {
setGameState(2);
help_mc._visible = true;
var _local1 = "help" + currentLevel;
help_mc.gotoAndStop(_local1);
sndHelpOpen.start();
if (retryingLevel) {
scoreTotal_txt.text = scoreTotal;
}
}
function helpClose() {
clearInterval(helpInt);
help_mc.gotoAndStop(1);
help_mc._visible = false;
setGameState(1);
if (skipTutorialFirst) {
tutorialSkip();
delete skipTutorialFirst;
helpOpen();
return(true);
}
if ((levelIsOver == true) && (skipTutorialFirst != true)) {
levelNext();
} else if (retryingLevel) {
levelRetry();
}
}
function tutorialSkip() {
levelDataRemoveTutorial();
currentLevel = 4;
setTutorialPref(true);
}
function getTutorialPref() {
var _local2 = SharedObject.getLocal("prefs");
var _local4 = false;
if (_local2.data.skipTut) {
_local4 = _local2.data.skipTut;
var _local1 = _local2.data.expireDate;
var _local3 = new Date();
if (_local3.getTime() > _local1.getTime()) {
_local4 = false;
} else {
var _local5 = _local3.getMonth() + 1;
if (_local5 > 11) {
_local1.setMonth(0);
_local1.setYear(_local3.getYear() + 1);
} else {
_local1.setMonth(_local5);
}
_local2.data.expireDate = _local1;
_local2.flush();
}
} else {
_local2.data.skipTut = false;
}
return(_local4);
}
function setTutorialPref(bool) {
var _local2 = SharedObject.getLocal("prefs");
_local2.data.skipTut = bool;
var _local4 = new Date();
var _local1 = new Date();
var _local3 = _local4.getMonth() + 1;
if (_local3 > 11) {
_local1.setMonth(0);
_local1.setYear(Number(_local4.getFullYear()) + 1);
} else {
_local1.setMonth(_local3);
}
_local2.data.expireDate = _local1;
_local2.flush();
}
function enemyMove() {
var _local2 = enemyAry.length;
while (_local2--) {
var _local3 = enemyAry[_local2];
var _local1 = _local3.clip;
var _local4 = _local3.vx;
_local1._x = _local1._x - _local4;
enemyAry[_local2].x = _local1._x;
if (_local1._x <= 215) {
enemyGoal(_local2);
}
}
if ((sndEnemyFeetCnt < sndEnemyFeetMax) && (enemyAry.length > 0)) {
sndEnemyFeet.start();
sndEnemyFeet.setVolume(50);
sndEnemyFeetCnt++;
}
}
function enemyAttack() {
var _local12 = enemyAry.length;
var _local10 = new Array();
while (_local12--) {
var _local2 = enemyAry[_local12];
var _local8 = _local2.clr;
if (_local8 == "red") {
tclr = "blue";
} else if (_local8 == "blue") {
tclr = "yellow";
} else if (_local8 == "yellow") {
tclr = "red";
}
var _local3 = unitActiveAry.length;
while (_local3--) {
var _local1 = unitActiveAry[_local3];
var _local7 = _local1.clr;
if (_local7 == tclr) {
var _local5 = _local2.clip._x - _local1.clip._x;
var _local4 = _local2.clip._y - _local1.clip._y;
var _local6 = (_local5 * _local5) + (_local4 * _local4);
if ((_local6 < 1500) && (_local2.clip._x < 567)) {
_local2.clip.gotoAndPlay("attack");
unitActiveAry[_local3].clr = "dead";
_local10.push(_local1.clip);
}
}
}
}
var _local13 = _local10.length;
while (_local13--) {
var _local9 = _local10[_local13];
var _local11 = searchArrayForClip(unitActiveAry, _local9);
replaceInArray(unitActiveAry, _local11, -1);
_local9.gotoAndPlay("die");
}
}
function enemyGoal(num) {
var _local1 = enemyAry[num];
_local1.clip.gotoAndPlay("tar");
enemyRemove(_local1.clip);
clearTarget(_local1.clip);
waterDamage(10);
sndEnemyGoal.start();
}
function enemyRemove(mc) {
var _local1 = enemyAry.length;
while (_local1--) {
if (mc == enemyAry[_local1].clip) {
if (enemyAry[_local1].clip.segNum != undefined) {
bossSegmentDead(enemyAry[_local1].clip.segNum);
}
replaceInArray(enemyAry, _local1, -1);
}
}
}
function enemyAdd(y, clr, vx, life) {
var _local2 = _root.enemy_mc.attachMovie("enemy", "e" + enemyCount, enemyCount);
_local2._x = 620;
_local2._y = y;
_local2.gotoAndStop(clr);
_local2.clr = clr;
if ((clr == "blue") && (!vx)) {
vx = 0.9;
life = 60;
} else if ((clr == "red") && (!vx)) {
vx = 0.7;
life = 100;
} else if ((clr == "yellow") && (!vx)) {
vx = 0.5;
life = 150;
} else {
}
var _local3 = {clip:_local2, x:620, y:y, vx:vx, clr:clr, life:life};
enemyAry.push(_local3);
enemyCount++;
}
function bossSegmentAdd(clr, xpos) {
var _local2 = _root.enemy_mc.attachMovie("bossSegment", "e" + enemyCount, enemyCount);
_local2._x = xpos;
_local2._y = 225;
_local2.gotoAndStop(clr);
_local2.clr = clr;
_local2.segNum = bossStep;
var _local3 = {clip:_local2, x:425, y:220, vx:0, clr:clr, life:100};
enemyAry.push(_local3);
enemyCount++;
}
function bossSegmentDead(segNum) {
boss_mc.bossSegments_mc[("segment" + segNum) + "_mc"].gotoAndPlay("dead");
bossSegmentDeadCnt++;
if (bossSegmentDeadCnt >= 5) {
bossDead();
}
}
function bossDead() {
levelIsOver = true;
isBossDead = true;
delete this.onEnterFrame;
boss_mc.gotoAndPlay("bossDead");
var _local2 = unitActiveAry.length;
while (_local2--) {
unitActiveAry[_local2].clip.gotoAndPlay("die");
}
_local2 = enemyAry.length;
while (_local2--) {
enemyAry[_local2].clip.gotoAndPlay("die");
}
scoringStop();
var _local3 = setTimeout(levelOver, 2000);
}
function bossSegmentMove() {
bossLastX = bossX;
bossX = boss_mc.bossSegments_mc._x;
var _local2 = bossX - bossLastX;
var _local1 = enemyAry.length;
while (_local1--) {
if (enemyAry[_local1].vx == 0) {
enemyAry[_local1].clip._x = enemyAry[_local1].clip._x + _local2;
}
}
}
function gameWin() {
dataClearAll();
help_mc.gotoAndStop(1);
help_mc._visible = 0;
clearInterval(helpInt);
gotoAndStop ("gamewin");
scoreFinal_txt.text = scoreTotal;
setGameState(3);
_root.score = scoreTotal;
}
function screenShake(cnt) {
var _local2 = getTimer();
if (intScreenShake != undefined) {
clearInterval(intScreenShake);
}
intScreenShake = setInterval(this, "doScreenShake", 10, cnt, _local2);
}
function doScreenShake(cnt, startTime) {
var _local2 = random(10) - 5;
this._x = _local2;
this._y = _local2;
if ((getTimer() - 225) > startTime) {
this._x = 0;
this._y = 0;
clearInterval(intScreenShake);
}
}
function enemyManageDeploy() {
var _local5 = enemyDeployAry[0].dtime;
var _local3 = getGameClock();
if (_local5 == _local3) {
var _local1 = enemyDeployAry.shift();
var _local2 = String(_local1.clr);
if (_local2 == "boss") {
bossNextState();
} else {
var _local7 = Number(_local1.y);
var _local6 = Number(_local1.vx);
var _local4 = Number(_local1.life);
enemyAdd(_local7, _local2, _local6, _local4);
}
}
if (enemyDeployAry[0].dtime == _local3) {
enemyManageDeploy();
}
}
function levelOver() {
sndMusicBoss.stop();
sndLevelWin.start();
sndLevelWin.setVolume(50);
setGameState(0);
levelIsOver = true;
var _local1 = unitActiveAry.length;
while (_local1--) {
unitActiveAry[_local1].clip.gotoAndPlay("die");
}
_local1 = unitAry.length;
while (_local1--) {
unitAry[_local1].clip.gotoAndPlay("party");
}
scoringStop();
var _local2 = setTimeout(doLevelOver, 2000);
}
function doLevelOver() {
setGameState(4);
currentLevel++;
if (currentLevel > 13) {
bossFight = true;
}
if (currentLevel > 4) {
scoreLevelOver();
} else {
helpOpen();
}
}
function levelRetry() {
dataInitRetry();
enemyDeployAry = new Array();
enemyDeployAry = enemyDeployAryCopy.slice();
waterReset();
unitMake();
setGameState(1);
scoringStart();
bossState = 0;
bossStep = 0;
bossLastX = 0;
bossSegmentDeadCnt = 0;
bossX = boss_mc.bossSegments_mc._x;
levelIsOver = false;
retryingLevel = false;
_root.onEnterFrame = update;
}
function levelNext() {
dataClearAll();
dataInitAll();
waterReset();
unitMake();
levelDataMake();
setGameState(1);
scoringStart();
levelIsOver = false;
}
function dataInitAll() {
levelIsOver = false;
hling = false;
selecting = false;
hlx = 0;
hly = 0;
unitClr = "white";
unitAry = new Array();
unitActiveAry = new Array();
unitNewAry = new Array();
unitAddCount = 0;
unitCount = 1;
unitStartY = 107;
unitDmgWasted = 0;
totalDmgWasted = 0;
scoreLevel = 0;
scoreLevelEff = 100;
closeCount = 0;
scoreMeterSet();
scoreLevelEffCombo = 0;
effTotalAry = new Array();
enemyAry = new Array();
enemyCount = 1;
enemyDeployTimer = 0;
enemyDeployAry = new Array();
waterReset();
initGameClock();
}
function dataInitRetry() {
levelIsOver = false;
hling = false;
selecting = false;
hlx = 0;
hly = 0;
unitClr = "white";
unitAry = new Array();
unitActiveAry = new Array();
unitNewAry = new Array();
unitAddCount = 0;
unitCount = 1;
unitStartY = 107;
unitDmgWasted = 0;
totalDmgWasted = 0;
scoreLevel = 0;
scoreLevelEff = 100;
closeCount = 0;
scoreMeterSet();
scoreLevelEffCombo = 0;
effTotalAry = new Array();
enemyAry = new Array();
enemyCount = 1;
enemyDeployTimer = 0;
waterReset();
sndUnitHitCnt = 0;
sndEnemyFeetCnt = 0;
initGameClock();
}
function dataClearAll() {
var _local1 = enemyAry.length;
while (_local1--) {
enemyAry[_local1].clip.removeMovieClip();
}
delete enemyAry;
_local1 = unitActiveAry.length;
while (_local1--) {
unitActiveAry[_local1].clip.removeMovieClip();
}
delete unitActiveAry;
_local1 = unitAry.length;
while (_local1--) {
unitAry[_local1].clip.removeMovieClip();
}
delete unitAry;
_local1 = unitNewAry.length;
while (_local1--) {
unitNewAry[_local1].clip.removeMovieClip();
}
delete unitNewAry;
}
function levelDataMake() {
var _local11 = enemyXML.firstChild;
var _local9 = _local11.firstChild.childNodes;
enemyDeployAry = new Array();
var _local10 = _local9.length;
var _local2 = 0;
while (_local2 < _local10) {
var _local1 = _local9[_local2];
var _local6 = _local1.attributes.clr;
var _local8 = _local1.attributes.y;
var _local5 = _local1.attributes.velx;
var _local4 = _local1.attributes.life;
var _local7 = _local1.attributes.dtime;
var _local3 = {y:_local8, clr:_local6, vx:_local5, life:_local4, dtime:_local7};
enemyDeployAry.push(_local3);
_local2++;
}
enemyDeployAryCopy = new Array();
enemyDeployAryCopy = enemyDeployAry.slice();
_local11.firstChild.removeNode();
}
function levelDataRemoveTutorial() {
var _local3 = 4 - currentLevel;
var _local1 = 0;
while (_local1 < _local3) {
var _local2 = enemyXML.firstChild;
_local2.firstChild.removeNode();
_local1++;
}
}
function enemyParseXML(success) {
var _local3 = this.firstChild;
var _local2 = _local3.firstChild.childNodes;
initializeGame();
}
function replaceInArray(array, findVal, replaceVal) {
var _local4 = array.length - 1;
if (findVal == _local4) {
array.pop();
if (replaceVal != -1) {
array.push(replaceVal);
}
} else if (findVal == 0) {
array.shift();
if (replaceVal != -1) {
array.unshift(replaceVal);
}
} else if (replaceVal != -1) {
array.splice(findVal, 1, replaceVal);
} else {
array.splice(findVal, 1);
}
}
function doHighlight() {
highlight_mc.clear();
highlight_mc.moveTo(hlx, hly);
highlight_mc.lineStyle(0, 0, 100);
if ((hlx < _xmouse) && (hly < _ymouse)) {
highlight_mc.beginFill(16711680, 25);
unitClr = "red";
} else if ((hlx > _xmouse) && (hly < _ymouse)) {
highlight_mc.beginFill(39372, 25);
unitClr = "blue";
} else if ((hlx < _xmouse) && (hly > _ymouse)) {
highlight_mc.beginFill(16776960, 25);
unitClr = "yellow";
} else {
highlight_mc.beginFill(16777215, 25);
unitClr = "gray";
}
highlight_mc.lineTo(_xmouse, hly);
highlight_mc.lineTo(_xmouse, _ymouse);
highlight_mc.lineTo(hlx, _ymouse);
}
function clearHighlight() {
highlight_mc.clear();
}
function doSelect() {
selecting = false;
var _local1 = unitAry.length;
while (_local1--) {
if (unitAry[_local1].clip.hitTest(highlight_mc)) {
unitActivate(_local1, unitClr);
}
}
sndUnitSelect.start();
}
function scoringStart() {
scoreReset();
}
function scoringStop() {
}
function scoreReset() {
scoreMeter_mc.gotoAndStop(100);
scoreLevel = 0;
score_txt.text = scoreLevel;
}
function scoreLevelOver() {
var _local7 = waterLifeCurrent * SCORE_WATERBONUS;
var _local4 = unitAry.length;
var _local8 = _local4 * SCORE_RUNIT;
var _local5 = closeCount * SCORE_CLOSE;
var _local1 = effTotalAry.length;
var _local6 = effTotalAry.length;
var _local2 = 0;
while (_local1--) {
_local2 = _local2 + effTotalAry[_local1];
}
var _local3 = Math.floor(_local2 / _local6);
if (_local3 < 0) {
_local3 = 0;
}
tallyCallback = scoreTallyDone;
tallyAry = new Array();
tallyAry.push({txtbox:"levelScore_txt", scoreNum:scoreLevel, timeDone:1000});
tallyAry.push({txtbox:"unitsLeft_txt", scoreNum:_local8, timeDone:1000});
tallyAry.push({txtbox:"closeCall_txt", scoreNum:_local5, timeDone:1000});
tallyAry.push({txtbox:"waterBonus_txt", scoreNum:_local7, timeDone:1000});
tallyAry.push({txtbox:"levelSkill_txt", scoreNum:_local3, timeDone:1000, extra:"%"});
help_mc._visible = true;
help_mc.gotoAndStop("tally");
scoreTally();
}
function scoreTally() {
if (tallyAry.length > 0) {
varToTally = 0;
var _local4 = tallyAry[0].scoreNum;
var _local5 = tallyAry[0].timeDone;
var _local3 = _local5 / 50;
var _local2 = Math.floor(_local4 / _local3);
timer = getTimer();
if (tallyInt != undefined) {
clearInterval(tallyInt);
}
tallyInt = setInterval(this, "doScoreTally", 20, _local2);
} else {
sndScoreCount.start();
help_mc.totalScore_txt.text = scoreTotal;
if (intTallyDone != undefined) {
clearInterval(intTallyDone);
}
intTallyDone = setTimeout(this, "scoreTallyDone", 1000);
}
}
function doScoreTally(tallyCnt) {
var _local2 = tallyAry[0];
help_mc[_local2.txtbox].text = varToTally;
if (_local2.extra) {
help_mc[_local2.txtbox].text = help_mc[_local2.txtbox].text + _local2.extra;
}
sndScoreCount.start();
sndScoreCount.setVolume(10);
if (varToTally >= _local2.scoreNum) {
help_mc[_local2.txtbox].text = _local2.scoreNum;
if (_local2.extra) {
help_mc[_local2.txtbox].text = help_mc[_local2.txtbox].text + _local2.extra;
}
scoreTotal = scoreTotal + _local2.scoreNum;
clearInterval(tallyInt);
tallyAry.shift();
if (intTallyWait != undefined) {
clearInterval(intTallyWait);
}
intTallyWait = setTimeout(this, "scoreTally", 500);
}
varToTally = varToTally + tallyCnt;
}
function scoreTallyDone() {
clearInterval(intTallyDone);
clearInterval(tallyInt);
clearInterval(intTallyWait);
scoreTotal_txt.text = scoreTotal;
tallyAry = new Array();
help_mc.gotoAndStop("tallyDone");
setGameState(5);
}
function scoreTallySkip() {
var _local2 = tallyAry.length;
var _local1 = 0;
while (_local1 < _local2) {
help_mc[tallyAry[_local1].txtbox].text = tallyAry[_local1].scoreNum;
scoreTotal = scoreTotal + tallyAry[_local1].scoreNum;
if (tallyAry[_local1].extra) {
help_mc[tallyAry[_local1].txtbox].text = help_mc[tallyAry[_local1].txtbox].text + tallyAry[_local1].extra;
}
_local1++;
}
help_mc.totalScore_txt.text = scoreTotal;
scoreTallyDone();
}
function scoreAll() {
if ((gameState == 1) && (currentLevel > 3)) {
scoreCalc();
scoreMeterSet();
scoreTextSet();
}
}
function scoreClose(mc) {
var _local1 = attachMovie("msg_closeCall", "msg", getNextHighestDepth());
_local1._x = mc._x;
_local1._y = mc._y;
closeCount++;
}
function scoreCalc() {
if (unitDmgWasted > 0) {
unitDmgWasted = Math.floor(unitDmgWasted * 0.75);
}
scoreLevelEff = 100 - unitDmgWasted;
effTotalAry.push(scoreLevelEff);
if (scoreLevelEff < 0) {
scoreLevelEff = 0;
} else if (scoreLevelEff < 100) {
scoreLevelEff = scoreLevelEff + 5;
}
if (scoreLevelEff >= 100) {
scoreLevelEffCombo++;
if (scoreLevelEffCombo >= 3) {
scoreLevelEff = 500;
}
} else {
scoreLevelEffCombo = 0;
}
var _local1 = Math.floor(100 * (scoreLevelEff / 100));
scoreLevel = scoreLevel + _local1;
scoreAnimation(_local1);
}
function scoreAnimation(score) {
var _local1 = attachMovie("scoreAnimation", "scoreAnim_mc", getNextHighestDepth());
_local1._x = 506;
_local1._y = 2;
_local1.score = score;
meterFlash_mc.gotoAndPlay(2);
}
function scoreTextSet() {
score_txt.text = scoreLevel;
}
function scoreMeterSet() {
if (scoreLevelEff == 200) {
scoreMeter_mc.gotoAndStop("superScore");
} else if ((scoreLevelEff > 100) && (scoreLevelEff < 200)) {
scoreMeter_mc.gotoAndStop("maxScore");
} else if (scoreLevelEff == 0) {
scoreMeter_mc.gotoAndStop(1);
} else {
scoreMeter_mc.gotoAndStop(scoreLevelEff);
}
}
function initGameClock() {
gameTick = 0;
}
function updateGameClock() {
gameTick++;
}
function resetGameClock() {
gameTick = 0;
}
function getGameClock() {
return(gameTick);
}
function setGameState(num) {
gameState = num;
}
function initializeGame() {
skipTutorial = getTutorialPref();
if (skipTutorial) {
tutorialSkip();
} else {
skipTutorialFirst = false;
}
helpMake();
soundInit();
initLevel();
}
function initLevel() {
unitMake();
levelDataMake();
helpOpen();
_root.onEnterFrame = update;
unitAddAnimCnt = 0;
}
function bossNextState() {
var _local1 = 5;
if (bossState == 0) {
stopAllSounds();
sndMusicBoss.start(0, 999);
sndMusicBoss.setVolume(50);
boss_mc.play();
bossState = 1;
} else if ((bossState == 1) && (bossStep < _local1)) {
if (bossStep == 0) {
boss_mc.gotoAndPlay("tarDeploy");
} else {
boss_mc.gotoAndPlay("newSeg");
}
var _local2 = ["red", "blue", "yellow", "red", "blue"];
var _local3 = [545, 530, 515, 502, 486];
bossSegmentAdd(_local2[bossStep], _local3[bossStep]);
bossStep++;
bossState = 1;
} else if ((bossState == 1) && (bossStep == _local1)) {
boss_mc.gotoAndPlay("finalAttack");
bossState = 2;
} else if (bossState == 2) {
} else if (bossState == 3) {
boss_mc.gotoAndPlay("tarDeploy");
}
}
function constrain360(num) {
if (num < 0) {
var _local2 = (180 + num) + 180;
} else if (num == 360) {
num = 0;
}
return(_local2);
}
function update() {
loopTimer = getTimer();
if (gameState == 0) {
} else if (gameState == 1) {
updateGameClock();
if (hling) {
highlight_mc._alpha = 100;
doHighlight();
ymouse_txt.text = _root._ymouse;
if (_ymouse > 395) {
hling = false;
selecting = true;
doHighlight();
}
} else if (highlight_mc._alpha > 0) {
highlight_mc._alpha = highlight_mc._alpha - 5;
} else {
highlight_mc.clear();
}
if (selecting) {
doSelect();
}
unitMove();
unitAddRowTimer();
enemyManageDeploy();
enemyMove();
if (bossFight && (bossState == 2)) {
bossSegmentMove();
}
if ((getGameClock() % 90) == 0) {
scoreAll();
}
if (((enemyDeployAry.length == 0) && (enemyAry.length == 0)) && (waterLifeCurrent > 0)) {
levelOver();
}
} else if (gameState == 2) {
} else if (gameState == 3) {
} else if (gameState == 4) {
} else if (gameState == 5) {
}
}
var mouseListener = new Object();
mouseListener.onMouseDown = function () {
if (gameState == 0) {
} else if (gameState == 1) {
hling = true;
hlx = _xmouse;
hly = _ymouse;
if (pause_btn.hitTest(_xmouse, _ymouse)) {
if (gamePaused == false) {
delete _root.onEnterFrame;
gamePaused = true;
pause_btn.gotoAndStop("pause");
} else {
gamePaused = false;
_root.onEnterFrame = update;
pause_btn.gotoAndStop("play");
}
} else if (mute_btn.hitTest(_xmouse, _ymouse)) {
if (gameMute == false) {
gameMute = true;
mute_btn.gotoAndStop("mute");
} else {
gameMute = false;
mute_btn.gotoAndStop("sound");
}
}
} else if (gameState == 2) {
if ((skipTutorialFirst == false) && (help_mc.cbSkipTut_mc.hitTest(_xmouse, _ymouse))) {
skipTutorialFirst = true;
help_mc.cbSkipTut_mc.gotoAndStop("on");
} else if ((skipTutorialFirst == true) && (help_mc.cbSkipTut_mc.hitTest(_xmouse, _ymouse))) {
skipTutorialFirst = false;
help_mc.cbSkipTut_mc.gotoAndStop("off");
} else if ((currentLevel == 1) && (seenTut1 != true)) {
help_mc.nextFrame();
} else {
helpClose();
}
} else if (gameState == 3) {
if (continue_btn.hitTest(_xmouse, _ymouse)) {
gameContinue();
} else if (restart_btn.hitTest(_xmouse, _ymouse)) {
gameReset();
}
} else if (gameState == 4) {
scoreTallySkip();
} else if (gameState == 5) {
if (isBossDead == true) {
gameWin();
} else {
helpOpen();
}
}
};
mouseListener.onMouseUp = function () {
hling = false;
selecting = true;
};
Mouse.addListener(mouseListener);
setGameState(0);
currentLevel = 1;
retryingLevel = false;
bossFight = false;
isBossDead = false;
bossState = 0;
bossStep = 0;
bossLastX = 0;
bossX = boss_mc.bossSegments_mc._x;
bossSegmentDeadCnt = 0;
helpInt = 0;
unitAddInt = 25;
unitMaxDmg = 20;
waterLifeMax = 50;
SCORE_CLOSEX = 280;
SCORE_CLOSE = 250;
SCORE_RUNIT = 10;
SCORE_WATERBONUS = 10;
closeCount = 0;
myPI = Math.PI;
tallyAry = new Array();
tallyVar = 0;
tallyInt = 0;
intTallyDone = 0;
intTallyWait = 0;
gamePaused = false;
effTotalAry = [];
effAvg = 0;
loopTimer = getTimer();
scoreTotal = 0;
sndCount = 0;
dataInitAll();
levelDataPath = "levels.xml";
var enemyXML = new XML("<levels><level><enemy clr=\"red\" y=\"220\" dtime=\"15\" /><enemy clr=\"red\" y=\"85\" dtime=\"255\" /><enemy clr=\"red\" y=\"365\" dtime=\"255\" /><enemy clr=\"red\" y=\"220\" dtime=\"405\" /></level><level><enemy clr=\"blue\" y=\"220\" dtime=\"15\" /><enemy clr=\"blue\" y=\"85\" dtime=\"165\" /><enemy clr=\"blue\" y=\"365\" dtime=\"165\" /><enemy clr=\"blue\" y=\"220\" dtime=\"315\" /></level><level><enemy clr=\"yellow\" y=\"150\" dtime=\"15\" /><enemy clr=\"yellow\" y=\"290\" dtime=\"15\" /><enemy clr=\"yellow\" y=\"220\" dtime=\"135\" /><enemy clr=\"yellow\" y=\"220\" dtime=\"270\" /></level><level><enemy clr=\"red\" y=\"226\" dtime=\"15\" /><enemy clr=\"red\" y=\"85\" dtime=\"270\" /><enemy clr=\"red\" y=\"366\" dtime=\"270\" /><enemy clr=\"red\" y=\"154\" dtime=\"570\" /><enemy clr=\"red\" y=\"296\" dtime=\"570\" /><enemy clr=\"red\" y=\"227\" dtime=\"900\" /><enemy clr=\"red\" y=\"152\" dtime=\"1055\" /><enemy clr=\"red\" y=\"296\" dtime=\"1055\" /></level><level><enemy clr=\"red\" y=\"156\" dtime=\"15\" /><enemy clr=\"red\" y=\"295\" dtime=\"15\" /><enemy clr=\"blue\" y=\"224\" dtime=\"195\" /><enemy clr=\"red\" y=\"226\" dtime=\"360\" /><enemy clr=\"blue\" y=\"85\" dtime=\"480\" /><enemy clr=\"blue\" y=\"364\" dtime=\"480\" /><enemy clr=\"red\" y=\"295\" dtime=\"675\" /><enemy clr=\"red\" y=\"156\" dtime=\"675\" /><enemy clr=\"blue\" y=\"226\" dtime=\"825\" /></level><level><enemy clr=\"yellow\" y=\"365\" dtime=\"15\" /><enemy clr=\"yellow\" y=\"85\" dtime=\"15\" /><enemy clr=\"blue\" y=\"224\" dtime=\"135\" /><enemy clr=\"blue\" y=\"156\" dtime=\"345\" /><enemy clr=\"blue\" y=\"296\" dtime=\"345\" /><enemy clr=\"yellow\" y=\"225\" dtime=\"570\" /><enemy clr=\"blue\" y=\"82\" dtime=\"645\" /><enemy clr=\"red\" y=\"294\" dtime=\"765\" /><enemy clr=\"red\" y=\"153\" dtime=\"765\" /></level><level><enemy clr=\"red\" y=\"226\" dtime=\"15\" /><enemy clr=\"blue\" y=\"152\" dtime=\"150\" /><enemy clr=\"yellow\" y=\"87\" dtime=\"195\" /><enemy clr=\"yellow\" y=\"367\" dtime=\"195\" /><enemy clr=\"red\" y=\"295\" dtime=\"300\" /><enemy clr=\"blue\" y=\"226\" dtime=\"360\" /><enemy clr=\"red\" y=\"153\" dtime=\"645\" /><enemy clr=\"blue\" y=\"224\" dtime=\"645\" /><enemy clr=\"yellow\" y=\"223\" dtime=\"720\" /><enemy clr=\"red\" y=\"298\" dtime=\"960\" /></level><level><enemy clr=\"red\" y=\"220\" dtime=\"15\" /><enemy clr=\"red\" y=\"85\" dtime=\"255\" /><enemy clr=\"red\" y=\"365\" dtime=\"255\" /><enemy clr=\"blue\" y=\"220\" dtime=\"435\" /><enemy clr=\"yellow\" y=\"85\" dtime=\"480\" /><enemy clr=\"yellow\" y=\"365\" dtime=\"480\" /><enemy clr=\"red\" y=\"155\" dtime=\"660\" /><enemy clr=\"red\" y=\"295\" dtime=\"660\" /><enemy clr=\"blue\" y=\"220\" dtime=\"735\" /></level><level><enemy clr=\"red\" y=\"220\" dtime=\"15\" /><enemy clr=\"red\" y=\"80\" dtime=\"315\" /><enemy clr=\"red\" y=\"350\" dtime=\"315\" /><enemy clr=\"yellow\" y=\"154\" dtime=\"360\" /><enemy clr=\"yellow\" y=\"293\" dtime=\"360\" /><enemy clr=\"blue\" y=\"225\" dtime=\"615\" /><enemy clr=\"red\" y=\"226\" dtime=\"780\" /><enemy clr=\"yellow\" y=\"227\" dtime=\"930\" /><enemy clr=\"blue\" y=\"86\" dtime=\"960\" /><enemy clr=\"blue\" y=\"365\" dtime=\"960\" /><enemy clr=\"red\" y=\"155\" dtime=\"1045\" /><enemy clr=\"red\" y=\"297\" dtime=\"1045\" /><enemy clr=\"blue\" y=\"367\" dtime=\"1320\" /></level><level><enemy clr=\"yellow\" y=\"180\" dtime=\"15\" /><enemy clr=\"yellow\" y=\"260\" dtime=\"15\" /><enemy clr=\"blue\" y=\"220\" dtime=\"195\" /><enemy clr=\"yellow\" y=\"85\" dtime=\"540\" /><enemy clr=\"yellow\" y=\"365\" dtime=\"540\" /><enemy clr=\"blue\" y=\"225\" dtime=\"540\" /><enemy clr=\"red\" y=\"220\" dtime=\"720\" /><enemy clr=\"blue\" y=\"153\" dtime=\"870\" /><enemy clr=\"blue\" y=\"297\" dtime=\"870\" /><enemy clr=\"red\" y=\"365\" dtime=\"960\" /><enemy clr=\"red\" y=\"85\" dtime=\"960\" /><enemy clr=\"yellow\" y=\"226\" dtime=\"1005\" /></level><level><enemy clr=\"blue\" y=\"223\" dtime=\"15\" /><enemy clr=\"red\" y=\"365\" dtime=\"15\" /><enemy clr=\"red\" y=\"94\" dtime=\"15\" /><enemy clr=\"red\" y=\"158\" dtime=\"60\" /><enemy clr=\"red\" y=\"296\" dtime=\"60\" /><enemy clr=\"yellow\" y=\"227\" dtime=\"135\" /><enemy clr=\"red\" y=\"154\" dtime=\"330\" /><enemy clr=\"blue\" y=\"290\" dtime=\"330\" /><enemy clr=\"yellow\" y=\"225\" dtime=\"465\" /><enemy clr=\"red\" y=\"297\" dtime=\"690\" /><enemy clr=\"blue\" y=\"154\" dtime=\"690\" /></level><level><enemy clr=\"red\" y=\"223\" dtime=\"15\" /><enemy clr=\"blue\" y=\"155\" dtime=\"105\" /><enemy clr=\"blue\" y=\"296\" dtime=\"105\" /><enemy clr=\"red\" y=\"155\" dtime=\"300\" /><enemy clr=\"red\" y=\"297\" dtime=\"300\" /><enemy clr=\"yellow\" y=\"366\" dtime=\"375\" /><enemy clr=\"yellow\" y=\"85\" dtime=\"375\" /><enemy clr=\"blue\" y=\"225\" dtime=\"405\" /><enemy clr=\"yellow\" y=\"224\" dtime=\"690\" /><enemy clr=\"red\" y=\"155\" dtime=\"810\" /><enemy clr=\"red\" y=\"298\" dtime=\"810\" /></level><level><enemy clr=\"yellow\" y=\"85\" dtime=\"15\" /><enemy clr=\"yellow\" y=\"367\" dtime=\"15\" /><enemy clr=\"red\" y=\"156\" dtime=\"15\" /><enemy clr=\"red\" y=\"294\" dtime=\"15\" /><enemy clr=\"blue\" y=\"227\" dtime=\"15\" /><enemy clr=\"blue\" y=\"224\" dtime=\"285\" /><enemy clr=\"red\" y=\"85\" dtime=\"465\" /><enemy clr=\"red\" y=\"364\" dtime=\"465\" /><enemy clr=\"yellow\" y=\"225\" dtime=\"540\" /><enemy clr=\"blue\" y=\"154\" dtime=\"600\" /><enemy clr=\"blue\" y=\"296\" dtime=\"600\" /><enemy clr=\"blue\" y=\"366\" dtime=\"930\" /><enemy clr=\"blue\" y=\"89\" dtime=\"930\" /><enemy clr=\"red\" y=\"262\" dtime=\"945\" /><enemy clr=\"red\" y=\"189\" dtime=\"945\" /></level><level><enemy clr=\"boss\" dtime=\"15\" /><enemy clr=\"boss\" y=\"227\" dtime=\"120\" /><enemy clr=\"blue\" y=\"366\" dtime=\"125\" /><enemy clr=\"yellow\" y=\"85\" dtime=\"125\" /><enemy clr=\"blue\" y=\"365\" dtime=\"435\" /><enemy clr=\"red\" y=\"87\" dtime=\"505\" /><enemy clr=\"boss\" y=\"225\" dtime=\"655\" /><enemy clr=\"yellow\" y=\"86\" dtime=\"720\" /><enemy clr=\"red\" y=\"366\" dtime=\"805\" /><enemy clr=\"boss\" y=\"225\" dtime=\"1110\" /><enemy clr=\"red\" y=\"87\" dtime=\"1110\" /><enemy clr=\"blue\" y=\"366\" dtime=\"1145\" /><enemy clr=\"blue\" y=\"86\" dtime=\"1345\" /><enemy clr=\"boss\" y=\"225\" dtime=\"1535\" /><enemy clr=\"red\" y=\"86\" dtime=\"1585\" /><enemy clr=\"blue\" y=\"366\" dtime=\"1645\" /><enemy clr=\"yellow\" y=\"86\" dtime=\"1795\" /><enemy clr=\"red\" y=\"366\" dtime=\"1900\" /><enemy clr=\"boss\" y=\"230\" dtime=\"1905\" /><enemy clr=\"boss\" y=\"230\" dtime=\"2250\" /></level></levels>");
enemyParseXML();
stop();
Frame 185
continue_btn.onRollOver = function () {
continue_btn.gotoAndStop(2);
sndUnitHit.start();
};
continue_btn.onRollOut = (continue_btn.onDragOut = function () {
continue_btn.gotoAndStop(1);
});
restart_btn.onRollOver = function () {
restart_btn.gotoAndStop(2);
sndUnitHit.start();
};
restart_btn.onRollOut = (restart_btn.onDragOut = function () {
restart_btn.gotoAndStop(1);
});
Frame 195
submit_btn.onRollOver = function () {
submit_btn.gotoAndStop(2);
sndUnitHit.start();
};
submit_btn.onRollOut = (submit_btn.onDragOut = function () {
submit_btn.gotoAndStop(1);
});
restart_btn.onRollOver = function () {
restart_btn.gotoAndStop(2);
sndUnitHit.start();
};
restart_btn.onRollOut = (restart_btn.onDragOut = function () {
restart_btn.gotoAndStop(1);
});
Symbol 17 MovieClip Frame 1
stop();
Symbol 17 MovieClip Frame 10
stop();
Symbol 21 MovieClip Frame 1
stop();
Symbol 22 MovieClip Frame 1
this._alpha = 0;
this.tel = 0;
this.play_latest_text._visible = false;
this.onEnterFrame = function () {
if (this._alpha < 100) {
this._alpha = this._alpha + 10;
} else {
this.tel++;
if (this.play_latest_text._visible == false) {
this.play_latest_text._visible = true;
this.play_latest_text.play();
}
}
if (this.tel > 85) {
this._alpha = this._alpha - 15;
if (this._alpha <= 0) {
delete this.onEnterFrame;
}
}
};
stop();
this.onRollOver = function () {
this.logo_ro.gotoAndStop(2);
};
this.onRollOut = function () {
this.logo_ro.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.logo_ro.gotoAndStop(1);
};
this.onRelease = function () {
getURL ("http://www.bubblebox.com/", "_blank");
};
Symbol 63 MovieClip [seed] Frame 1
stop();
Symbol 63 MovieClip [seed] Frame 18
stop();
Symbol 63 MovieClip [seed] Frame 65
gotoAndPlay ("party");
Symbol 63 MovieClip [seed] Frame 92
this.removeMovieClip();
Symbol 63 MovieClip [seed] Frame 97
play();
Symbol 63 MovieClip [seed] Frame 102
this.removeMovieClip();
Symbol 66 MovieClip [scoreAnimation] Frame 1
this.text_mc.scoreAnim_txt.text = "+" + this.score;
play();
Symbol 66 MovieClip [scoreAnimation] Frame 15
this.removeMovieClip();
Symbol 70 MovieClip [msg_closeCall] Frame 20
this.removeMovieClip();
Symbol 93 MovieClip Frame 1
stop();
Symbol 118 MovieClip [enemy] Frame 1
stop();
Symbol 118 MovieClip [enemy] Frame 5
stop();
Symbol 118 MovieClip [enemy] Frame 10
stop();
Symbol 118 MovieClip [enemy] Frame 15
stop();
Symbol 118 MovieClip [enemy] Frame 34
gotoAndStop(clr);
Symbol 118 MovieClip [enemy] Frame 42
play();
Symbol 118 MovieClip [enemy] Frame 53
stop();
this.removeMovieClip();
Symbol 118 MovieClip [enemy] Frame 65
play();
Symbol 118 MovieClip [enemy] Frame 72
stop();
this.removeMovieClip();
Symbol 126 MovieClip [explode] Frame 1
play();
Symbol 126 MovieClip [explode] Frame 6
this.removeMovieClip();
Symbol 127 MovieClip Frame 50
tar_mc.lifebar_mc.nextFrame();
Symbol 127 MovieClip Frame 51
tar_mc.lifebar_mc.nextFrame();
Symbol 127 MovieClip Frame 53
tar_mc.lifebar_mc.nextFrame();
Symbol 127 MovieClip Frame 54
tar_mc.lifebar_mc.nextFrame();
Symbol 127 MovieClip Frame 56
tar_mc.lifebar_mc.nextFrame();
Symbol 127 MovieClip Frame 57
tar_mc.lifebar_mc.nextFrame();
Symbol 127 MovieClip Frame 59
tar_mc.lifebar_mc.nextFrame();
Symbol 131 MovieClip Frame 1
stop();
Symbol 139 MovieClip Frame 1
tar_mc.gotoAndStop(15);
Symbol 139 MovieClip Frame 50
tar_mc.lifebar_mc.nextFrame();
Symbol 139 MovieClip Frame 51
tar_mc.lifebar_mc.nextFrame();
Symbol 139 MovieClip Frame 53
tar_mc.lifebar_mc.nextFrame();
Symbol 139 MovieClip Frame 54
tar_mc.lifebar_mc.nextFrame();
Symbol 139 MovieClip Frame 56
tar_mc.lifebar_mc.nextFrame();
Symbol 139 MovieClip Frame 57
tar_mc.lifebar_mc.nextFrame();
Symbol 139 MovieClip Frame 59
tar_mc.lifebar_mc.nextFrame();
Symbol 147 MovieClip Frame 1
tar_mc.gotoAndStop(10);
Symbol 147 MovieClip Frame 50
tar_mc.lifebar_mc.nextFrame();
Symbol 147 MovieClip Frame 51
tar_mc.lifebar_mc.nextFrame();
Symbol 147 MovieClip Frame 53
tar_mc.lifebar_mc.nextFrame();
Symbol 147 MovieClip Frame 54
tar_mc.lifebar_mc.nextFrame();
Symbol 147 MovieClip Frame 56
tar_mc.lifebar_mc.nextFrame();
Symbol 147 MovieClip Frame 57
tar_mc.lifebar_mc.nextFrame();
Symbol 147 MovieClip Frame 59
tar_mc.lifebar_mc.nextFrame();
Symbol 191 MovieClip Frame 1
stop();
Symbol 191 MovieClip Frame 22
gotoAndPlay ("cyc1");
Symbol 191 MovieClip Frame 31
stop();
Symbol 191 MovieClip Frame 61
gotoAndPlay ("cyc2");
Symbol 191 MovieClip Frame 78
gotoAndPlay ("cyc3");
Symbol 191 MovieClip Frame 95
gotoAndPlay ("cyc4");
Symbol 191 MovieClip Frame 106
stop();
Symbol 255 MovieClip [help] Frame 1
if (_parent.skipTutorial) {
cbSkipTut_mc.gotoAndStop("off");
}
stop();
Symbol 255 MovieClip [help] Frame 5
stop();
Symbol 255 MovieClip [help] Frame 6
_parent.seenTut1 = true;
cbSkipTut_mc.onRollOver = function () {
sndUnitHit.start();
};
Symbol 255 MovieClip [help] Frame 13
cbSkipTut_mc.onRollOver = function () {
sndUnitHit.start();
};
Symbol 255 MovieClip [help] Frame 18
cbSkipTut_mc.onRollOver = function () {
sndUnitHit.start();
};
Symbol 256 MovieClip [fx_tar_die] Frame 7
stop();
this.removeMovieClip();
Symbol 257 MovieClip [bossSegment] Frame 1
stop();
Symbol 257 MovieClip [bossSegment] Frame 32
play();
Symbol 257 MovieClip [bossSegment] Frame 37
stop();
this.removeMovieClip();
Symbol 274 MovieClip Frame 1
stop();
Symbol 292 MovieClip Frame 1
stop();
Symbol 315 MovieClip Frame 1
stop();
Symbol 315 MovieClip Frame 2
play();
Symbol 315 MovieClip Frame 67
gotoAndPlay ("pause1");
Symbol 315 MovieClip Frame 83
gotoAndStop (1);
Symbol 319 MovieClip Frame 1
stop();
Symbol 319 MovieClip Frame 5
play();
Symbol 319 MovieClip Frame 15
stop();
Symbol 323 MovieClip Frame 1
stop();
Symbol 323 MovieClip Frame 5
play();
Symbol 323 MovieClip Frame 15
stop();
Symbol 327 MovieClip Frame 1
stop();
Symbol 327 MovieClip Frame 5
play();
Symbol 327 MovieClip Frame 15
stop();
Symbol 331 MovieClip Frame 1
stop();
Symbol 331 MovieClip Frame 5
play();
Symbol 331 MovieClip Frame 15
stop();
Symbol 335 MovieClip Frame 1
stop();
Symbol 335 MovieClip Frame 5
play();
Symbol 335 MovieClip Frame 15
stop();
Symbol 353 MovieClip Frame 1
stop();
Symbol 353 MovieClip Frame 7
stop();
Symbol 353 MovieClip Frame 13
stop();
Symbol 353 MovieClip Frame 19
stop();
Symbol 353 MovieClip Frame 25
stop();
Symbol 353 MovieClip Frame 31
stop();
Symbol 360 MovieClip Frame 1
stop();
Symbol 360 MovieClip Frame 2
bossLegs_mc.gotoAndPlay(2);
Symbol 360 MovieClip Frame 15
_parent.screenShake(5);
Symbol 360 MovieClip Frame 41
_parent.screenShake(5);
Symbol 360 MovieClip Frame 68
_parent.screenShake(5);
Symbol 360 MovieClip Frame 95
_parent.screenShake(5);
Symbol 360 MovieClip Frame 103
stop();
bossLegs_mc.gotoAndStop(1);
Symbol 360 MovieClip Frame 117
bossLegs_mc.gotoAndPlay("jitter");
Symbol 360 MovieClip Frame 123
bossTars_mc.play();
Symbol 360 MovieClip Frame 128
stop();
Symbol 360 MovieClip Frame 145
bossLegs_mc.gotoAndPlay("jitter");
Symbol 360 MovieClip Frame 153
bossTars_mc.play();
Symbol 360 MovieClip Frame 156
stop();
Symbol 360 MovieClip Frame 180
bossLegs_mc.gotoAndPlay(2);
Symbol 360 MovieClip Frame 299
bossLegs_mc.stop();
_parent.waterDamage(_parent.waterLifeMax);
Symbol 360 MovieClip Frame 301
stop();
Symbol 360 MovieClip Frame 308
var t = this.attachMovie("fx_tar_die", "f", this.getNextHighestDepth());
t._x = random(150) + 295;
t._y = random(70) + 132;
_parent.screenShake(5);
Symbol 360 MovieClip Frame 312
var t = this.attachMovie("fx_tar_die", "f", this.getNextHighestDepth());
t._x = random(150) + 295;
t._y = random(70) + 132;
Symbol 360 MovieClip Frame 317
var t = this.attachMovie("fx_tar_die", "f", this.getNextHighestDepth());
t._x = random(150) + 295;
t._y = random(70) + 132;
_parent.screenShake(5);
Symbol 360 MovieClip Frame 322
var t = this.attachMovie("fx_tar_die", "f", this.getNextHighestDepth());
t._x = random(150) + 295;
t._y = random(70) + 132;
Symbol 360 MovieClip Frame 327
var t = this.attachMovie("fx_tar_die", "f", this.getNextHighestDepth());
t._x = random(150) + 295;
t._y = random(70) + 132;
_parent.screenShake(5);
Symbol 360 MovieClip Frame 332
var t = this.attachMovie("fx_tar_die", "f", this.getNextHighestDepth());
t._x = random(150) + 295;
t._y = random(70) + 132;
Symbol 360 MovieClip Frame 337
var t = this.attachMovie("fx_tar_die", "f", this.getNextHighestDepth());
t._x = random(150) + 295;
t._y = random(70) + 132;
_parent.screenShake(5);
Symbol 360 MovieClip Frame 341
var t = this.attachMovie("fx_tar_die", "f", this.getNextHighestDepth());
t._x = random(150) + 295;
t._y = random(70) + 132;
Symbol 360 MovieClip Frame 346
var t = this.attachMovie("fx_tar_die", "f", this.getNextHighestDepth());
t._x = random(150) + 295;
t._y = random(70) + 132;
_parent.screenShake(5);
Symbol 360 MovieClip Frame 351
var t = this.attachMovie("fx_tar_die", "f", this.getNextHighestDepth());
t._x = random(150) + 295;
t._y = random(70) + 132;
Symbol 360 MovieClip Frame 356
var t = this.attachMovie("fx_tar_die", "f", this.getNextHighestDepth());
t._x = random(150) + 295;
t._y = random(70) + 132;
_parent.screenShake(5);
Symbol 360 MovieClip Frame 360
var t = this.attachMovie("fx_tar_die", "f", this.getNextHighestDepth());
t._x = random(150) + 295;
t._y = random(70) + 132;
Symbol 360 MovieClip Frame 435
stop();
Symbol 370 MovieClip Frame 30
gotoAndPlay ("cycle");
Symbol 404 MovieClip Frame 52
gotoAndPlay ("cycle");
Symbol 405 MovieClip Frame 1
stop();
Symbol 410 MovieClip Frame 1
stop();
Symbol 410 MovieClip Frame 2
play();
Symbol 410 MovieClip Frame 19
gotoAndStop (1);
Symbol 418 MovieClip Frame 1
stop();
Symbol 428 MovieClip Frame 1
stop();
Symbol 433 MovieClip Frame 1
stop();
Symbol 446 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 452 MovieClip Frame 1
stop();
Symbol 455 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 458 MovieClip Frame 1
stop();
this.onRollOver = function () {
this.gotoAndStop(2);
};
this.onRollOut = function () {
this.gotoAndStop(1);
};
this.onReleaseOutside = function () {
this.gotoAndStop(1);
};
Symbol 460 MovieClip Frame 1
stop();
this.bubbleboxGameID = 883;
scoreMc = this;
sendBubbleBoxScore = function (gameID) {
userData = new LoadVars();
userData.name = _root.bubblebox_name;
userData.score = _root.score;
userData.game = bubbleboxGameID;
var _local2 = new LoadVars();
_local2.onLoad = function (success) {
if (success) {
scoreMc.gotoAndStop("success");
} else {
scoreMc.gotoAndStop("tryagain");
}
};
userData.sendAndLoad("http://www.bubblebox.com/scripts/insertscore.php", _local2, "POST");
};
this.send_btn.onRelease = function () {
if ((_root.bubblebox_name != "YOUR NAME") && (_root.bubblebox_name.length > 0)) {
sendBubbleBoxScore(this._parent.bubbleboxGameID);
this._parent.gotoAndStop("saving");
}
};
Selection.setFocus("instertname");
Symbol 460 MovieClip Frame 2
stop();
Symbol 460 MovieClip Frame 3
this.bubblebox_view_score.onRelease = function () {
getURL (("http://www.bubblebox.com/highscores/" + this._parent.bubbleboxGameID) + ".htm", "_blank");
};
Symbol 460 MovieClip Frame 4
this.try_again.onRelease = function () {
this._parent.gotoAndStop(1);
};