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__("464f1a02", this, 10301, true);
var MochiAd = {getVersion:function () {
return("1.5");
}, showPreloaderAd:function (options) {
var _local22 = {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 = MochiAd._parseOptions(options, _local22);
var _local15 = options.clip;
var _local13 = 11000;
var _local23 = options.ad_timeout;
delete options.ad_timeout;
var _local20 = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var _local3 = _local15._mochiad;
_local3.onUnload = function () {
options.ad_finished();
};
var _local9 = MochiAd._getRes(options);
var _local7 = _local9[0];
var _local5 = _local9[1];
_local3._x = _local7 * 0.5;
_local3._y = _local5 * 0.5;
var chk = _local3.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local7 * -0.5;
chk._y = _local5 * -0.5;
var _local11 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local11._x = 10;
_local11._y = _local5 - 20;
var _local14 = options.color;
delete options.color;
var _local21 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local6 = _local11.createEmptyMovieClip("_outline", 1);
_local6.beginFill(_local21);
_local6.moveTo(0, 0);
_local6.lineTo(_local7 - 20, 0);
_local6.lineTo(_local7 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
_local6.endFill();
var _local8 = _local11.createEmptyMovieClip("_inside", 2);
_local8.beginFill(_local14);
_local8.moveTo(0, 0);
_local8.lineTo(_local7 - 20, 0);
_local8.lineTo(_local7 - 20, 10);
_local8.lineTo(0, 10);
_local8.lineTo(0, 0);
_local8.endFill();
_local8._xscale = 0;
var _local12 = _local11.createEmptyMovieClip("_outline", 3);
_local12.lineStyle(0, _local24, 100);
_local12.moveTo(0, 0);
_local12.lineTo(_local7 - 20, 0);
_local12.lineTo(_local7 - 20, 10);
_local12.lineTo(0, 10);
_local12.lineTo(0, 0);
chk.ad_msec = _local13;
chk.ad_timeout = _local23;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = _local20;
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;
}
};
_local3.lc.adLoaded = function (width, height) {
};
_local3.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 _local8 = this._parent._parent;
var _local9 = this._parent._mochiad_ctr;
var _local3 = getTimer() - this.started;
var _local5 = false;
var _local4 = _local8.getBytesTotal();
var _local6 = _local8.getBytesLoaded();
var _local11 = (100 * _local6) / _local4;
var _local10 = (100 * _local3) / chk.ad_msec;
var _local12 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local11 || 0, _local10));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local12._xscale = _local2;
if (!chk.showing) {
var _local7 = _local9.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local3 > chk.ad_timeout) {
_local5 = true;
}
}
if (_local3 > chk.ad_msec) {
_local5 = true;
}
if (((_local4 > 0) && (_local6 >= _local4)) && (_local5)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}, showTimedAd:function (options) {
var _local8 = {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 = MochiAd._parseOptions(options, _local8);
var _local9 = options.clip;
var _local12 = 11000;
var _local10 = options.ad_timeout;
delete options.ad_timeout;
var _local13 = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var _local3 = _local9._mochiad;
_local3.onUnload = function () {
options.ad_finished();
};
var _local14 = MochiAd._getRes(options);
var _local7 = _local14[0];
var _local11 = _local14[1];
_local3._x = _local7 * 0.5;
_local3._y = _local11 * 0.5;
var chk = _local3.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local12;
chk.ad_timeout = _local10;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = _local13;
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;
}
};
_local3.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 _local3 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local4 = _local5.getBytesTotal();
if ((_local4 > 0) || (typeof(_local4) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local3 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local3 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}, _allowDomains:function (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);
}, _loadCommunicator:function (options) {
var _local18 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, _local18);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = MochiAd.getVersion();
var _local12 = options.clip;
var _local11 = "_mochiad_com_" + options.id;
if (!MochiAd._isNetworkAvailable()) {
return(null);
}
if (_local12[_local11]) {
return(_local12[_local11].lc);
}
var _local15 = options.com_server + options.id;
MochiAd._allowDomains(_local15);
delete options.id;
delete options.com_server;
var _local19 = options.depth;
delete options.depth;
var _local13 = _local12.createEmptyMovieClip(_local11, _local19);
var _local8 = _local13.createEmptyMovieClip("_mochiad_com", 1);
for (var _local10 in options) {
_local8[_local10] = options[_local10];
}
var _local7 = new LocalConnection();
var _local14 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local7.mc = _local13;
_local7.name = _local14;
_local7.allowDomain = function (d) {
return(true);
};
_local7.allowInsecureDomain = _local7.allowDomain;
_local7.connect(_local14);
_local13.lc = _local7;
_local8.lc = _local14;
_local7._id = 0;
_local7._queue = [];
_local7.rpcResult = function (cb) {
cb = parseInt(cb);
var _local4 = this._callbacks[cb];
if (!_local4) {
return(undefined);
}
delete this._callbacks[cb];
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);
}
};
_local7._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++;
}
};
_local7.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 _local8 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local7._callbacks = {};
_local7._callbacks[0] = [_local7, "_didConnect"];
_local8.st = getTimer();
_local8.loadMovie(_local15 + ".swf", "POST");
return(_local7);
}, fetchHighScores:function (options, callbackObj, callbackMethod) {
var _local1 = MochiAd._loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}, sendHighScore:function (options, callbackObj, callbackMethod) {
var _local1 = MochiAd._loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}, load:function (options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = MochiAd.getVersion();
var _local8 = options.clip;
if (!MochiAd._isNetworkAvailable()) {
return(null);
}
if (_local8._mochiad_loaded) {
return(null);
}
var _local14 = options.depth;
delete options.depth;
var _local6 = _local8.createEmptyMovieClip("_mochiad", _local14);
var _local10 = MochiAd._getRes(options);
options.res = (_local10[0] + "x") + _local10[1];
options.server = options.server + options.id;
delete options.id;
_local8._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
if (_local8._url.indexOf("http") != 0) {
options.no_page = true;
}
var _local11 = _local4.server;
delete _local4.server;
var _local12 = MochiAd._allowDomains(_local11);
_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 _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local12;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_local4.st = getTimer();
_local4.loadMovie(_local11 + ".swf", "POST");
return(_local6);
}, unload:function (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);
}, _isNetworkAvailable:function () {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}, _getRes:function (options) {
var _local3 = options.clip.getBounds();
var _local1 = 0;
var _local2 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local1 = parseFloat(_local4[0]);
_local2 = parseFloat(_local4[1]);
} else {
_local1 = _local3.xMax - _local3.xMin;
_local2 = _local3.yMax - _local3.yMin;
}
if ((_local1 == 0) || (_local2 == 0)) {
_local1 = Stage.width;
_local2 = Stage.height;
}
return([_local1, _local2]);
}, _parseOptions:function (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);
}, _:null};
SCREEN_CENTER_X = int(Stage.width / 2);
SCREEN_CENTER_Y = int(Stage.height / 2);
forFS = false;
forWii = false;
forKongregate = false;
if (forKongregate) {
_root.kongregateServices.connect();
_root.kongregateScores.setMode("Captain");
scoresMode = "Captain";
}
if (forFS) {
} else {
MochiAd.showPreloaderAd({id:"8f69ca004dfd068f", res:"650x550"});
}
Frame 2
function newClip(sIdent, iPosX, iPosY, iLevel, bBullet) {
if (iLevel > 0) {
lvl = iLevel;
} else {
lvl = (bBullet ? (level) : (level + 250000));
level++;
}
mc = _root.attachMovie(sIdent, sIdent + lvl, lvl, "initObj");
mc._x = iPosX;
mc._y = iPosY;
mc.mcName = sIdent + lvl;
return(mc);
}
function rightClick() {
getURL ("http://www.pitchmobile.com/home.html", "_blank");
}
level = 10;
GAME_SCALE = 100;
SCALE_PER = GAME_SCALE / 100;
SCALE_SPEED = 1;
pmMenu = new ContextMenu();
pmMenu.hideBuiltInItems();
pmMenuItem1 = new ContextMenuItem("Copyright \u00A9 2007 Pitch Mobile", rightClick);
pmMenu.customItems.push(pmMenuItem1);
_root.menu = pmMenu;
stop();
Frame 3
function gameLoop() {
var _local2 = getTimer();
if (shaking) {
_root._x = (Math.random() * shakeIntensity) - (shakeIntensity / 2);
_root._y = (Math.random() * shakeIntensity) - (shakeIntensity / 2);
if ((_local2 > timeStopShaking) && (timeStopShaking > 0)) {
_root._x = 0;
_root._y = 0;
shaking = false;
timeStopShaking = 0;
}
}
switch (gameState) {
case STATE_STOP :
if ((timeRemoveGameOver > 0) && (_local2 > timeRemoveGameOver)) {
timeRemoveGameOver = 0;
mcGameOver.removeMovieClip();
if (gameScore > 0) {
if (forKongregate) {
_root.kongregateScores.submit(gameScore);
showInstructions();
} else {
getPlayerName();
}
} else {
showInstructions();
}
}
break;
case STATE_BONUSES :
if ((timeBonuses > 0) && (_local2 > timeBonuses)) {
levelComplete.removeMovieClip();
showBonuses();
timeBonuses = 0;
}
break;
case STATE_NEWLEVEL :
if (_local2 > timeStartLevel) {
startLevel();
}
break;
case STATE_PLAY :
if ((_xmouse != oldXMouse) || (_ymouse != oldYMouse)) {
shield._rotation = getAngle(_xmouse, _ymouse) + 180;
oldXMouse = _xmouse;
oldYMouse = _ymouse;
shield.rads = reverseRadians(_xmouse, _ymouse);
}
moveTanks();
moveHealth();
moveBullets();
if ((((_local2 > timeNextTank) && (timeNextTank > 0)) && (tankCount < maxTanks)) && (tankCount < tanksLeft)) {
newTank();
timeNextTank = _local2 + tankInterval;
}
if (((_local2 > timeNextBullet) && (timeNextBullet > 0)) && (bulletCount < maxBullets)) {
timeNextBullet = ((_local2 + tankFireInterval) + (Math.random() * 1000)) - (tankCount * 100);
if (fireCountdown && (tankFireInterval > 0)) {
tankFireInterval = tankFireInterval - 100;
}
tankBullet();
}
if ((_local2 > timeNextSecond) && ((minutes > 0) || (seconds > 0))) {
seconds--;
if ((seconds % baseEnergyRegenInterval) == 0) {
regenEnergy();
}
if (seconds < 0) {
seconds = 59;
minutes--;
}
if ((minutes == 0) && (seconds < 11)) {
if (seconds > 0) {
playSound(SOUND_WARNING);
} else if (seconds == 0) {
minutes = 0;
seconds = 0;
if ((bossLevel == true) && (gameLevel < 50)) {
endLevel(true);
} else {
fireCountdown = true;
}
}
}
showTime();
}
showScore();
checkGameOver();
break;
case STATE_PAUSE :
}
}
function getClick() {
if (gameState == STATE_PLAY) {
if (hasSticky) {
stuckBullet.stuck = false;
stuckBullet.dir = shield._rotation * 0.01745329;
hasSticky = false;
}
if (hasAMShield) {
AMShieldOn = true;
shield.gotoAndStop(2);
}
}
}
function shieldOff() {
AMShieldOn = false;
shield.gotoAndStop(1);
}
function startGame(bLoad) {
tankFireInterval = TANK_FIRE_INTERVAL;
lastSpawnpoint = -1;
timeRemoveGameOver = 0;
levelDone = false;
hideInstructions();
makeInterface();
if (bLoad) {
gameLevel = saveData.gameLevel;
gameScore = saveData.gameScore;
gameMoney = saveData.gameMoney;
tankFireInterval = saveData.tankFireInterval;
gameDifficulty = saveData.gameDifficulty;
} else {
gameLevel = 0;
gameScore = 0;
gameMoney = 0;
}
showScore();
showMoney();
setupBase(bLoad);
switch (gameDifficulty) {
case DIFFICULTY_EASY :
tankHPMultiplier = 1.18;
tankSpeedMultiplier = 0.04;
baseEnergyRegenInterval = 1;
levelsPerBonusPoint = 1;
moneyScale = 1.5;
infuserScale = 1.8;
damageReduction = 1;
fireIntervalBase = 2000;
fireIntervalMultiplier = 0.012;
baseTankInterval = 5000;
if (forKongregate) {
_root.kongregateScores.setMode("Sergeant");
scoresMode = "Sergeant";
}
break;
case DIFFICULTY_NORMAL :
tankHPMultiplier = 1.21;
tankSpeedMultiplier = 0.05;
baseEnergyRegenInterval = 5;
levelsPerBonusPoint = 4;
moneyScale = 1.25;
infuserScale = 2;
damageReduction = 0.8;
fireIntervalBase = 1666;
fireIntervalMultiplier = 0.012;
baseTankInterval = 3750;
if (forKongregate) {
_root.kongregateScores.setMode("Captain");
scoresMode = "Captain";
}
break;
case DIFFICULTY_HARD :
tankHPMultiplier = 1.23;
tankSpeedMultiplier = 0.06;
baseEnergyRegenInterval = 6;
levelsPerBonusPoint = 5;
moneyScale = 1;
infuserScale = 2;
damageReduction = 0.6;
fireIntervalBase = 1333;
fireIntervalMultiplier = 0.012;
baseTankInterval = 2500;
if (!forKongregate) {
break;
}
_root.kongregateScores.setMode("General");
scoresMode = "General";
}
if (bLoad) {
levelDone = true;
iface.txtLevel = (gameLevel + "/") + MAX_LEVELS;
showBonuses();
} else {
nextLevel();
}
}
function nextLevel() {
gameLevel++;
iface.txtLevel = (gameLevel + "/") + MAX_LEVELS;
addMoney(int(gameMoney * (baseInterest / 100)));
addScore(gameMoney / (10 * Math.pow(1.15, gameLevel)));
showScore();
setLevel();
clearTanks();
playMusic(MUSIC_LEVEL);
hideBonuses();
showNewLevel();
setTime(timeLimit);
baseEnergy.HP = baseEnergy.maxHP;
updateBase();
timeStartLevel = getTimer() + 3000;
gameState = STATE_NEWLEVEL;
}
function startLevel() {
hideNewLevel();
fireCountdown = false;
gameState = STATE_PLAY;
timeNextTank = getTimer() + 50;
timeNextBullet = getTimer() + 2000;
}
function endLevel(outOfTime) {
clearBullets();
playMusic(MUSIC_BONUS);
addScore((((minutes * 60) + seconds) * 3) * Math.pow(1.12, gameLevel - 1));
if (gameLevel == 50) {
gameState = STATE_STOP;
mcGameOver = newClip("Congratulations", CENTER_X, CENTER_Y);
timeRemoveGameOver = getTimer() + 10000;
if (forKongregate) {
switch (gameDifficulty) {
case DIFFICULTY_EASY :
_root.kongregateStats.submit("SergeantComplete", true);
break;
case DIFFICULTY_NORMAL :
_root.kongregateStats.submit("CaptainComplete", true);
break;
case DIFFICULTY_HARD :
_root.kongregateStats.submit("GeneralComplete", true);
}
}
} else {
if (bossLevel) {
if (outOfTime) {
levelComplete = newClip("OutOfTime", CENTER_X, CENTER_Y);
} else {
levelComplete = newClip("LevelComplete", CENTER_X, CENTER_Y);
bonusPoints = bonusPoints + (1 + gameDifficulty);
}
} else {
levelComplete = newClip("LevelComplete", CENTER_X, CENTER_Y);
}
levelDone = true;
gameState = STATE_BONUSES;
if ((gameLevel % levelsPerBonusPoint) == 0) {
bonusPoints++;
}
timeBonuses = getTimer() + 3000;
}
}
function endGame() {
gameState = STATE_STOP;
mcGameOver = newClip("GameOver", CENTER_X, CENTER_Y);
if (forKongregate && (gameScore > 0)) {
timeRemoveGameOver = getTimer() + 10000;
mcGameOver.subMsg.visible = true;
} else {
timeRemoveGameOver = getTimer() + 5000;
mcGameOver.subMsg.visible = false;
}
}
function makeInterface() {
iface = newClip(BUILD_INTERFACE, 0, 0, INTERFACE_LEVEL);
iface.score = 0;
setTime(0);
if (!soundOn) {
iface.soundButtonClip.gotoAndStop(2);
}
if (!musicOn) {
iface.musicButtonClip.gotoAndStop(2);
}
}
function removeInterface() {
iface.removeMovieClip();
}
function setTime(iSeconds) {
minutes = int(iSeconds / 60);
seconds = iSeconds % 60;
showTime();
}
function showTime() {
timeText = ((minutes > 9) ? (minutes) : ("0" + minutes));
timeText = timeText + ":";
timeText = timeText + ((seconds > 9) ? (seconds) : ("0" + seconds));
iface.gameTime = timeText;
timeNextSecond = getTimer() + 1000;
}
function togglePauseState() {
if (gamePaused) {
unpauseGame();
} else if (gameState == STATE_PLAY) {
pauseGame();
}
}
function pauseGame() {
gameState = STATE_PAUSE;
gamePaused = true;
iface.pauseClip.gotoAndStop(2);
pauseClip = newClip("PauseMenu", CENTER_X, CENTER_Y);
}
function unpauseGame() {
gameState = STATE_PLAY;
gamePaused = false;
buttonPaused = false;
iface.pauseClip.gotoAndStop(1);
pauseClip.removeMovieClip();
}
function confirmNewGame() {
pauseGame();
mcConfirm = newClip("NewGameConfirm", CENTER_X, CENTER_Y);
}
function showNewLevel() {
var _local1 = "Level " + gameLevel;
mcLevelText = newClip("LevelText", CENTER_X, CENTER_Y - OFFSET_NEW_LEVEL);
mcLevelText.txtLevel.text = _local1;
mcMessage = newClip("LevelMessage", CENTER_X, CENTER_Y);
mcMessage.gotoAndStop(levelMsg);
}
function hideNewLevel() {
mcLevelText.removeMovieClip();
mcMessage.removeMovieClip();
}
function showScore() {
iface.txtScore.text = gameScore;
}
function showInstructions() {
clearTanks();
clearBullets();
removeBase();
removeInterface();
loadData();
instructions = newClip("Instructions", SCREEN_CENTER_X, SCREEN_CENTER_Y, INSTRUCTIONS_LEVEL);
playMusic(MUSIC_MENU);
}
function hideInstructions() {
instructions.removeMovieClip();
}
function hideBonuses() {
bonuses.removeMovieClip();
}
function showBonuses() {
bonuses = newClip("Bonuses", CENTER_X, CENTER_Y, INSTRUCTIONS_LEVEL);
showScore();
updateUpgrades();
}
function addScore(iScoreBonus) {
var _local1 = scaleScore(iScoreBonus);
levelScore = levelScore + int(_local1);
gameScore = gameScore + int(_local1);
}
function getDifficulty() {
instructions = newClip("Instructions", SCREEN_CENTER_X, SCREEN_CENTER_Y, INSTRUCTIONS_LEVEL);
instructions.gotoAndStop("difficulty");
}
function scaleScore(iScore) {
var _local1;
switch (gameDifficulty) {
case DIFFICULTY_EASY :
_local1 = int(iScore * 0.75);
break;
case DIFFICULTY_NORMAL :
_local1 = iScore;
break;
case DIFFICULTY_HARD :
_local1 = int(iScore * 1.25);
}
return(_local1);
}
function scaleMoney(iMoney) {
var _local1;
switch (gameDifficulty) {
case DIFFICULTY_EASY :
_local1 = int(iMoney * 1.5);
break;
case DIFFICULTY_NORMAL :
_local1 = int(iMoney * 1.25);
break;
case DIFFICULTY_HARD :
_local1 = iMoney;
}
return(_local1);
}
function toggleSound() {
if (soundOn) {
iface.soundButtonClip.gotoAndStop(2);
soundOn = false;
stopMusic();
stopAllSounds();
} else {
iface.soundButtonClip.gotoAndStop(1);
soundOn = true;
playMusic(currentMusic);
}
}
function toggleMusic() {
if (musicOn) {
iface.musicButtonClip.gotoAndStop(2);
musicOn = false;
stopMusic();
} else {
iface.musicButtonClip.gotoAndStop(1);
musicOn = true;
playMusic(currentMusic);
}
}
function toggleQuality() {
if (highQuality) {
highQuality = false;
_root._quality = "LOW";
} else {
highQuality = true;
_root._quality = "HIGH";
}
}
function playSound(iSound) {
if (soundOn) {
sounds[iSound].start();
}
}
function playMusic(sMusic) {
stopMusic();
currentMusic = sMusic;
if (soundOn && (musicOn)) {
musicObj.gotoAndPlay(sMusic);
}
}
function stopMusic() {
musicObj.gotoAndStop("Stop" + currentMusic);
}
function getAngle(xPos, yPos) {
var _local1 = (360 * Math.atan2(CENTER_Y - yPos, CENTER_X - xPos)) / 6.283185;
while (_local1 < 0) {
_local1 = 360 + _local1;
}
return(_local1);
}
function getRadians(xPos, yPos) {
return(Math.atan2(CENTER_Y - yPos, CENTER_X - xPos));
}
function reverseRadians(xPos, yPos) {
return(Math.atan2(yPos - CENTER_Y, xPos - CENTER_X));
}
function addMoney(iMoney) {
gameMoney = gameMoney + int(iMoney);
showMoney();
}
function showMoney() {
iface.sMoney = "$" + gameMoney;
}
function shake(iIntensity, iTime) {
shaking = true;
shakeIntensity = ((iIntensity > 20) ? 20 : (iIntensity));
timeStopShaking = getTimer() + iTime;
}
function getDistance(oObj1, oObj2) {
var _local1 = oObj1._x - oObj2._x;
var _local2 = oObj1._y - oObj2._y;
var _local3 = Math.sqrt((_local1 * _local1) + (_local2 * _local2));
return(_local3);
}
function getObjAngles(oObj1, oObj2) {
var _local2 = oObj1._x - oObj2._x;
var _local3 = oObj1._y - oObj2._y;
var _local1 = (360 * Math.atan2(_local3, _local2)) / 6.283185;
if (_local1 < 0) {
_local1 = 360 + _local1;
}
return(_local1);
}
function turnClockwise(oldDir, newDir) {
var _local1 = false;
var _local3 = ((oldDir > newDir) ? (oldDir - 180) : (oldDir + 180));
if (_local3 > newDir) {
_local1 = true;
}
return(_local1);
}
function degToRad(iDeg) {
return(iDeg * 0.01745329);
}
function radToDeg(iRad) {
return(iRad * 57.29578);
}
function angleDiff(a1, a2) {
var _local1 = Math.abs(a1 - a2);
if (_local1 > 180) {
_local1 = 360 - _local1;
}
return(_local1);
}
function getScores() {
_root.kongregateScores.requestList(scoresCallback, this);
}
function setLevel() {
T_R = TANK_REGULAR;
T_D = TANK_DISRUPTOR;
T_M = TANK_MISSILE;
T_F = TANK_FIRE;
T_I = TANK_INFERNO;
T_B = TANK_BRUISER;
T_B1 = TANK_BOSS1;
switch (gameDifficulty) {
case DIFFICULTY_EASY :
timeLimit = 210;
break;
case DIFFICULTY_NORMAL :
timeLimit = 180;
break;
case DIFFICULTY_HARD :
timeLimit = 150;
}
tankFireInterval = fireIntervalBase * (1 - (fireIntervalMultiplier * gameLevel));
tankInterval = baseTankInterval - (50 * gameLevel);
tanksLeft = 12;
var _local6 = true;
bossLevel = false;
updateTanks();
switch (gameLevel) {
case 1 :
case 2 :
tankDistribution = [T_R, T_R, T_R, T_R, T_R, T_R, T_R, T_R, T_R, T_R, T_R, T_R];
break;
case 3 :
case 4 :
tankDistribution = [T_R, T_R, T_R, T_R, T_R, T_R, T_R, T_R, T_D, T_D, T_D, T_D];
break;
case 5 :
case 6 :
tankDistribution = [T_R, T_R, T_R, T_R, T_R, T_R, T_R, T_D, T_D, T_D, T_M, T_M];
break;
case 7 :
case 8 :
case 9 :
tankDistribution = [T_R, T_R, T_R, T_R, T_R, T_D, T_D, T_D, T_M, T_M, T_F, T_F];
break;
case 10 :
bossLevel = true;
tankDistribution = [T_B1, T_R, T_R, T_R, T_R, T_D, T_D, T_D, T_M, T_M, T_F, T_F];
break;
case 11 :
case 12 :
case 13 :
case 14 :
case 15 :
case 16 :
case 17 :
case 18 :
case 19 :
tankDistribution = [T_R, T_R, T_R, T_R, T_D, T_D, T_D, T_M, T_M, T_F, T_F, T_F];
break;
case 20 :
bossLevel = true;
tankDistribution = [T_B1, T_R, T_R, T_R, T_D, T_D, T_D, T_M, T_M, T_F, T_F, T_F];
break;
case 21 :
case 22 :
case 23 :
case 24 :
case 25 :
case 26 :
case 27 :
case 28 :
case 29 :
tankDistribution = [T_R, T_R, T_R, T_D, T_D, T_M, T_M, T_M, T_F, T_F, T_F, T_B];
break;
case 30 :
bossLevel = true;
tankDistribution = [T_B1, T_R, T_R, T_D, T_D, T_M, T_M, T_M, T_F, T_F, T_F, T_B];
break;
case 31 :
case 32 :
case 33 :
case 34 :
case 35 :
case 36 :
case 37 :
case 38 :
case 39 :
tankDistribution = [T_R, T_R, T_R, T_D, T_M, T_M, T_M, T_F, T_F, T_B, T_B, T_I];
break;
case 40 :
bossLevel = true;
tankDistribution = [T_B1, T_R, T_R, T_D, T_M, T_M, T_M, T_F, T_F, T_B, T_B, T_I];
break;
case 41 :
case 42 :
case 43 :
case 44 :
case 45 :
tankDistribution = [T_R, T_D, T_D, T_M, T_M, T_M, T_F, T_F, T_B, T_B, T_I, T_I];
break;
case 46 :
case 47 :
case 48 :
case 49 :
tankDistribution = [T_R, T_D, T_F, T_M, T_M, T_M, T_B, T_B, T_B, T_I, T_I, T_I];
break;
case 50 :
bossLevel = true;
tankDistribution = [T_D, T_F, T_B1, T_M, T_M, T_M, T_B, T_B, T_B, T_I, T_I, T_I];
}
if (_local6) {
var _local1;
var _local5;
var _local4;
var _local3;
var _local2 = tankDistribution.length;
tankPattern = [];
_local1 = 0;
while (_local1 < _local2) {
tankPattern.push(tankDistribution[_local1]);
_local1++;
}
_local1 = 0;
while (_local1 < 100) {
_local4 = int(Math.random() * _local2);
_local3 = int(Math.random() * _local2);
_local5 = tankPattern[_local4];
tankPattern[_local4] = tankPattern[_local3];
tankPattern[_local3] = _local5;
_local1++;
}
}
currentTank = 0;
patLen = tankPattern.length;
}
function getNextTank() {
var _local1 = tankPattern[currentTank];
currentTank++;
if (currentTank == patLen) {
currentTank = 0;
}
return(_local1);
}
function addPowerup(iX, iY, iType, iValue) {
var _local1 = newClip("Powerup", iX, iY);
if (iType > 0) {
_local1.powerupType = iType;
_local1.powerupValue = iValue;
} else {
_local1.powerupType = int(Math.random() * maxPowerups);
}
powerups.push(_local1);
}
function checkPowerups() {
var _local3 = powerups.length - 1;
var _local1;
var _local2;
_local1 = _local3;
while (_local1 >= 0) {
_local2 = powerups[_local1];
if (_local2.hitTest(playerObj)) {
processPowerup(_local2);
removePowerup(_local1);
}
_local1--;
}
}
function removePowerup(iIndex) {
powerups[iIndex].removeMovieClip();
powerups.splice(iIndex, 1);
}
function destroyPowerups() {
var _local2 = powerups.length - 1;
var _local1;
_local1 = _local2;
while (_local1 >= 0) {
removePowerup(_local1);
_local1--;
}
}
function processPowerup(iObj) {
var _local1 = iObj.powerupType;
switch (_local1) {
case POWERUP_GENERIC :
break;
default :
}
}
function getPlayerName() {
highScoreEntry = newClip("HighScoreEntry", CENTER_X, CENTER_Y, INSTRUCTIONS_LEVEL);
}
function setHighScore(sName) {
if (sName != "") {
var _local1 = new LoadVars();
_local1.phpHurfblurf = SHA1((sName + gameScore) + "sd14frd");
_local1.phpScore = gameScore;
_local1.phpMoney = gameMoney;
_local1.phpName = sName;
_local1.phpLevel = gameLevel;
_local1.phpDifficulty = gameDifficulty;
_local1.stoppem = "frumfroppen";
_local1.send("http://www.pitchmobile.com/shieldsubmit.php", "_blank", "POST");
if (forFS) {
var _local2 = SharedObject.getLocal("ShieldDefense", "/");
} else {
var _local2 = SharedObject.getLocal("ShieldDefense");
}
_local2.clear();
}
}
function tankBullet() {
var _local2;
var _local10 = tanks.length;
var _local5;
var _local9 = false;
_local5 = 0;
while (_local5 < _local10) {
if ((tanks[_local5].firing && (tanks[_local5].alive)) && (!tanks[_local5].EMPed)) {
_local9 = true;
}
_local5++;
}
if (_local9) {
var _local4 = -1;
while (_local4 == -1) {
if (nextTankFire.alive && (!nextTankFire.EMPed)) {
_local2 = nextTankFire;
_local4 = 0;
} else {
_local4 = int(Math.random() * tanks.length);
if ((tanks[_local4].alive && (tanks[_local4].firing)) && (!tanks[_local4].EMPed)) {
_local2 = tanks[_local4];
}
}
if (_local2.alive) {
var _local3;
var _local7 = -1;
var _local6;
if ((_local2.tankType == TANK_BRUISER) || (_local2.tankType == TANK_INFERNO)) {
_local2.nextBarrel++;
_local3 = _local2.tank.turret["shotpoint" + _local2.nextBarrel].getBounds(_root);
_local2.tank.turret["barrel" + _local2.nextBarrel].play();
if (_local2.nextBarrel == 3) {
_local2.nextBarrel = 0;
nextTankFire = null;
} else {
nextTankFire = _local2;
timeNextBullet = getTimer() + 250;
}
} else if (_local2.turrets > 0) {
_local7 = int(Math.random() * _local2.turrets) + 1;
_local3 = _local2.tank["turret" + _local7].shotpoint.getBounds(_root);
} else {
_local3 = _local2.tank.turret.shotpoint.getBounds(_root);
}
if (_local7 > 0) {
_local6 = newBullet(_local3.xMin, _local3.yMin, tankTypes[_local2.tankType].turrets[_local7 - 1]);
} else {
_local6 = newBullet(_local3.xMin, _local3.yMin, _local2.bulletType);
}
if (_local2.tankType == TANK_FIRE) {
_local2.tank.turret.blast.play();
} else if (_local2.tankType == TANK_INFERNO) {
} else if ((_local2.tankType == TANK_DISRUPTOR) || (_local2.tankType == TANK_BRUISER)) {
var _local8 = newClip("disruptorblast", _local3.xMin, _local3.yMin);
_local8._rotation = getAngle(_local3.xMin, _local3.yMin);
} else {
var _local8 = newClip("blast", _local3.xMin, _local3.yMin);
_local8._rotation = getAngle(_local3.xMin, _local3.yMin);
}
_local6.reflected = false;
_local6.bulletAng = getAngle(_local3.xMin, _local3.yMin);
_local6._rotation = _local6.bulletAng;
}
_local4 = -1;
}
}
}
function newBullet(xPos, yPos, iType) {
var _local1 = newClip("Bullet", xPos, yPos);
_local1.dir = getRadians(xPos, yPos);
_local1.speed = bulletTypes[iType].speed;
_local1.damage = bulletTypes[iType].strength * (1 + (0.1 * (gameLevel - 1)));
_local1.alive = true;
_local1.bulletType = iType;
bullets.push(_local1);
bulletCount++;
_local1.bullet.gotoAndStop(iType + 1);
var _local3 = int(Math.random() * bulletTypes[iType].sounds.length);
playSound(bulletTypes[iType].sounds[_local3]);
return(_local1);
}
function removeBullet(ident) {
var _local2 = bullets.length;
var _local1;
_local1 = 0;
while (_local1 < _local2) {
if (bullets[_local1].mcName == ident) {
bullets[_local1].removeMovieClip();
bullets.splice(_local1, 1);
bulletCount--;
}
_local1++;
}
}
function destroyBullet(oBullet) {
oBullet.play();
oBullet.alive = false;
}
function clearBullets() {
var _local2 = bullets.length - 1;
var _local1;
_local1 = _local2;
while (_local1 >= 0) {
removeBullet(bullets[_local1].mcName);
_local1--;
}
hasSticky = false;
}
function moveBullets() {
var _local8 = bullets.length - 1;
var _local5;
var _local2;
var _local3;
var _local4;
var _local1;
_local5 = _local8;
while (_local5 >= 0) {
_local1 = bullets[_local5];
if (_local1.alive) {
if (_local1.stuck) {
stuckPoint.x = shield.stuckPoint._x;
stuckPoint.y = shield.stuckPoint._y;
shield.localToGlobal(stuckPoint);
_local1._x = stuckPoint.x;
_local1._y = stuckPoint.y;
_local1._rotation = shield._rotation;
bulletAng = _local1._rotation;
while (bulletAng < 0) {
bulletAng = 360 + bulletAng;
}
_local1.bulletAng = bulletAng;
} else {
if (_local1.heatseeker) {
if (!_local1.targetTank.alive) {
_local1.targetTank = closestTank(_local1);
}
if (_local1.targetTank.alive) {
var _local7 = getObjAngles(_local1.targetTank, _local1);
if (turnClockwise(_local1.bulletAng, _local7)) {
_local1.bulletAng = _local1.bulletAng + (1 + (0.5 * bounceLevel));
_local1.bulletAng = _local1.bulletAng % 360;
_local1._rotation = _local1.bulletAng;
} else {
_local1.bulletAng = _local1.bulletAng - (1 + (0.5 * bounceLevel));
_local1.bulletAng = ((_local1.bulletAng < 0) ? (359 + (0.5 * bounceLevel)) : (_local1.bulletAng));
_local1._rotation = _local1.bulletAng;
}
_local1.dir = degToRad(_local1._rotation);
}
}
_local1._x = _local1._x + (Math.cos(_local1.dir) * _local1.speed);
_local1._y = _local1._y + (Math.sin(_local1.dir) * _local1.speed);
if ((((_local1._x < (START_X - _local1._width)) || (_local1._x > (END_X + _local1._width))) || (_local1._y < (START_Y - _local1._width))) || (_local1._y > (END_Y + _local1._width))) {
removeBullet(_local1.mcName);
}
}
}
if (((!_local1.bounce) && (_local1.alive)) && (shield.hitTest(_local1._x, _local1._y, true))) {
if (hasAMShield && (AMShieldOn)) {
destroyBullet(_local1);
} else {
_local1.speed = _local1.speed * (1 + (0.25 * bounceLevel));
_local1.damage = _local1.damage * Math.pow(infuserScale, infuserLevel);
if ((_local1.bulletType == BULLET_MISSILE) && (hasHeatseeker)) {
_local1.heatseeker = true;
}
if (hasStickyUpgrade && (!hasSticky)) {
_local1.stuck = true;
hasSticky = true;
stuckBullet = _local1;
_local1.bounce = true;
stuckPoint.x = shield.stuckPoint._x;
stuckPoint.y = shield.stuckPoint._y;
shield.localToGlobal(stuckPoint);
_local1._x = stuckPoint.x;
_local1._y = stuckPoint.y;
_local1._rotation = shield._rotation;
} else {
bulletAng = shield._rotation + (shield._rotation - (_local1._rotation + 180));
while (bulletAng < 0) {
bulletAng = 360 + bulletAng;
}
_local1.dir = bulletAng * 0.01745329;
_local1._rotation = bulletAng;
_local1.bulletAng = bulletAng;
_local1.bounce = true;
}
}
}
if ((_local1.alive && (base.hitTest(_local1._x, _local1._y, true))) && (!_local1.bounce)) {
damageBase(_local1.damage, _local1.bulletType);
destroyBullet(_local1);
}
if (_local1.bounce && (_local1.alive)) {
var _local6 = false;
_local4 = tanks.length - 1;
_local2 = _local4;
while (_local2 >= 0) {
if (tanks[_local2].alive && (inDeadzone(tanks[_local2], _local1))) {
if ((_local1.bulletType == BULLET_DISRUPTOR) && (hasEMP)) {
tanks[_local2].EMPed = true;
tanks[_local2].EMPTime = getTimer() + 3000;
tanks[_local2].emp.gotoAndStop(2);
}
if ((_local1.bulletType == BULLET_FIREBALL) && (hasInferno)) {
tanks[_local2].onFire = true;
tanks[_local2].framesLeft = 90;
if (tanks[_local2].bulletType == BULLET_FIREBALL) {
tanks[_local2].fireDmg = (_local1.damage / 180) * (1 - (tanks[_local2].reduction * gameDifficulty));
} else {
tanks[_local2].fireDmg = _local1.damage / 180;
}
tanks[_local2].inferno.gotoAndStop(2);
}
if (hasExploder) {
_local6 = true;
} else {
if ((tanks[_local2].immunity > -1) && (_local1.bulletType == tanks[_local2].immunity)) {
damageTank(tanks[_local2], _local1.damage * (1 - (tanks[_local2].reduction * gameDifficulty)));
} else {
damageTank(tanks[_local2], _local1.damage);
}
destroyBullet(_local1);
}
}
_local2--;
}
if (_local6) {
_local3 = _local4;
while (_local3 >= 0) {
if ((getDistance(_local1, tanks[_local3]) <= 75) && (tanks[_local3].alive)) {
if ((tanks[_local3].immunity > -1) && (_local1.bulletType == tanks[_local3].immunity)) {
damageTank(tanks[_local3], _local1.damage * (1 - (tanks[_local3].reduction * gameDifficulty)));
} else {
damageTank(tanks[_local3], _local1.damage);
}
}
_local3--;
}
destroyBullet(_local1);
}
}
_local5--;
}
}
function getTankPoint() {
var _local2 = -1;
var _local1;
var _local3 = tanks.length;
var _local4 = 0;
do {
if (_local2 != -1) {
break;
}
_local2 = int(Math.random() * 8);
if (_local2 == lastSpawnpoint) {
_local2 = -1;
}
startPoint._x = startPos[_local2][0];
startPoint._y = startPos[_local2][1];
_local1 = 0;
while (_local1 < _local3) {
if (getDistance(tanks[_local1], startPoint) < 150) {
_local2 = -1;
}
_local1++;
}
_local4++;
} while (_local4 <= 100);
return(_local2);
}
function newTank() {
var _local3 = getTankPoint();
if (_local3 > -1) {
lastSpawnpoint = _local3;
var _local1 = newClip("Tank", startPos[_local3][0], startPos[_local3][1]);
var _local2 = getNextTank();
_local1.tankType = _local2;
_local1.speed = tankTypes[_local2].speed * (1 + (tankSpeedMultiplier * (gameLevel - 1)));
_local1.dx = startSpeed[_local3][0] * _local1.speed;
_local1.dy = startSpeed[_local3][1] * _local1.speed;
_local1.dir = _local1._rotation;
_local1.newDir = _local1._rotation;
_local1.alive = true;
_local1.activated = false;
_local1.firing = false;
_local1.nextBarrel = 0;
_local1.EMPed = false;
_local1.framesDeactivated = 0;
_local1.immunity = tankTypes[_local2].immunity;
_local1.reduction = tankTypes[_local2].reduction;
_local1.turrets = tankTypes[_local2].turrets.length;
_local1.money = int((tankTypes[_local2].money * Math.pow(1.1, gameLevel - 1)) * moneyScale);
_local1.maxHP = int(tankTypes[_local2].hp * Math.pow(tankHPMultiplier + (0.001 * (50 - gameLevel)), gameLevel - 1));
_local1.score = int(tankTypes[_local2].score * Math.pow(1.1, gameLevel - 1));
_local1.HP = _local1.maxHP;
_local1.bulletType = tankTypes[_local2].bullet;
_local1.pushback = tankTypes[_local2].pushback;
_local1.rotateSpeed = tankTypes[_local2].rotateSpeed;
_local1.tank.gotoAndStop(_local2 + 1);
if (tankTypes[_local2].deadzoneFactor > 0) {
_local1.deadzone = _local1._width / tankTypes[_local2].deadzoneFactor;
} else {
_local1.deadzone = _local1._width / 1.6;
}
addHealth(_local1, TANK_HEALTHBAR_OFFSET_X, tankTypes[_local2].offset);
orientTank(_local1, true);
tanks.push(_local1);
tankCount++;
}
}
function moveTanks() {
var _local5 = 0;
var _local3 = 0;
var _local7 = tanks.length;
_local5 = 0;
while (_local5 < _local7) {
var _local2 = tanks[_local5];
if (_local2.EMPed) {
if (getTimer() > _local2.EMPTime) {
_local2.EMPed = false;
_local2.emp.gotoAndStop(1);
}
}
if (_local2.alive && (_local2.onFire)) {
damageTank(_local2, _local2.fireDmg, true);
_local2.framesLeft--;
if (_local2.framesLeft <= 0) {
_local2.onFire = false;
_local2.fireDmg = 0;
_local2.inferno.gotoAndStop(1);
}
}
if (_local2.alive && (!_local2.EMPed)) {
if (_local2.turning) {
if (_local2.clockwise) {
_local2._rotation = _local2._rotation + _local2.rotateSpeed;
_local2.inferno._rotation = _local2.inferno._rotation - _local2.rotateSpeed;
_local2.dir = _local2.dir + _local2.rotateSpeed;
if (_local2.dir >= 360) {
_local2.dir = _local2.dir - 360;
}
} else {
_local2._rotation = _local2._rotation - _local2.rotateSpeed;
_local2.inferno._rotation = _local2.inferno._rotation + _local2.rotateSpeed;
_local2.dir = _local2.dir - _local2.rotateSpeed;
if (_local2.dir < 0) {
_local2.dir = 360 + _local2.dir;
}
}
if (Math.abs(_local2.dir - _local2.newDir) <= _local2.rotateSpeed) {
_local2.turning = false;
_local2.dir = _local2.newDir;
_local2._rotation = _local2.dir;
}
} else {
if (!_local2.changeStopped) {
_local2._x = _local2._x + _local2.dx;
_local2._y = _local2._y + _local2.dy;
}
if ((_local2.nextChangeTime > 0) && (getTimer() > _local2.nextChangeTime)) {
if (_local2.changeStopped) {
_local2.changeStopped = false;
if ((Math.random() * 2) > 1) {
_local2.dx = _local2.dx * -1;
_local2.dy = _local2.dy * -1;
orientTank(_local2);
}
} else if ((Math.random() * 2) > 1) {
_local2.dx = _local2.dx * -1;
_local2.dy = _local2.dy * -1;
orientTank(_local2);
} else {
_local2.changeStopped = true;
}
_local2.nextChangeTime = (getTimer() + (Math.random() * 12000)) + 3000;
}
if (_local2.activated) {
if (((_local2._x < (START_X + TANK_BUFFER)) && (_local2.dx < 0)) || ((_local2._x > (END_X - TANK_BUFFER)) && (_local2.dx > 0))) {
_local2._x = _local2._x - _local2.dx;
_local2.dx = 0;
_local2.dy = _local2.speed * ((_local2._y < SCREEN_CENTER_Y) ? 1 : -1);
orientTank(_local2);
} else if (((_local2._y < (START_Y + TANK_BUFFER)) && (_local2.dy < 0)) || ((_local2._y > (END_Y - TANK_BUFFER)) && (_local2.dy > 0))) {
_local2._y = _local2._y - _local2.dy;
_local2.dy = 0;
_local2.dx = _local2.speed * ((_local2._x < SCREEN_CENTER_X) ? 1 : -1);
orientTank(_local2);
}
}
_local3 = 0;
while (_local3 < _local7) {
if (((_local3 != _local5) && (getDistance(_local2, tanks[_local3]) < (_local2.deadzone + tanks[_local3].deadzone))) && (tanks[_local3].alive)) {
if (_local2.activated && (tanks[_local3].activated)) {
_local2._x = _local2._x - (_local2.dx * _local2.pushback);
_local2._y = _local2._y - (_local2.dy * _local2.pushback);
_local2.dx = _local2.dx * -1;
_local2.dy = _local2.dy * -1;
orientTank(_local2);
} else if ((!_local2.activated) && (tanks[_local3].activated)) {
_local2._x = _local2._x - (_local2.dx * _local2.pushback);
_local2._y = _local2._y - (_local2.dy * _local2.pushback);
} else if ((!_local2.activated) && (!tanks[_local3].activated)) {
_local2._x = _local2._x - (_local2.dx * _local2.pushback);
_local2._y = _local2._y - (_local2.dy * _local2.pushback);
}
}
_local3++;
}
if (((((!_local2.firing) && (_local2._x >= START_X)) && (_local2._x <= END_X)) && (_local2._y >= START_Y)) && (_local2._y <= END_Y)) {
_local2.firing = true;
}
if (!_local2.activated) {
if ((((_local2._x >= (START_X + TANK_BUFFER)) && (_local2._x <= (END_X - TANK_BUFFER))) && (_local2._y >= (START_Y + TANK_BUFFER))) && (_local2._y <= (END_Y - TANK_BUFFER))) {
_local2.activated = true;
if (_local2.tankType == TANK_BOSS1) {
_local2.nextChangeTime = (getTimer() + (Math.random() * 12000)) + 3000;
}
} else {
_local2.framesDeactivated++;
if (_local2.framesDeactivated > 300) {
var _local6 = getTankPoint();
if (_local6 > -1) {
newClip("tankTeleport", _local2._x, _local2._y);
_local2._x = startPos[_local6][0];
_local2._y = startPos[_local6][1];
_local2.dx = startSpeed[_local6][0] * _local2.speed;
_local2.dy = startSpeed[_local6][1] * _local2.speed;
orientTank(_local2, true);
_local2.framesDeactivated = 0;
}
}
}
}
}
if (_local2.turrets > 0) {
var _local4;
_local4 = 0;
while (_local4 < _local2.turrets) {
_local2.tank["turret" + (_local4 + 1)]._rotation = _root.getAngle(_local2._x, _local2._y) - _local2.dir;
_local4++;
}
} else {
_local2.tank.turret._rotation = _root.getAngle(_local2._x, _local2._y) - _local2.dir;
}
}
_local5++;
}
}
function removeTank(ident) {
var _local2 = tanks.length;
var _local1;
_local1 = 0;
while (_local1 < _local2) {
if (tanks[_local1].mcName == ident) {
removeHealth(tanks[_local1]);
tanks[_local1].removeMovieClip();
tanks.splice(_local1, 1);
tankCount--;
}
_local1++;
}
}
function destroyTank(oTank) {
shake(2, 250);
removeHealth(oTank);
oTank.play();
oTank.alive = false;
addScore(oTank.score);
addMoney(oTank.money);
tanksLeft--;
updateTanks();
}
function clearTanks() {
var _local1 = 0;
var _local2 = tanks.length - 1;
_local1 = _local2;
while (_local1 >= 0) {
removeTank(tanks[_local1].mcName);
_local1--;
}
}
function orientTank(oTank, bInstant) {
var _local3 = oTank.dx;
var _local4 = oTank.dy;
var _local2 = 0;
if (_local3 == 0) {
if (_local4 > 0) {
_local2 = 90;
} else {
_local2 = 270;
}
} else if (_local3 > 0) {
_local2 = 0;
} else {
_local2 = 180;
}
if (oTank.dir != _local2) {
oTank.newDir = _local2;
oTank.clockwise = turnClockwise(oTank.dir, oTank.newDir);
if (bInstant) {
oTank.turning = false;
oTank.dir = oTank.newDir;
oTank._rotation = oTank.dir;
oTank.inferno._rotation = 360 - _local2;
} else {
oTank.turning = true;
}
}
}
function damageTank(oTank, iDamage, bMute) {
oTank.HP = oTank.HP - iDamage;
if (oTank.HP <= 0) {
var _local2 = int(Math.random() * tankTypes[oTank.tankType].explosionSounds.length);
playSound(tankTypes[oTank.tankType].explosionSounds[_local2]);
destroyTank(oTank);
} else {
var _local2 = int(Math.random() * tankTypes[oTank.tankType].impactSounds.length);
if (bMute) {
} else {
playSound(tankTypes[oTank.tankType].impactSounds[_local2]);
}
updateHealth(oTank);
}
}
function inDeadzone(oTank, oObj) {
var _local1 = oTank._x - oObj._x;
var _local2 = oTank._y - oObj._y;
var _local4 = Math.sqrt((_local1 * _local1) + (_local2 * _local2));
return(((_local4 <= oTank.deadzone) ? true : false));
}
function updateTanks() {
iface.tanksLeft = (tanksLeft + "/") + TANKS_PER_LEVEL;
if (tanksLeft <= 0) {
endLevel();
}
}
function closestTank(oObj) {
var _local6 = -1;
var _local4 = 360;
var _local7 = tanks.length;
var _local2;
var _local1;
var _local3 = 0;
_local1 = 0;
while (_local1 < _local7) {
if (tanks[_local1].alive) {
_local3 = getObjAngles(tanks[_local1], oObj);
_local2 = angleDiff(oObj.bulletAng, _local3);
if (_local2 < _local4) {
_local4 = _local2;
_local6 = _local1;
}
}
_local1++;
}
return(tanks[_local6]);
}
function addHealth(oObj, xOffset, yOffset, iColor) {
var _local1 = newClip("HealthBar", oObj._x, oObj._y);
_local1.bar._x = _local1.bar._x + xOffset;
_local1.bar._y = _local1.bar._y + yOffset;
_local1.bar.bar.gotoAndStop(iColor + 1);
_local1.attachedObj = oObj;
_local1.attachedName = oObj.mcName;
healthbars.push(_local1);
}
function moveHealth() {
var _local2 = healthbars.length;
var _local1;
_local1 = 0;
while (_local1 < _local2) {
healthbars[_local1]._x = healthbars[_local1].attachedObj._x;
healthbars[_local1]._y = healthbars[_local1].attachedObj._y;
_local1++;
}
}
function removeHealth(oObj) {
var _local2 = healthbars.length;
var _local1;
_local1 = 0;
while (_local1 < _local2) {
if (healthbars[_local1].attachedName == oObj.mcName) {
healthbars[_local1].removeMovieClip();
healthbars.splice(_local1, 1);
}
_local1++;
}
}
function clearHealth() {
var _local2 = healthbars.length - 1;
var _local1;
_local1 = _local2;
while (_local1 >= 0) {
healthbars[_local1].removeMovieClip();
healthbars.splice(_local1, 1);
_local1--;
}
}
function updateHealth(oObj) {
var _local4 = healthbars.length;
var _local1;
_local1 = 0;
while (_local1 < _local4) {
if (healthbars[_local1].attachedName == oObj.mcName) {
var _local3 = healthbars[_local1].bar;
_local3.bar._xscale = ((oObj.HP < 0) ? 0 : ((oObj.HP / oObj.maxHP) * 100));
}
_local1++;
}
}
function setupBase(bLoad) {
shieldZone = newClip("ShieldZone", CENTER_X, CENTER_Y);
shield = newClip("Shield", CENTER_X, CENTER_Y);
base = newClip("Base", CENTER_X, CENTER_Y);
baseEnergy = new Object();
baseEnergy._x = base._x;
baseEnergy._y = base._y;
addHealth(base, 0, BASE_HEALTH_OFFSET_Y);
if (bLoad) {
baseInterest = saveData.baseInterest;
bounceLevel = saveData.bounceLevel;
infuserLevel = saveData.infuserLevel;
structureLevel = saveData.structureLevel;
staticLevel = saveData.staticLevel;
kitsAvailable = saveData.kitsAvailable;
hasStickyUpgrade = saveData.hasStickyUpgrade;
hasStaticUpgrade = saveData.hasStaticUpgrade;
if (hasStaticUpgrade) {
addHealth(baseEnergy, 0, BASE_ENERGY_OFFSET_Y, HEALTHBAR_RED);
}
base.maxHP = saveData.baseMaxHP;
base.HP = saveData.baseHP;
baseEnergy.maxHP = saveData.baseEnergyMaxHP;
baseEnergy.HP = saveData.baseEnergyHP;
bonusPoints = saveData.bonusPoints;
hasDisruptorDamp = saveData.hasDisruptorDamp;
hasMissileDamp = saveData.hasMissileDamp;
hasFireballDamp = saveData.hasFireballDamp;
hasShellDamp = saveData.hasShellDamp;
hasExploder = saveData.hasExploder;
hasHeatseeker = saveData.hasHeatseeker;
hasEMP = saveData.hasEMP;
hasAMShield = saveData.hasAMShield;
hasInferno = saveData.hasInferno;
} else {
baseInterest = BASE_INTEREST;
bounceLevel = 0;
infuserLevel = 0;
structureLevel = 0;
staticLevel = 0;
kitsAvailable = 0;
hasStickyUpgrade = false;
hasStaticUpgrade = false;
base.maxHP = BASE_MAX_HP;
base.HP = base.maxHP;
baseEnergy.maxHP = BASE_MAX_ENERGY;
baseEnergy.HP = baseEnergy.maxHP;
bonusPoints = 0;
hasDisruptorDamp = false;
hasMissileDamp = false;
hasFireballDamp = false;
hasShellDamp = false;
hasExploder = false;
hasHeatseeker = false;
hasEMP = false;
hasAMShield = false;
hasInferno = false;
}
updateBase();
}
function removeBase() {
shield.removeMovieClip();
removeHealth(base);
removeHealth(baseEnergy);
base.removeMovieClip();
shieldZone.removeMovieClip();
}
function damageBase(iDamage, iType) {
var _local1 = int(iDamage);
switch (iType) {
case BULLET_DISRUPTOR :
_local1 = _local1 * (hasDisruptorDamp ? 0.75 : 1);
break;
case BULLET_MISSILE :
_local1 = _local1 * (hasMissileDamp ? 0.75 : 1);
break;
case BULLET_FIREBALL :
_local1 = _local1 * (hasFireballDamp ? 0.75 : 1);
break;
case BULLET_SHELL :
_local1 = _local1 * (hasShellDamp ? 0.75 : 1);
}
_local1 = int(_local1);
if (hasStaticUpgrade) {
if (_local1 > baseEnergy.HP) {
_local1 = _local1 - baseEnergy.HP;
baseEnergy.HP = 0;
} else {
baseEnergy.HP = baseEnergy.HP - _local1;
var _local2 = int(Math.random() * baseImpactSounds.length);
playSound(baseImpactSounds[_local2]);
_local1 = 0;
}
}
if (_local1 > 0) {
playSound(SOUND_EXPLOSION);
shake(_local1 / 2, 500);
base.HP = base.HP - _local1;
if (base.HP <= 0) {
base.HP = 0;
endGame();
}
}
updateBase();
}
function updateBase() {
if (base.HP > base.maxHP) {
base.HP = base.maxHP;
}
iface.base = (base.HP + "/") + base.maxHP;
iface.interestRate = baseInterest + "%";
iface.kits = "x" + kitsAvailable;
iface.energy = (baseEnergy.HP + "/") + baseEnergy.maxHP;
base.gotoAndStop(5 - int((base.HP / base.maxHP) * 5));
updateHealth(base);
updateHealth(baseEnergy);
}
function updateUpgrades() {
if ((gameMoney < BASE_REPAIR_COST) || (base.HP >= base.maxHP)) {
bonuses.repairClip.gotoAndStop(2);
} else {
bonuses.repairClip.gotoAndStop(1);
}
var _local4 = upgradeCost(BASE_UPGRADE_COST, structureLevel, BASE_STRUCTURE_SCALE);
bonuses.upgradeClip.gotoAndStop(((gameMoney < _local4) ? 2 : 1));
bonuses.upgradeClip.clip.cost = "Cost: $" + _local4;
if (hasStickyUpgrade) {
bonuses.stickyClip.gotoAndStop(3);
} else if (gameMoney < BASE_STICKY_COST) {
bonuses.stickyClip.gotoAndStop(2);
} else {
bonuses.stickyClip.gotoAndStop(1);
}
var _local2 = upgradeCost(BASE_ENERGY_COST, staticLevel, BASE_STATIC_SCALE);
if (hasStaticUpgrade) {
bonuses.staticClip.gotoAndStop(3);
bonuses.energyClip.gotoAndStop(((gameMoney < _local2) ? 2 : 1));
} else if (gameMoney < BASE_STATIC_COST) {
bonuses.staticClip.gotoAndStop(2);
bonuses.energyClip.gotoAndStop(2);
} else {
bonuses.staticClip.gotoAndStop(1);
bonuses.energyClip.gotoAndStop(2);
}
bonuses.energyClip.clip.cost = "Cost: $" + _local2;
var _local1 = upgradeCost(BASE_BOUNCE_COST, bounceLevel, BASE_BOUNCE_SCALE);
if (bounceLevel >= BASE_BOUNCE_MAXIMUM) {
bonuses.bounceClip.gotoAndStop(3);
bonuses.bounceClip.bounceText.gotoAndStop(2);
} else if (gameMoney < _local1) {
bonuses.bounceClip.gotoAndStop(2);
} else {
bonuses.bounceClip.gotoAndStop(1);
}
bonuses.bounceClip.bounceText.cost = "Cost: $" + _local1;
bonuses.bounceClip.bounceText.bounceLevel = "Level: " + bounceLevel;
var _local3 = upgradeCost(BASE_INFUSER_COST, infuserLevel, BASE_INFUSER_SCALE);
if (infuserLevel >= BASE_INFUSER_MAXIMUM) {
bonuses.infuserClip.gotoAndStop(3);
bonuses.infuserClip.infuserText.gotoAndStop(2);
} else if (gameMoney < _local3) {
bonuses.infuserClip.gotoAndStop(2);
} else {
bonuses.infuserClip.gotoAndStop(1);
}
bonuses.infuserClip.infuserText.cost = "Cost: $" + _local3;
bonuses.infuserClip.infuserText.infuserLevel = "Level: " + infuserLevel;
if ((kitsAvailable >= BASE_KITS_MAXIMUM) || (gameMoney < BASE_KITS_COST)) {
bonuses.kitClip.gotoAndStop(2);
} else {
bonuses.kitClip.gotoAndStop(1);
}
if (hasDisruptorDamp) {
bonuses.disruptorClip.gotoAndStop(3);
} else if (bonusPoints < 1) {
bonuses.disruptorClip.gotoAndStop(2);
} else {
bonuses.disruptorClip.gotoAndStop(1);
}
if (hasMissileDamp) {
bonuses.missileClip.gotoAndStop(3);
} else if (bonusPoints < 1) {
bonuses.missileClip.gotoAndStop(2);
} else {
bonuses.missileClip.gotoAndStop(1);
}
if (hasFireballDamp) {
bonuses.fireballClip.gotoAndStop(3);
} else if (bonusPoints < 1) {
bonuses.fireballClip.gotoAndStop(2);
} else {
bonuses.fireballClip.gotoAndStop(1);
}
if (hasShellDamp) {
bonuses.shellClip.gotoAndStop(3);
} else if (bonusPoints < 1) {
bonuses.shellClip.gotoAndStop(2);
} else {
bonuses.shellClip.gotoAndStop(1);
}
if (hasExploder) {
bonuses.exploderClip.gotoAndStop(3);
} else if (bonusPoints < 3) {
bonuses.exploderClip.gotoAndStop(2);
} else {
bonuses.exploderClip.gotoAndStop(1);
}
if (hasHeatseeker) {
bonuses.heatseekerClip.gotoAndStop(3);
} else if (bonusPoints < 3) {
bonuses.heatseekerClip.gotoAndStop(2);
} else {
bonuses.heatseekerClip.gotoAndStop(1);
}
if (hasEMP) {
bonuses.EMPClip.gotoAndStop(3);
} else if (bonusPoints < 1) {
bonuses.EMPClip.gotoAndStop(2);
} else {
bonuses.EMPClip.gotoAndStop(1);
}
if (hasAMShield) {
bonuses.amshieldClip.gotoAndStop(3);
} else if (bonusPoints < 3) {
bonuses.amshieldClip.gotoAndStop(2);
} else {
bonuses.amshieldClip.gotoAndStop(1);
}
if (hasInferno) {
bonuses.infernoClip.gotoAndStop(3);
} else if (bonusPoints < 2) {
bonuses.infernoClip.gotoAndStop(2);
} else {
bonuses.infernoClip.gotoAndStop(1);
}
if (bonusPoints < 1) {
bonuses.interestClip.gotoAndStop(2);
} else {
bonuses.interestClip.gotoAndStop(1);
}
bonuses.bonusPoints = "Bonus Points: " + bonusPoints;
}
function buyUpgrade(iUpgrade) {
switch (iUpgrade) {
case UPGRADE_REPAIR :
addMoney(-BASE_REPAIR_COST);
base.HP = base.HP + 25;
updateBase();
break;
case UPGRADE_UPGRADE :
addMoney(-upgradeCost(BASE_UPGRADE_COST, structureLevel, BASE_STRUCTURE_SCALE));
structureLevel++;
base.maxHP = base.maxHP + 25;
base.HP = base.HP + 25;
updateBase();
break;
case UPGRADE_ENERGY :
addMoney(-upgradeCost(BASE_ENERGY_COST, staticLevel, BASE_STATIC_SCALE));
staticLevel++;
baseEnergy.maxHP = baseEnergy.maxHP + 15;
baseEnergy.HP = baseEnergy.HP + 15;
updateBase();
break;
case UPGRADE_STICKY :
addMoney(-BASE_STICKY_COST);
hasStickyUpgrade = true;
updateBase();
break;
case UPGRADE_BOUNCE :
addMoney(-upgradeCost(BASE_BOUNCE_COST, bounceLevel, BASE_BOUNCE_SCALE));
bounceLevel++;
updateBase();
break;
case UPGRADE_KIT :
addMoney(-BASE_KITS_COST);
kitsAvailable++;
updateBase();
break;
case UPGRADE_STATIC :
addMoney(-BASE_STATIC_COST);
hasStaticUpgrade = true;
addHealth(baseEnergy, 0, BASE_ENERGY_OFFSET_Y, HEALTHBAR_RED);
updateBase();
break;
case UPGRADE_INFUSER :
addMoney(-upgradeCost(BASE_INFUSER_COST, infuserLevel, BASE_INFUSER_SCALE));
infuserLevel++;
updateBase();
break;
case UPGRADE_DISRUPTOR_DAMP :
bonusPoints--;
hasDisruptorDamp = true;
break;
case UPGRADE_MISSILE_DAMP :
bonusPoints--;
hasMissileDamp = true;
break;
case UPGRADE_FIREBALL_DAMP :
bonusPoints--;
hasFireballDamp = true;
break;
case UPGRADE_SHELL_DAMP :
bonusPoints--;
hasShellDamp = true;
break;
case UPGRADE_EXPLODER :
bonusPoints = bonusPoints - 3;
hasExploder = true;
break;
case UPGRADE_INTEREST :
bonusPoints--;
baseInterest = baseInterest + 3;
updateBase();
break;
case UPGRADE_HEATSEEKER :
bonusPoints = bonusPoints - 3;
hasHeatseeker = true;
break;
case UPGRADE_EMP :
bonusPoints--;
hasEMP = true;
break;
case UPGRADE_AMSHIELD :
bonusPoints = bonusPoints - 3;
hasAMShield = true;
break;
case UPGRADE_INFERNO :
bonusPoints = bonusPoints - 2;
hasInferno = true;
}
var _local1 = int(Math.random() * upgradeSounds.length);
playSound(upgradeSounds[_local1]);
showMoney();
updateUpgrades();
}
function regenEnergy() {
var _local1 = int(baseEnergy.maxHP / 15);
baseEnergy.HP = baseEnergy.HP + _local1;
if (baseEnergy.HP > baseEnergy.maxHP) {
baseEnergy.HP = baseEnergy.maxHP;
}
updateBase();
}
function useRepairKit() {
if (((kitsAvailable > 0) && (base.HP < base.maxHP)) && (gameState == STATE_PLAY)) {
kitsAvailable--;
base.HP = base.HP + 25;
updateBase();
}
}
function upgradeCost(iBase, iLevel, iScale) {
var _local1 = iBase * Math.pow(iScale, iLevel);
return(int(_local1));
}
function saveGame() {
if (forFS) {
var _local1 = SharedObject.getLocal("ShieldDefense", "/");
} else {
var _local1 = SharedObject.getLocal("ShieldDefense");
}
_local1.data.hash = SHA1((("sd14fd" + gameMoney) + bonusPoints) + "sd14fd");
_local1.data.baseInterest = baseInterest;
_local1.data.bounceLevel = bounceLevel;
_local1.data.infuserLevel = infuserLevel;
_local1.data.structureLevel = structureLevel;
_local1.data.staticLevel = staticLevel;
_local1.data.kitsAvailable = kitsAvailable;
_local1.data.hasStickyUpgrade = hasStickyUpgrade;
_local1.data.hasStaticUpgrade = hasStaticUpgrade;
_local1.data.baseMaxHP = base.maxHP;
_local1.data.baseHP = base.HP;
_local1.data.baseEnergyMaxHP = baseEnergy.maxHP;
_local1.data.baseEnergyHP = baseEnergy.HP;
_local1.data.gameLevel = gameLevel;
_local1.data.gameMoney = gameMoney;
_local1.data.gameScore = gameScore;
_local1.data.tankFireInterval = tankFireInterval;
_local1.data.hasDisruptorDamp = hasDisruptorDamp;
_local1.data.hasMissileDamp = hasMissileDamp;
_local1.data.hasFireballDamp = hasFireballDamp;
_local1.data.hasShellDamp = hasShellDamp;
_local1.data.bonusPoints = bonusPoints;
_local1.data.hasExploder = hasExploder;
_local1.data.hasHeatseeker = hasHeatseeker;
_local1.data.hasEMP = hasEMP;
_local1.data.hasAMShield = hasAMShield;
_local1.data.hasInferno = hasInferno;
_local1.data.gameDifficulty = gameDifficulty;
_local1.flush();
}
function loadData() {
if (forFS) {
var _local1 = SharedObject.getLocal("ShieldDefense", "/");
} else {
var _local1 = SharedObject.getLocal("ShieldDefense");
}
if (SHA1((("sd14fd" + _local1.data.gameMoney) + _local1.data.bonusPoints) + "sd14fd") == _local1.data.hash) {
saveData.baseInterest = _local1.data.baseInterest;
saveData.bounceLevel = _local1.data.bounceLevel;
saveData.infuserLevel = _local1.data.infuserLevel;
saveData.structureLevel = _local1.data.structureLevel;
saveData.staticLevel = _local1.data.staticLevel;
saveData.kitsAvailable = _local1.data.kitsAvailable;
saveData.hasStickyUpgrade = _local1.data.hasStickyUpgrade;
saveData.hasStaticUpgrade = _local1.data.hasStaticUpgrade;
saveData.baseMaxHP = _local1.data.baseMaxHP;
saveData.baseHP = _local1.data.baseHP;
saveData.baseEnergyMaxHP = _local1.data.baseEnergyMaxHP;
saveData.baseEnergyHP = _local1.data.baseEnergyHP;
saveData.gameLevel = _local1.data.gameLevel;
saveData.gameMoney = _local1.data.gameMoney;
if (forKongregate) {
saveData.gameScore = 0;
} else {
saveData.gameScore = _local1.data.gameScore;
}
saveData.tankFireInterval = _local1.data.tankFireInterval;
saveData.hasDisruptorDamp = _local1.data.hasDisruptorDamp;
saveData.hasMissileDamp = _local1.data.hasMissileDamp;
saveData.hasFireballDamp = _local1.data.hasFireballDamp;
saveData.hasShellDamp = _local1.data.hasShellDamp;
saveData.bonusPoints = _local1.data.bonusPoints;
saveData.hasExploder = _local1.data.hasExploder;
saveData.hasHeatseeker = _local1.data.hasHeatseeker;
saveData.hasEMP = _local1.data.hasEMP;
saveData.hasAMShield = _local1.data.hasAMShield;
saveData.hasInferno = _local1.data.hasInferno;
saveData.gameDifficulty = _local1.data.gameDifficulty;
} else {
saveData.gameLevel = 0;
}
}
function SHA1(msg) {
function rotate_left(n, s) {
var _local1 = (n << s) | (n >>> (32 - s));
return(_local1);
}
function lsb_hex(val) {
var _local2 = "";
var _local1;
var _local4;
var _local3;
_local1 = 0;
while (_local1 <= 6) {
_local4 = (val >>> ((_local1 * 4) + 4)) & 15;
_local3 = (val >>> (_local1 * 4)) & 15;
_local2 = _local2 + (_local4.toString(16) + _local3.toString(16));
_local1 = _local1 + 2;
}
return(_local2);
}
function cvt_hex(val) {
var _local2 = "";
var _local1;
var _local3;
_local1 = 7;
while (_local1 >= 0) {
_local3 = (val >>> (_local1 * 4)) & 15;
_local2 = _local2 + _local3.toString(16);
_local1--;
}
return(_local2);
}
function Utf8Encode(string) {
var _local1 = "";
var _local3 = 0;
while (_local3 < string.length) {
var _local2 = string.charCodeAt(_local3);
if (_local2 < 128) {
_local1 = _local1 + String.fromCharCode(_local2);
} else if ((_local2 > 127) && (_local2 < 2048)) {
_local1 = _local1 + String.fromCharCode((_local2 >> 6) | 192);
_local1 = _local1 + String.fromCharCode((_local2 & 63) | 128);
} else {
_local1 = _local1 + String.fromCharCode((_local2 >> 12) | 224);
_local1 = _local1 + String.fromCharCode(((_local2 >> 6) & 63) | 128);
_local1 = _local1 + String.fromCharCode((_local2 & 63) | 128);
}
_local3++;
}
return(_local1);
}
var _local9;
var _local8;
var _local18;
var _local5 = new Array(80);
var _local13 = 1732584193 /* 0x67452301 */;
var _local14 = 4023233000;
var _local15 = 2562383000;
var _local16 = 271733878 /* 0x10325476 */;
var _local12 = 3285378000;
var _local4;
var _local1;
var _local3;
var _local2;
var _local6;
var _local7;
msg = Utf8Encode(msg);
var _local17 = msg.length;
var _local10 = new Array();
_local8 = 0;
while (_local8 < (_local17 - 3)) {
_local18 = (((msg.charCodeAt(_local8) << 24) | (msg.charCodeAt(_local8 + 1) << 16)) | (msg.charCodeAt(_local8 + 2) << 8)) | msg.charCodeAt(_local8 + 3);
_local10.push(_local18);
_local8 = _local8 + 4;
}
switch (_local17 % 4) {
case 0 :
_local8 = 2147484000;
break;
case 1 :
_local8 = (msg.charCodeAt(_local17 - 1) << 24) | 8388608;
break;
case 2 :
_local8 = ((msg.charCodeAt(_local17 - 2) << 24) | (msg.charCodeAt(_local17 - 1) << 16)) | 32768;
break;
case 3 :
_local8 = (((msg.charCodeAt(_local17 - 3) << 24) | (msg.charCodeAt(_local17 - 2) << 16)) | (msg.charCodeAt(_local17 - 1) << 8)) | 128;
}
_local10.push(_local8);
while ((_local10.length % 16) != 14) {
_local10.push(0);
}
_local10.push(_local17 >>> 29);
_local10.push((_local17 << 3) & 4294967000);
_local9 = 0;
while (_local9 < _local10.length) {
_local8 = 0;
while (_local8 < 16) {
_local5[_local8] = _local10[_local9 + _local8];
_local8++;
}
_local8 = 16;
while (_local8 <= 79) {
_local5[_local8] = rotate_left(((_local5[_local8 - 3] ^ _local5[_local8 - 8]) ^ _local5[_local8 - 14]) ^ _local5[_local8 - 16], 1);
_local8++;
}
_local4 = _local13;
_local1 = _local14;
_local3 = _local15;
_local2 = _local16;
_local6 = _local12;
_local8 = 0;
while (_local8 <= 19) {
_local7 = ((((rotate_left(_local4, 5) + ((_local1 & _local3) | ((_local1 ^ 4294967000) & _local2))) + _local6) + _local5[_local8]) + 1518500249) & 4294967000;
_local6 = _local2;
_local2 = _local3;
_local3 = rotate_left(_local1, 30);
_local1 = _local4;
_local4 = _local7;
_local8++;
}
_local8 = 20;
while (_local8 <= 39) {
_local7 = ((((rotate_left(_local4, 5) + ((_local1 ^ _local3) ^ _local2)) + _local6) + _local5[_local8]) + 1859775393) & 4294967000;
_local6 = _local2;
_local2 = _local3;
_local3 = rotate_left(_local1, 30);
_local1 = _local4;
_local4 = _local7;
_local8++;
}
_local8 = 40;
while (_local8 <= 59) {
_local7 = ((((rotate_left(_local4, 5) + (((_local1 & _local3) | (_local1 & _local2)) | (_local3 & _local2))) + _local6) + _local5[_local8]) + 2400960000) & 4294967000;
_local6 = _local2;
_local2 = _local3;
_local3 = rotate_left(_local1, 30);
_local1 = _local4;
_local4 = _local7;
_local8++;
}
_local8 = 60;
while (_local8 <= 79) {
_local7 = ((((rotate_left(_local4, 5) + ((_local1 ^ _local3) ^ _local2)) + _local6) + _local5[_local8]) + 3395470000) & 4294967000;
_local6 = _local2;
_local2 = _local3;
_local3 = rotate_left(_local1, 30);
_local1 = _local4;
_local4 = _local7;
_local8++;
}
_local13 = (_local13 + _local4) & 4294967000;
_local14 = (_local14 + _local1) & 4294967000;
_local15 = (_local15 + _local3) & 4294967000;
_local16 = (_local16 + _local2) & 4294967000;
_local12 = (_local12 + _local6) & 4294967000;
_local9 = _local9 + 16;
}
_local7 = (((cvt_hex(_local13) + cvt_hex(_local14)) + cvt_hex(_local15)) + cvt_hex(_local16)) + cvt_hex(_local12);
return(_local7.toLowerCase());
}
START_X = 0;
START_Y = 0;
if (forFS) {
BUILD_INTERFACE = "InterfaceWii";
END_X = 700;
END_Y = 600;
} else {
BUILD_INTERFACE = "Interface";
END_X = 550;
END_Y = 550;
}
CENTER_X = START_X + int((END_X - START_X) / 2);
CENTER_Y = START_Y + int((END_Y - START_Y) / 2);
STATE_STOP = 0;
STATE_NEWLEVEL = 1;
STATE_PLAY = 2;
STATE_PAUSE = 3;
STATE_BONUSES = 4;
gameState = STATE_STOP;
soundOn = true;
musicOn = true;
highQuality = true;
gameLevel = 0;
powerups = [];
SOUND_GAME_OVER = 0;
SOUND_EXPLOSION = 1;
SOUND_LEVEL_COMPLETE = 2;
SOUND_START_LEVEL = 3;
SOUND_POWERUP = 4;
SOUND_CASH = 5;
SOUND_WARNING = 6;
SOUND_SHOT = 7;
SOUND_TANK_EXPLOSION_1 = 8;
SOUND_TANK_EXPLOSION_2 = 9;
SOUND_TANK_EXPLOSION_3 = 10;
SOUND_TANK_EXPLOSION_BOSS = 11;
SOUND_DISRUPTOR_1 = 12;
SOUND_DISRUPTOR_2 = 13;
SOUND_MISSILE_1 = 14;
SOUND_FIREBALL_1 = 15;
SOUND_FIREBALL_2 = 16;
SOUND_IMPACT_1 = 17;
SOUND_IMPACT_2 = 18;
SOUND_IMPACT_3 = 19;
SOUND_SHELL_1 = 20;
SOUND_SHELL_2 = 21;
SOUND_SHELL_3 = 22;
SOUND_BUY_UPGRADE_1 = 23;
SOUND_BUY_UPGRADE_2 = 24;
soundNames = ["gameOverSound", "explosionSound", "levelCompleteSound", "startLevelSound", "powerupSound", "soundCoin", "warning", "shotSound", "tankExplosionSound", "tankExplosion1", "tankExplosion2", "bossTankExplosion", "Disruptor1", "Disruptor2", "Missile1", "Fireball1", "Fireball2", "impact1", "impact2", "impact3", "Shell1", "Shell2", "Shell3", "buyUpgrade1", "buyUpgrade2"];
sounds = [];
soundLen = soundNames.length;
sT = 0;
while (sT < soundLen) {
newSound = new Sound(_root);
newSound.attachSound(soundNames[sT]);
sounds.push(newSound);
sT++;
}
MUSIC_LEVEL = "LevelMusic";
MUSIC_BONUS = "BonusMusic";
MUSIC_MENU = "MenuMusic";
musicObj = newClip("SoundLoader");
listener = new Object();
listener.onKeyDown = function () {
keyCode = Key.getCode();
if (!(keyCode === 32)) {
} else {
getClick();
}
};
listener.onKeyUp = function () {
keyCode = Key.getCode();
keyAscii = Key.getAscii();
switch (keyCode) {
case 32 :
shieldOff();
break;
case 13 :
getClick();
}
switch (keyAscii) {
case 82 :
case 114 :
case 171 :
useRepairKit();
return;
case 80 :
case 112 :
case 170 :
case 174 :
togglePauseState();
}
};
Key.addListener(listener);
onEnterFrame = gameLoop;
onMouseDown = getClick;
onMouseUp = shieldOff;
DIFFICULTY_EASY = 0;
DIFFICULTY_NORMAL = 1;
DIFFICULTY_HARD = 2;
INTERFACE_LEVEL = 500000 /* 0x07A120 */;
RESOURCE_LEVEL = 500001 /* 0x07A121 */;
INSTRUCTIONS_LEVEL = 500008 /* 0x07A128 */;
OFFSET_NEW_LEVEL = 50 * SCALE_PER;
scoresCallback = function (scores) {
var _local1 = 0;
var _local2 = 0;
_local1 = 0;
while (_local1 < 10) {
_local2 = _local1 + 1;
if (scores.list[_local1].score > 0) {
instructions["name" + _local2].text = scores.list[_local1].username;
instructions["score" + _local2].text = scores.list[_local1].score;
}
_local1++;
}
};
DEFAULT_LEVEL_TIME = 300;
MAX_LEVELS = 50;
tankPattern = [];
tankDistribution = [];
powerupTypes = ["generic"];
POWERUP_GENERIC = 0;
MAX_BULLETS = 10;
maxBullets = MAX_BULLETS;
bulletCount = 0;
bullets = [];
BULLET_DISRUPTOR = 0;
BULLET_MISSILE = 1;
BULLET_FIREBALL = 2;
BULLET_SHELL = 3;
bulletTypes = [{name:"Disruptor", strength:7, speed:5, sounds:[SOUND_DISRUPTOR_1, SOUND_DISRUPTOR_2]}, {name:"Missile", strength:12, speed:3, sounds:[SOUND_MISSILE_1]}, {name:"Fireball", strength:9, speed:4, sounds:[SOUND_FIREBALL_1, SOUND_FIREBALL_2]}, {name:"Shell", strength:5, speed:6, sounds:[SOUND_SHELL_1, SOUND_SHELL_2, SOUND_SHELL_3]}];
stuckPoint = new Object();
TANK_HEALTHBAR_OFFSET_X = 0;
TANK_HEALTHBAR_OFFSET_Y = -20;
TANK_BUFFER = 45;
MAX_TANKS = 5;
maxTanks = MAX_TANKS;
TANKS_PER_LEVEL = 12;
TANK_INTERVAL = 5000;
tankInterval = TANK_INTERVAL;
TANK_FIRE_INTERVAL = 2000;
tankFireInterval = TANK_FIRE_INTERVAL;
tanks = [];
tankCount = 0;
startPos = [[START_X + TANK_BUFFER, START_Y - TANK_BUFFER], [END_X - TANK_BUFFER, START_Y - TANK_BUFFER], [END_X + TANK_BUFFER, START_Y + TANK_BUFFER], [END_X + TANK_BUFFER, END_Y - TANK_BUFFER], [END_X - TANK_BUFFER, END_Y + TANK_BUFFER], [START_X + TANK_BUFFER, END_Y + TANK_BUFFER], [START_X - TANK_BUFFER, END_Y - TANK_BUFFER], [START_X - TANK_BUFFER, START_Y + TANK_BUFFER]];
startSpeed = [[0, 1], [0, 1], [-1, 0], [-1, 0], [0, -1], [0, -1], [1, 0], [1, 0]];
TANK_REGULAR = 0;
TANK_MISSILE = 1;
TANK_FIRE = 2;
TANK_DISRUPTOR = 3;
TANK_BRUISER = 4;
TANK_INFERNO = 5;
TANK_BOSS1 = 6;
tankTypes = [{name:"Regular", bullet:BULLET_SHELL, speed:1.25, hp:5, money:25, score:100, offset:-20, pushback:2, impactSounds:[SOUND_IMPACT_1, SOUND_IMPACT_2, SOUND_IMPACT_3], explosionSounds:[SOUND_TANK_EXPLOSION_1, SOUND_TANK_EXPLOSION_2, SOUND_TANK_EXPLOSION_3], rotateSpeed:5}, {name:"Missile", bullet:BULLET_MISSILE, speed:0.9, hp:5, money:45, score:200, offset:-20, pushback:2, impactSounds:[SOUND_IMPACT_1, SOUND_IMPACT_2, SOUND_IMPACT_3], explosionSounds:[SOUND_TANK_EXPLOSION_1, SOUND_TANK_EXPLOSION_2, SOUND_TANK_EXPLOSION_3], rotateSpeed:4}, {name:"Firetank", bullet:BULLET_FIREBALL, speed:1.1, hp:15, money:55, score:250, offset:-25, pushback:3, impactSounds:[SOUND_IMPACT_1, SOUND_IMPACT_2, SOUND_IMPACT_3], explosionSounds:[SOUND_TANK_EXPLOSION_1, SOUND_TANK_EXPLOSION_2, SOUND_TANK_EXPLOSION_3], rotateSpeed:3, immunity:BULLET_FIRE, reduction:0.2}, {name:"Disruptor", bullet:BULLET_DISRUPTOR, speed:1, hp:10, money:35, score:150, offset:-25, pushback:3, impactSounds:[SOUND_IMPACT_1, SOUND_IMPACT_2, SOUND_IMPACT_3], explosionSounds:[SOUND_TANK_EXPLOSION_1, SOUND_TANK_EXPLOSION_2, SOUND_TANK_EXPLOSION_3], rotateSpeed:4, immunity:BULLET_DISRUPTOR, reduction:0.2}, {name:"Bruiser", bullet:BULLET_DISRUPTOR, speed:0.8, hp:25, money:65, score:300, offset:-35, pushback:6, impactSounds:[SOUND_IMPACT_1, SOUND_IMPACT_2, SOUND_IMPACT_3], explosionSounds:[SOUND_TANK_EXPLOSION_1, SOUND_TANK_EXPLOSION_2, SOUND_TANK_EXPLOSION_3], rotateSpeed:2, immunity:BULLET_DISRUPTOR, reduction:0.3}, {name:"Inferno", bullet:BULLET_FIREBALL, speed:0.7, hp:30, money:70, score:350, offset:-35, pushback:6, impactSounds:[SOUND_IMPACT_1, SOUND_IMPACT_2, SOUND_IMPACT_3], explosionSounds:[SOUND_TANK_EXPLOSION_1, SOUND_TANK_EXPLOSION_2, SOUND_TANK_EXPLOSION_3], rotateSpeed:2, immunity:BULLET_FIRE, reduction:0.3}, {name:"Boss 1", bullet:BULLET_MISSILE, speed:0.7, hp:300, money:1000, score:5000, offset:-40, pushback:6, impactSounds:[SOUND_IMPACT_1, SOUND_IMPACT_2, SOUND_IMPACT_3], explosionSounds:[SOUND_TANK_EXPLOSION_1, SOUND_TANK_EXPLOSION_2, SOUND_TANK_EXPLOSION_3], rotateSpeed:2, turrets:[BULLET_SHELL, BULLET_MISSILE, BULLET_MISSILE], deadzoneFactor:4, immunity:BULLET_MISSILE, reduction:0.4}];
startPoint = new Object();
HEALTHBAR_GREEN = 0;
HEALTHBAR_RED = 1;
healthbars = [];
BASE_REPAIR_COST = 0;
BASE_UPGRADE_COST = 0;
BASE_STICKY_COST = 0;
BASE_BOUNCE_COST = 0;
BASE_ENERGY_COST = 0;
BASE_KITS_COST = 0;
BASE_STATIC_COST = 0;
BASE_INFUSER_COST = 0;
BASE_STRUCTURE_SCALE = 2;
BASE_STATIC_SCALE = 2;
BASE_BOUNCE_SCALE = 2;
BASE_INFUSER_SCALE = 2;
UPGRADE_REPAIR = 0;
UPGRADE_UPGRADE = 1;
UPGRADE_STICKY = 2;
UPGRADE_BOUNCE = 3;
UPGRADE_ENERGY = 4;
UPGRADE_INFUSER = 5;
UPGRADE_KIT = 6;
UPGRADE_STATIC = 7;
UPGRADE_DISRUPTOR_DAMP = 8;
UPGRADE_MISSILE_DAMP = 9;
UPGRADE_FIREBALL_DAMP = 10;
UPGRADE_SHELL_DAMP = 11;
UPGRADE_EXPLODER = 12;
UPGRADE_INTEREST = 13;
UPGRADE_HEATSEEKER = 14;
UPGRADE_EMP = 15;
UPGRADE_AMSHIELD = 16;
UPGRADE_INFERNO = 17;
BASE_MAX_HP = 9000;
BASE_MAX_ENERGY = 9000;
BASE_HEALTH_OFFSET_Y = -25;
BASE_ENERGY_OFFSET_Y = -20;
BASE_BOUNCE_MAXIMUM = 10;
BASE_INFUSER_MAXIMUM = 10;
BASE_KITS_MAXIMUM = 9000;
BASE_INTEREST = 9000;
baseImpactSounds = [SOUND_IMPACT_1, SOUND_IMPACT_2, SOUND_IMPACT_3];
upgradeSounds = [SOUND_BUY_UPGRADE_1, SOUND_BUY_UPGRADE_2];
saveData = new Object();
Frame 4
gameState = STATE_STOP;
showInstructions();
stop();
Frame 5
levelDone = false;
nextLevel();
stop();
Frame 7
if (!levelDone) {
gotoAndStop ("betweenLevels");
} else {
levelDone = false;
gotoAndStop ("nextLevelFrame");
}
Symbol 10 MovieClip [BigPoints] Frame 2
_root.playSound(_root.SOUND_COIN);
Symbol 10 MovieClip [BigPoints] Frame 30
this.removeMovieClip();
Symbol 20 MovieClip Frame 1
stop();
_global.totalBytes = _root.getBytesTotal();
this.onEnterFrame = function () {
var _local2 = 0;
var _local3 = 0;
_local2 = _root.getBytesLoaded();
_local3 = int((_local2 / totalBytes) * 100);
if (_local3 > 99) {
gotoAndPlay (2);
}
};
Symbol 20 MovieClip Frame 2
this.onEnterFrame = null;
Symbol 20 MovieClip Frame 144
_root.play();
stop();
Symbol 48 MovieClip Frame 1
stop();
Symbol 58 MovieClip Frame 1
stop();
Symbol 78 MovieClip Frame 1
stop();
Symbol 93 MovieClip Frame 1
stop();
Symbol 105 MovieClip Frame 1
stop();
Symbol 117 MovieClip Frame 1
stop();
Symbol 119 MovieClip Frame 1
stop();
Symbol 127 MovieClip Frame 1
stop();
Symbol 139 MovieClip Frame 1
stop();
Symbol 156 MovieClip [Tank] Frame 1
stop();
Symbol 156 MovieClip [Tank] Frame 17
_root.removeTank(this.mcName);
stop();
Symbol 161 MovieClip [Base] Frame 1
stop();
Symbol 166 MovieClip [Shield] Frame 1
stop();
Symbol 181 MovieClip Frame 1
stop();
Symbol 192 MovieClip [Bullet] Frame 1
stop();
Symbol 192 MovieClip [Bullet] Frame 12
_root.removeBullet(this.mcName);
Symbol 199 MovieClip [Blast] Frame 6
this.removeMovieClip();
Symbol 206 MovieClip Frame 1
stop();
Symbol 208 MovieClip Frame 1
stop();
Symbol 211 MovieClip Frame 1
stop();
Symbol 215 MovieClip Frame 1
stop();
Symbol 221 Button
on (release) {
_root.useRepairKit();
}
Symbol 240 Button
on (release) {
_root.toggleSound();
}
Symbol 241 Button
on (release) {
_root.toggleQuality();
}
Symbol 242 Button
on (release) {
_root.togglePauseState();
}
Symbol 243 Button
on (release) {
_root.toggleMusic();
}
Symbol 269 MovieClip [SoundLoader] Frame 1
stop();
Symbol 269 MovieClip [SoundLoader] Frame 10
stop();
Symbol 269 MovieClip [SoundLoader] Frame 11
stop();
Symbol 269 MovieClip [SoundLoader] Frame 20
stop();
Symbol 269 MovieClip [SoundLoader] Frame 21
stop();
Symbol 269 MovieClip [SoundLoader] Frame 30
stop();
Symbol 269 MovieClip [SoundLoader] Frame 31
stop();
Symbol 276 Button
on (release) {
this.gotoAndStop(3);
}
Symbol 278 Button
on (release) {
this.gotoAndStop(2);
}
Symbol 282 Button
on (release) {
_root.startGame(true);
}
Symbol 283 MovieClip Frame 1
stop();
Symbol 285 Button
on (release) {
if (_root.forKongregate) {
gotoAndStop ("highscores");
} else {
getURL ("http://www.pitchmobile.com/shieldscores.php", "_blank");
}
}
Symbol 294 Button
on (release) {
this.gotoAndStop(1);
}
Symbol 296 Button
on (release) {
_root.gameDifficulty = _root.DIFFICULTY_NORMAL;
_root.startGame(false);
}
Symbol 298 Button
on (release) {
_root.gameDifficulty = _root.DIFFICULTY_HARD;
_root.startGame(false);
}
Symbol 301 Button
on (release) {
_root.gameDifficulty = _root.DIFFICULTY_EASY;
_root.startGame(false);
}
Symbol 304 Button
on (release) {
this.gotoAndStop(1);
}
Symbol 306 MovieClip Frame 1
stop();
Symbol 307 Button
on (release) {
_root.kongregateScores.setMode("Sergeant");
_root.getScores();
_root.scoresMode = "Sergeant";
_parent.setButtons();
}
Symbol 308 MovieClip Frame 1
stop();
Symbol 311 Button
on (release) {
_root.kongregateScores.setMode("Captain");
_root.getScores();
_root.scoresMode = "Captain";
_parent.setButtons();
}
Symbol 312 MovieClip Frame 1
stop();
Symbol 315 Button
on (release) {
_root.kongregateScores.setMode("General");
_root.getScores();
_root.scoresMode = "General";
_parent.setButtons();
}
Symbol 316 MovieClip Frame 1
stop();
Symbol 350 MovieClip [Instructions] Frame 1
if (_root.saveData.gameLevel > 0) {
} else {
continueClip.gotoAndStop(2);
}
stop();
Symbol 350 MovieClip [Instructions] Frame 4
function setButtons() {
this.btnCaptain.gotoAndStop(1);
this.btnSergeant.gotoAndStop(1);
this.btnGeneral.gotoAndStop(1);
this["btn" + _root.scoresMode].gotoAndStop(2);
}
_root.getScores();
setButtons();
Symbol 354 MovieClip Frame 1
stop();
Symbol 363 Button
on (release) {
if (sName != undefined) {
_root.setHighScore(sName);
_root.showInstructions();
this.removeMovieClip();
}
}
Symbol 365 Button
on (release) {
_root.showInstructions();
this.removeMovieClip();
}
Symbol 370 MovieClip [LevelComplete] Frame 20
stop();
Symbol 372 Button
on (release) {
_root.play();
}
Symbol 374 Button
on (release) {
_parent.gotoAndStop(2);
}
Symbol 376 MovieClip Frame 1
stop();
Symbol 378 Button
on (release) {
_root.saveGame();
this.gotoAndStop(2);
}
Symbol 381 MovieClip Frame 1
stop();
Symbol 387 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_REPAIR);
}
Symbol 388 MovieClip Frame 1
stop();
Symbol 394 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_UPGRADE);
}
Symbol 395 MovieClip Frame 1
stop();
Symbol 403 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_STICKY);
}
Symbol 405 MovieClip Frame 1
stop();
Symbol 413 MovieClip Frame 1
stop();
Symbol 414 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_BOUNCE);
}
Symbol 420 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_KIT);
}
Symbol 421 MovieClip Frame 1
stop();
Symbol 427 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_ENERGY);
}
Symbol 428 MovieClip Frame 1
stop();
Symbol 435 MovieClip Frame 1
stop();
Symbol 436 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_INFUSER);
}
Symbol 446 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_STATIC);
}
Symbol 447 MovieClip Frame 1
stop();
Symbol 449 Button
on (release) {
gotoAndStop (1);
}
Symbol 454 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_DISRUPTOR_DAMP);
}
Symbol 455 MovieClip Frame 1
stop();
Symbol 459 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_MISSILE_DAMP);
}
Symbol 460 MovieClip Frame 1
stop();
Symbol 464 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_SHELL_DAMP);
}
Symbol 465 MovieClip Frame 1
stop();
Symbol 469 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_FIREBALL_DAMP);
}
Symbol 470 MovieClip Frame 1
stop();
Symbol 477 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_EXPLODER);
}
Symbol 478 MovieClip Frame 1
stop();
Symbol 484 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_INTEREST);
}
Symbol 485 MovieClip Frame 1
stop();
Symbol 491 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_HEATSEEKER);
}
Symbol 492 MovieClip Frame 1
stop();
Symbol 498 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_EMP);
}
Symbol 499 MovieClip Frame 1
stop();
Symbol 505 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_INFERNO);
}
Symbol 506 MovieClip Frame 1
stop();
Symbol 512 Button
on (release) {
_root.buyUpgrade(_root.UPGRADE_AMSHIELD);
}
Symbol 513 MovieClip Frame 1
stop();
Symbol 514 MovieClip [Bonuses] Frame 1
_root.updateUpgrades();
stop();
Symbol 514 MovieClip [Bonuses] Frame 2
_root.updateUpgrades();
Symbol 526 MovieClip [disruptorblast] Frame 11
this.removeMovieClip();
Symbol 540 MovieClip [tankTeleport] Frame 25
this.removeMovieClip();
Symbol 552 Button
on (release) {
_root.gameState = _root.STATE_STOP;
_root.showInstructions();
this.removeMovieClip();
}
Symbol 554 Button
on (release) {
_root.unpauseGame();
}
Symbol 558 MovieClip [OutOfTime] Frame 20
stop();