Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
var pv;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
pv = ((fv == 5) ? (getVersion()) : (System.capabilities.version));
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=8&fv=") + fv) + "&v=") + escape(pv)) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
__com_mochibot__("408a6c54", this, 10301, true);
function itemHandler1(obj, item) {
getURL ("http://avgames.co.uk");
}
function itemHandler2(obj, item) {
getURL ("http://portalstrike.com");
}
function itemHandler3(obj, item) {
getURL ("http://itch.com/?source=fg_26", "_self");
}
function onEnterFrame() {
urlStart = _url.indexOf("://") + 3;
urlEnd = _url.indexOf("/", urlStart);
domain = _url.substring(urlStart, urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
if (on_frame == 1) {
bytes_loaded = Math.round(_root.getBytesLoaded());
bytes_total = Math.round(_root.getBytesTotal());
getPercent = bytes_loaded / bytes_total;
_root.loadBar._width = getPercent * 100;
_root.loadText = Math.round(getPercent * 100) + "%";
if (bytes_loaded == bytes_total) {
_root.gotoAndStop(2);
on_frame = 2;
}
}
}
stop();
on_frame = 1;
mochi.MochiServices.connect("eb00a4b493c9144d");
var myMenu = new ContextMenu();
myMenu.hideBuiltInItems();
item1 = new ContextMenuItem("avgames", itemHandler1);
item2 = new ContextMenuItem("portalstrike", itemHandler2);
item3 = new ContextMenuItem("Play More Games", itemHandler3);
myMenu.customItems.push(item1);
myMenu.customItems.push(item2);
myMenu.customItems.push(item3);
_root.menu = myMenu;
ps.onPress = function () {
getURL ("http://www.portalstrike.com/", "_blank");
};
av.onPress = function () {
getURL ("http://www.avgames.co.uk/", "_blank");
};
var hsapi = new Hsapi(_root.portal_URL);
Instance of Symbol 465 MovieClip in Frame 1
on (release) {
getURL ("http://itch.com/?source=fg_26", "_self");
}
Frame 2
stop();
Frame 4
stop();
score = 0;
play_btn.onPress = function () {
gotoAndStop (5);
};
instructions.onPress = function () {
gotoAndStop (7);
};
artSite.onPress = function () {
getURL ("http://www.avgames.co.uk/", "_blank");
};
playMoreGames.onPress = function () {
getURL ("http://itch.com/?source=fg_26", "_self");
};
play_btn.onRollOver = function () {
play_btn.gotoAndStop(2);
};
play_btn.onRollOut = function () {
play_btn.gotoAndStop(1);
};
instructions.onRollOver = function () {
instructions.gotoAndStop(2);
};
instructions.onRollOut = function () {
instructions.gotoAndStop(1);
};
artSite.onRollOver = function () {
artSite.gotoAndStop(2);
};
artSite.onRollOut = function () {
artSite.gotoAndStop(1);
};
playMoreGames.onRollOver = function () {
playMoreGames.gotoAndStop(2);
};
playMoreGames.onRollOut = function () {
playMoreGames.gotoAndStop(1);
};
highscores.onRollOver = function () {
highscores.gotoAndStop(2);
};
highscores.onRollOut = function () {
highscores.gotoAndStop(1);
};
highscores.onPress = function () {
mochi.MochiScores.showLeaderboard({boardID:"a5b1d1307060f7e1", score:score, onClose:function () {
gotoAndStop (4);
}});
};
Instance of Symbol 418 MovieClip [itch2] in Frame 4
on (release) {
getURL ("http://itch.com/?source=fg_26", "_self");
}
Frame 5
function startingStats() {
_quality = "Best";
mech_level = 1;
friction = 0.7;
speed = 2;
game = 1;
life = 100;
bullet_color = 1;
gunNum = 0;
gunDamage = 1;
bullet_to_shoot = 1;
_xspeed = 0;
_yspeed = 0;
score = 0;
shake = 0;
money = 0;
b_gone = 0;
startBattle = 0;
select = 1;
select2 = 0;
select3 = 0;
select4 = 0;
select5 = 0;
select6 = 0;
setMoveTo = 0;
rotateNum = 0;
rotateNum2 = 0;
rotateNum3 = 0;
rotateNum4 = 0;
removeGamer = 0;
depth = 350000 /* 0x055730 */;
bossDir2 = 2;
bossDir = 1;
depth1 = 350;
delay = 0;
enemiesLeft = 0;
MouseDown = 0;
enemies_alive = 0;
shooting_delay = new Array();
bullet_speed = new Array(6, 3, 10, 10, 6);
gun_length = new Array(20, 30, 30, 30, 30);
shooting_en = new Array();
bullet_accuracy = new Array(0, 10, 3, 0, 0);
enemy_speed = new Array();
enemy_space = new Array();
bullet_x = new Array();
bullet_y = new Array();
bullet_damage = new Array();
bullet_array = new Array();
enemy_x = new Array();
enemy_y = new Array();
enemy_bullet_type = new Array();
enemy_shoot_dir = new Array();
b_speed_array = new Array(25, 25, 25, 75, 25);
enemy_lives = new Array();
enemy_array = new Array();
types_of_en = new Array(1, 2, 3, 3, 1, 4, 4, 5, 5, 1, 6, 6, 7, 8, 1, 8, 9, 9, 10, 1, 10);
score_worth = new Array();
enemys_per_wave = new Array(25, 50, 50, 50, 1, 75, 75, 75, 75, 1, 100, 100, 100, 100, 1, 125, 125, 125, 125, 1, 10000);
enemies_arrive = new Array(40, 50, 50, 40, 2, 45, 40, 40, 35, 2, 40, 40, 35, 35, 2, 35, 35, 30, 27, 2, 20);
level = 0;
enemies_to_add = enemys_per_wave[level];
rate_to_add = enemies_arrive[level];
enemies_on_field = 0;
}
function updatestats() {
values.text = (((((((((((("Score: " + score) + "\t") + "\t") + "Money: ") + money) + "\t") + "\t") + "Wave: ") + (level + 1)) + "\t") + "\t") + "Enemies Left: ") + enemiesLeft;
}
function shaker() {
if (shake == 0) {
} else if (shake == 1) {
shake = shake + 1;
_root._x = _root._x + 3;
_root._y = _root._y + 3;
} else if (shake == 2) {
shake = shake + 1;
_root._y = _root._y - 5;
_root._x = _root._x - 5;
} else if (shake == 3) {
shake = 0;
_root._x = _root._x + 2;
_root._y = _root._y + 2;
}
}
function startGame() {
Mouse.hide();
attachMovie("reticle", "reticle", 1000508);
attachMovie("mechtop", "mechtop", 1000001);
attachMovie("mechbottom", "mechbottom", 1000000);
attachMovie("obstacles", "obstacles", 1000002);
attachMovie("xpbartop", "xpbartop", 1000005);
attachMovie("xpbarbottom", "xpbarbottom", 1000004);
attachMovie("topleft", "topleft", 1000008);
xpbartop._x = 500;
xpbarbottom._y = 10;
xpbartop._y = 10;
xpbarbottom._x = 500;
obstacles._x = Stage.width / 2;
obstacles._y = Stage.height / 2;
mechtop._x = Stage.width / 2;
mechtop._y = Stage.height / 2;
mechbottom._x = Stage.width / 2;
mechbottom._y = Stage.height / 2;
}
function removeGame() {
var _local1 = enemy_array.length;
var _local2 = bullet_array.length;
while (_local1 >= 0) {
_local1--;
enemy_array[_local1].removeMovieClip();
enemy_array.splice(_local1, 1);
enemy_space.splice(_local1, 1);
enemy_speed.splice(_local1, 1);
enemy_bullet_type.splice(_local1, 1);
score_worth.splice(_local1, 1);
enemy_shoot_dir.splice(_local1, 1);
enemy_x.splice(_local1, 1);
enemy_y.splice(_local1, 1);
enemy_lives.splice(_local1, 1);
shooting_en.splice(_local1, 1);
shooting_delay.splice(_local1, 1);
}
while (_local2 >= 0) {
_local2--;
bullet_array[_local2].removeMovieClip();
bullet_array.splice(_local2, 1);
bullet_x.splice(_local2, 1);
bullet_y.splice(_local2, 1);
}
shooting_delay = [];
bullet_speed = [];
gun_length = [];
shooting_en = [];
bullet_accuracy = [];
enemy_speed = [];
enemy_space = [];
bullet_x = [];
bullet_y = [];
bullet_array = [];
enemy_x = [];
enemy_y = [];
enemy_bullet_type = [];
enemy_shoot_dir = [];
b_speed_array = [];
enemy_lives = [];
enemy_array = [];
types_of_en = [];
score_worth = [];
removeGamer = 1;
enemys_per_wave = [];
enemies_arrive = [];
yourArray = [];
level = 0;
enemies_to_add = 0;
rate_to_add = 0;
enemies_on_field = 0;
game = 0;
mechtop.removeMovieClip();
mechbottom.removeMovieClip();
obstacles.removeMovieClip();
xpbartop.removeMovieClip();
xpbarbottom.removeMovieClip();
topleft.removeMovieClip();
values.removeTextField();
}
function onEnterFrame() {
reticle._x = _xmouse;
reticle._y = _ymouse;
if (game == 1) {
mechMovement();
shooting();
bulletGo();
enemy_attack();
enemyGo();
hitTest();
shaker();
updatestats();
}
}
function mechMovement() {
xpbartop._xscale = life;
if (life <= 0) {
removeGame();
music.stop();
hsapi.endGame(level, score, null);
gotoAndStop (6);
}
walking = 0;
rotateNum = 0;
rotateNum4 = 0;
rotateNum2 = 0;
rotateNum3 = 0;
if (Key.isDown(39) || (Key.isDown(68))) {
_xspeed = _xspeed + speed;
walking = 1;
rotateNum = 1;
}
if (Key.isDown(40) || (Key.isDown(83))) {
_yspeed = _yspeed + speed;
walking = 1;
rotateNum2 = 1;
}
if (Key.isDown(37) || (Key.isDown(65))) {
_xspeed = _xspeed - speed;
walking = 1;
rotateNum3 = 1;
}
if (Key.isDown(38) || (Key.isDown(87))) {
_yspeed = _yspeed - speed;
walking = 1;
rotateNum4 = 1;
}
if (walking == 1) {
mechbottom.gotoAndStop(2);
} else {
mechbottom.gotoAndStop(1);
}
if ((rotateNum == 1) && (rotateNum2 == 1)) {
mechbottom._rotation = 45;
} else if ((rotateNum2 == 1) && (rotateNum3 == 1)) {
mechbottom._rotation = 135;
} else if ((rotateNum3 == 1) && (rotateNum4 == 1)) {
mechbottom._rotation = 225;
} else if ((rotateNum4 == 1) && (rotateNum == 1)) {
mechbottom._rotation = 315;
} else if (rotateNum == 1) {
mechbottom._rotation = 0;
} else if (rotateNum2 == 1) {
mechbottom._rotation = 90;
} else if (rotateNum3 == 1) {
mechbottom._rotation = 180;
} else if (rotateNum4 == 1) {
mechbottom._rotation = 270;
}
if (mechtop._x > (Stage.width - 40)) {
mechtop._x = Stage.width - 40;
}
if (mechtop._x < 40) {
mechtop._x = 40;
}
if (mechtop._y > (Stage.height - 40)) {
mechtop._y = Stage.height - 40;
}
if (mechtop._y < 40) {
mechtop._y = 40;
}
_xspeed = _xspeed * friction;
_yspeed = _yspeed * friction;
mechtop._x = mechtop._x + _xspeed;
mechtop._y = mechtop._y + _yspeed;
mechbottom._x = mechtop._x;
mechbottom._y = mechtop._y;
var _local3 = _xmouse - mechtop._x;
var _local1 = _ymouse - mechtop._y;
var _local2 = Math.atan2(_local1, _local3);
mechtop._rotation = (_local2 * 180) / Math.PI;
while (obstacles.inobs.hitTest(mechtop._x + (mechtop.inside._width / 2), mechtop._y, true)) {
mechtop._x = mechtop._x - 1;
}
while (obstacles.inobs.hitTest(mechtop._x - (mechtop.inside._width / 2), mechtop._y, true)) {
mechtop._x = mechtop._x + 1;
}
while (obstacles.inobs.hitTest(mechtop._x, mechtop._y + (mechtop.inside._height / 2), true)) {
mechtop._y = mechtop._y - 1;
}
while (obstacles.inobs.hitTest(mechtop._x, mechtop._y - (mechtop.inside._height / 2), true)) {
mechtop._y = mechtop._y + 1;
}
}
function shooting() {
delay = delay - 1;
if ((MouseDown == 1) && (delay <= 0)) {
if (gunNum == 0) {
pistol.start();
}
if (gunNum == 1) {
ak47.start();
}
if (gunNum == 2) {
rocket.start();
}
if (gunNum == 3) {
sniper.start();
}
if (gunNum == 4) {
shotgun.start();
}
delay = bullet_speed[gunNum];
if (gunNum == 4) {
bullet_MC = attachMovie("bullet1", "bullet" + depth, depth);
bullet_MC.gotoAndStop(bullet_color);
bullet_array.push(bullet_MC);
bullet_MC._rotation = mechtop._rotation;
depth++;
bullet_MC2 = attachMovie("bullet1", "bullet" + depth, depth);
bullet_MC2.gotoAndStop(bullet_color);
bullet_array.push(bullet_MC2);
bullet_MC2._rotation = mechtop._rotation;
depth++;
bullet_MC3 = attachMovie("bullet1", "bullet" + depth, depth);
bullet_MC3.gotoAndStop(bullet_color);
bullet_array.push(bullet_MC3);
bullet_MC3._rotation = mechtop._rotation;
depth++;
if (bullet_to_shoot == 1) {
bullet_to_shoot = 2;
bullet_MC._rotation = bullet_MC._rotation + 35;
bullet_MC2._rotation = bullet_MC2._rotation + 35;
bullet_MC3._rotation = bullet_MC3._rotation + 35;
} else if (bullet_to_shoot == 2) {
bullet_to_shoot = 1;
bullet_MC._rotation = bullet_MC._rotation - 35;
bullet_MC2._rotation = bullet_MC2._rotation - 35;
bullet_MC3._rotation = bullet_MC3._rotation - 35;
}
GBMC = attachMovie("gunblast", "gunblast" + depth, depth);
depth++;
GBMC._rotation = mechtop._rotation;
var _local2 = bullet_MC._rotation;
bullet_MC._x = mechtop._x + (gun_length[gunNum] * Math.cos((_local2 * Math.PI) / 180));
bullet_MC._y = mechtop._y + (gun_length[gunNum] * Math.sin((_local2 * Math.PI) / 180));
bullet_MC2._x = mechtop._x + (gun_length[gunNum] * Math.cos((_local2 * Math.PI) / 180));
bullet_MC2._y = mechtop._y + (gun_length[gunNum] * Math.sin((_local2 * Math.PI) / 180));
bullet_MC3._x = mechtop._x + (gun_length[gunNum] * Math.cos((_local2 * Math.PI) / 180));
bullet_MC3._y = mechtop._y + (gun_length[gunNum] * Math.sin((_local2 * Math.PI) / 180));
GBMC._x = bullet_MC._x;
GBMC._y = bullet_MC._y;
bullet_MC2._rotation = bullet_MC2._rotation + 5;
bullet_MC3._rotation = bullet_MC3._rotation - 5;
if (bullet_to_shoot == 1) {
bullet_MC._rotation = bullet_MC._rotation + 35;
bullet_MC2._rotation = bullet_MC2._rotation + 35;
bullet_MC3._rotation = bullet_MC3._rotation + 35;
} else if (bullet_to_shoot == 2) {
bullet_MC._rotation = bullet_MC._rotation - 35;
bullet_MC2._rotation = bullet_MC2._rotation - 35;
bullet_MC3._rotation = bullet_MC3._rotation - 35;
}
var _local4 = Math.cos((bullet_MC._rotation * Math.PI) / 180) * b_speed_array[gunNum];
var _local3 = Math.sin((bullet_MC._rotation * Math.PI) / 180) * b_speed_array[gunNum];
bullet_x.push(_local4);
bullet_y.push(_local3);
_local4 = Math.cos((bullet_MC2._rotation * Math.PI) / 180) * b_speed_array[gunNum];
_local3 = Math.sin((bullet_MC2._rotation * Math.PI) / 180) * b_speed_array[gunNum];
bullet_x.push(_local4);
bullet_y.push(_local3);
_local4 = Math.cos((bullet_MC3._rotation * Math.PI) / 180) * b_speed_array[gunNum];
_local3 = Math.sin((bullet_MC3._rotation * Math.PI) / 180) * b_speed_array[gunNum];
bullet_x.push(_local4);
bullet_y.push(_local3);
} else {
bullet_MC = attachMovie("bullet1", "bullet" + depth, depth);
bullet_MC.gotoAndStop(bullet_color);
bullet_array.push(bullet_MC);
depth++;
bullet_MC._rotation = mechtop._rotation;
GBMC = attachMovie("gunblast", "gunblast" + depth, depth);
depth++;
if (bullet_to_shoot == 1) {
bullet_to_shoot = 2;
bullet_MC._rotation = bullet_MC._rotation + 35;
} else if (bullet_to_shoot == 2) {
bullet_to_shoot = 1;
bullet_MC._rotation = bullet_MC._rotation - 35;
}
GBMC._rotation = mechtop._rotation;
var _local2 = bullet_MC._rotation;
bullet_MC._x = mechtop._x + (gun_length[gunNum] * Math.cos((_local2 * Math.PI) / 180));
bullet_MC._y = mechtop._y + (gun_length[gunNum] * Math.sin((_local2 * Math.PI) / 180));
GBMC._x = bullet_MC._x;
GBMC._y = bullet_MC._y;
bullet_MC._rotation = bullet_MC._rotation + randRange(-bullet_accuracy[gunNum], bullet_accuracy[gunNum]);
if (bullet_to_shoot == 1) {
bullet_MC._rotation = bullet_MC._rotation + 35;
} else if (bullet_to_shoot == 2) {
bullet_MC._rotation = bullet_MC._rotation - 35;
}
var _local4 = Math.cos((bullet_MC._rotation * Math.PI) / 180) * b_speed_array[gunNum];
var _local3 = Math.sin((bullet_MC._rotation * Math.PI) / 180) * b_speed_array[gunNum];
bullet_x.push(_local4);
bullet_y.push(_local3);
}
GBMC.onEnterFrame = function () {
if (removeGamer == 1) {
this.removeMovieClip();
}
if (game == 1) {
this._alpha = this._alpha - 30;
if (this._alpha < 0) {
this.removeMovieClip();
}
}
};
}
}
function bulletGo() {
var _local1 = bullet_array.length;
while (_local1 > 0) {
_local1 = _local1 - 1;
bullet_array[_local1]._x = bullet_array[_local1]._x + bullet_x[_local1];
bullet_array[_local1]._y = bullet_array[_local1]._y + bullet_y[_local1];
if (bullet_array[_local1]._x > Stage.width) {
bullet_array[_local1].removeMovieClip();
bullet_array.splice(_local1, 1);
bullet_x.splice(_local1, 1);
bullet_y.splice(_local1, 1);
}
if (bullet_array[_local1]._x < 0) {
bullet_array[_local1].removeMovieClip();
bullet_array.splice(_local1, 1);
bullet_x.splice(_local1, 1);
bullet_y.splice(_local1, 1);
}
if (bullet_array[_local1]._y > Stage.height) {
bullet_array[_local1].removeMovieClip();
bullet_array.splice(_local1, 1);
bullet_x.splice(_local1, 1);
bullet_y.splice(_local1, 1);
}
if (bullet_array[_local1]._y < 0) {
bullet_array[_local1].removeMovieClip();
bullet_array.splice(_local1, 1);
bullet_x.splice(_local1, 1);
bullet_y.splice(_local1, 1);
}
if (obstacles.inobs.hitTest(bullet_array[_local1]._x, bullet_array[_local1]._y, true)) {
if (gunNum == 2) {
sparkMC = attachMovie("boom3", "boom" + depth, depth);
} else {
sparkMC = attachMovie("spark", "spark" + depth, depth);
}
depth++;
sparkMC._x = bullet_array[_local1]._x;
sparkMC._y = bullet_array[_local1]._y;
sparkMC._rotation = bullet_array[_local1]._rotation + 180;
bullet_array[_local1].removeMovieClip();
bullet_array.splice(_local1, 1);
bullet_x.splice(_local1, 1);
bullet_y.splice(_local1, 1);
}
}
}
function enemyGo() {
var _local2 = enemy_array.length;
while (_local2 > 0) {
_local2 = _local2 - 1;
var _local3 = enemy_array.length;
while (_local3 > 0) {
_local3 = _local3 - 1;
if (enemy_array[_local2].hitTest(enemy_array[_local3]) && (startBattle == 0)) {
if (enemy_array[_local3].hitTest(enemy_array[_local2]._x + (enemy_array[_local2]._width / 2), enemy_array[_local2]._y, true)) {
enemy_array[_local2]._x = enemy_array[_local2]._x - 1;
}
if (enemy_array[_local3].hitTest(enemy_array[_local2]._x - (enemy_array[_local2]._width / 2), enemy_array[_local2]._y, true)) {
enemy_array[_local2]._x = enemy_array[_local2]._x + 1;
}
if (enemy_array[_local3].hitTest(enemy_array[_local2]._x, enemy_array[_local2]._y + (enemy_array[_local2]._height / 2), true)) {
enemy_array[_local2]._y = enemy_array[_local2]._y - 1;
}
if (enemy_array[_local3].hitTest(enemy_array[_local2]._x, enemy_array[_local2]._y - (enemy_array[_local2]._height / 2), true)) {
enemy_array[_local2]._y = enemy_array[_local2]._y + 1;
}
}
}
shooting_delay[_local2] = shooting_delay[_local2] - 1;
if (enemy_array[_local2].hitTest(mechtop.hitmech) && (startBattle == 0)) {
life = life - 5;
enemy_expload.start();
mechtop.gotoAndStop(2);
if (shake == 0) {
shake = 1;
}
if ((enemy_array[_local2]._x > 80) && (enemy_array[_local2]._x < 560)) {
DMC = attachMovie("aa2", "death" + depth1, depth1);
DMC._x = enemy_array[_local2]._x;
DMC._y = enemy_array[_local2]._y;
DMC.onEnterFrame = function () {
if (removeGamer == 1) {
this.removeMovieClip();
}
};
depth1++;
}
EMC = attachMovie("explosion", "explosion" + depth, depth);
depth++;
EMC._x = enemy_array[_local2]._x;
EMC._y = enemy_array[_local2]._y;
enemies_alive = enemies_alive - 1;
enemy_array[_local2].removeMovieClip();
enemy_array.splice(_local2, 1);
enemy_space.splice(_local2, 1);
enemy_speed.splice(_local2, 1);
enemy_bullet_type.splice(_local2, 1);
score_worth.splice(_local2, 1);
enemy_shoot_dir.splice(_local2, 1);
enemy_x.splice(_local2, 1);
enemy_y.splice(_local2, 1);
enemy_lives.splice(_local2, 1);
shooting_en.splice(_local2, 1);
shooting_delay.splice(_local2, 1);
}
if (((level == 4) || (level == 14)) || (level == 19)) {
var _local7 = randRange(1, 5);
} else {
var _local7 = 1;
}
if (((shooting_en[_local2] == 1) && (shooting_delay[_local2] <= 0)) && (_local7 == 1)) {
shooting_delay[_local2] = enemy_speed[_local2];
if (enemy_bullet_type[_local2] == 1) {
bullet_MC = attachMovie("bullet1", "bullet" + depth, depth);
var b_num = 1;
var damages = 3;
}
if (enemy_bullet_type[_local2] == 2) {
bullet_MC = attachMovie("bullet2", "bullet" + depth, depth);
var b_num = 2;
var damages = 5;
}
if (enemy_bullet_type[_local2] == 3) {
bullet_MC = attachMovie("bullet1", "bullet" + depth, depth);
bullet_MC.gotoAndStop(3);
var b_num = 3;
var damages = 0.5;
}
depth++;
bullet_MC._rotation = enemy_array[_local2]._rotation;
if (level != 19) {
if (enemy_shoot_dir[_local2] == 1) {
enemy_shoot_dir[_local2] = 2;
bullet_MC._rotation = bullet_MC._rotation + 35;
} else if (enemy_shoot_dir[_local2] == 2) {
enemy_shoot_dir[_local2] = 1;
bullet_MC._rotation = bullet_MC._rotation - 35;
}
} else if (enemy_shoot_dir[_local2] == 1) {
bullet_MC._rotation = bullet_MC._rotation + 100;
} else if (enemy_shoot_dir[_local2] == 2) {
bullet_MC._rotation = bullet_MC._rotation - 100;
} else if (enemy_shoot_dir[_local2] == 3) {
bullet_MC._rotation = bullet_MC._rotation + 50;
} else if (enemy_shoot_dir[_local2] == 4) {
bullet_MC._rotation = bullet_MC._rotation - 50;
} else if (enemy_shoot_dir[_local2] == 5) {
bullet_MC._rotation = bullet_MC._rotation + 15;
} else if (enemy_shoot_dir[_local2] == 6) {
bullet_MC._rotation = bullet_MC._rotation - 15;
}
bullet_MC._x = enemy_array[_local2]._x - (enemy_space[_local2] * Math.cos((bullet_MC._rotation * Math.PI) / 180));
bullet_MC._y = enemy_array[_local2]._y - (enemy_space[_local2] * Math.sin((bullet_MC._rotation * Math.PI) / 180));
depth++;
GBMC = attachMovie("gunblast2", "gunblast" + depth, depth);
depth++;
GBMC._rotation = enemy_array[_local2]._rotation;
if (level != 19) {
if (enemy_shoot_dir[_local2] == 1) {
bullet_MC._rotation = bullet_MC._rotation + 35;
} else if (enemy_shoot_dir[_local2] == 2) {
bullet_MC._rotation = bullet_MC._rotation - 35;
}
} else if (enemy_shoot_dir[_local2] == 1) {
enemy_shoot_dir[_local2] = 2;
bullet_MC._rotation = bullet_MC._rotation - 100;
} else if (enemy_shoot_dir[_local2] == 2) {
enemy_shoot_dir[_local2] = 3;
bullet_MC._rotation = bullet_MC._rotation + 100;
} else if (enemy_shoot_dir[_local2] == 3) {
enemy_shoot_dir[_local2] = 4;
bullet_MC._rotation = bullet_MC._rotation - 50;
} else if (enemy_shoot_dir[_local2] == 4) {
enemy_shoot_dir[_local2] = 5;
bullet_MC._rotation = bullet_MC._rotation + 50;
} else if (enemy_shoot_dir[_local2] == 5) {
enemy_shoot_dir[_local2] = 6;
bullet_MC._rotation = bullet_MC._rotation - 15;
} else if (enemy_shoot_dir[_local2] == 6) {
enemy_shoot_dir[_local2] = 1;
bullet_MC._rotation = bullet_MC._rotation + 15;
}
GBMC._x = bullet_MC._x;
GBMC._y = bullet_MC._y;
bullet_MC._rotation = bullet_MC._rotation + 180;
GBMC.onEnterFrame = function () {
if (removeGamer == 1) {
this.removeMovieClip();
}
this._alpha = this._alpha - 30;
if (this._alpha <= 0) {
this.removeMovieClip();
}
};
if (level == 19) {
var damages = 8;
} else if (level == 14) {
var damages = 5;
} else {
var damages = 3;
}
var dirx = ((-Math.cos((enemy_array[_local2]._rotation * Math.PI) / 180)) * 6);
var diry = ((-Math.sin((enemy_array[_local2]._rotation * Math.PI) / 180)) * 6);
bullet_MC.onEnterFrame = function () {
if (removeGamer == 1) {
this.removeMovieClip();
}
if (b_gone == 1) {
this.removeMovieClip();
}
if (level == 9) {
this._x = enemy_array[0]._x;
this._y = enemy_array[0]._y;
if (mechtop.inside.hitTest(this)) {
trace(damages);
life = life - damages;
EMC = attachMovie("spark", "explosion" + depth, depth);
depth++;
EMC._x = mechtop._x;
EMC._y = mechtop._y;
EMC._rotation = this._rotation;
mechtop.gotoAndStop(2);
}
} else if (game == 1) {
this._x = this._x + dirx;
this._y = this._y + diry;
if (obstacles.inobs.hitTest(this._x, this._y, true)) {
if (b_num == 2) {
BOOM = attachMovie("boom3", "boom" + depth, depth);
depth++;
BOOM._x = this._x;
BOOM._y = this._y;
}
if (b_num == 1) {
EMC = attachMovie("spark", "explosion" + depth, depth);
depth++;
EMC._x = this._x;
EMC._y = this._y;
EMC._rotation = this._rotation;
}
this.removeMovieClip();
}
if (mechtop.inside.hitTest(this._x, this._y, true)) {
if (b_num == 2) {
life = life - damages;
trace(damages);
BOOM = attachMovie("boom3", "boom" + depth, depth);
depth++;
BOOM._x = mechtop._x;
BOOM._y = mechtop._y;
}
if (b_num == 1) {
life = life - damages;
trace(damages);
EMC = attachMovie("spark", "explosion" + depth, depth);
depth++;
EMC._x = mechtop._x;
EMC._y = mechtop._y;
EMC._rotation = this._rotation;
}
mechtop.gotoAndStop(2);
this.removeMovieClip();
}
if ((((this._x > Stage.width) || (this._x < 0)) || (this._y > Stage.height)) || (this._y < 0)) {
this.removeMovieClip();
}
}
};
}
if (startBattle == 0) {
enemy_array[_local2]._x = enemy_array[_local2]._x + enemy_x[_local2];
enemy_array[_local2]._y = enemy_array[_local2]._y + enemy_y[_local2];
var _local6 = enemy_array[_local2]._x - mechtop._x;
var _local4 = enemy_array[_local2]._y - mechtop._y;
var _local5 = Math.atan2(_local4, _local6);
enemy_array[_local2]._rotation = (_local5 * 180) / Math.PI;
enemy_x[_local2] = (-Math.cos((enemy_array[_local2]._rotation * Math.PI) / 180)) * 3;
enemy_y[_local2] = (-Math.sin((enemy_array[_local2]._rotation * Math.PI) / 180)) * 3;
}
while (obstacles.inobs.hitTest(enemy_array[_local2]._x + (enemy_array[_local2]._width / 2), enemy_array[_local2]._y, true)) {
enemy_array[_local2]._x = enemy_array[_local2]._x - 1;
}
while (obstacles.inobs.hitTest(enemy_array[_local2]._x - (enemy_array[_local2]._width / 2), enemy_array[_local2]._y, true)) {
enemy_array[_local2]._x = enemy_array[_local2]._x + 1;
}
while (obstacles.inobs.hitTest(enemy_array[_local2]._x, enemy_array[_local2]._y + (enemy_array[_local2]._height / 2), true)) {
enemy_array[_local2]._y = enemy_array[_local2]._y - 1;
}
while (obstacles.inobs.hitTest(enemy_array[_local2]._x, enemy_array[_local2]._y - (enemy_array[_local2]._height / 2), true)) {
enemy_array[_local2]._y = enemy_array[_local2]._y + 1;
}
}
}
function hitTest() {
var _local2 = enemy_array.length;
var _local3 = bullet_array.length;
while (_local2 > 0) {
_local2 = _local2 - 1;
_local3 = bullet_array.length;
while (_local3 > 0) {
_local3 = _local3 - 1;
if (enemy_array[_local2].hitTest(bullet_array[_local3])) {
enemy_lives[_local2] = enemy_lives[_local2] - gunDamage;
if ((gunNum == 2) && (enemy_lives[_local2] > 0)) {
sparkMC = attachMovie("boom3", "boom" + depth, depth);
} else if (enemy_lives[_local2] > 0) {
sparkMC = attachMovie("spark", "spark" + depth, depth);
}
depth++;
sparkMC._x = bullet_array[_local3]._x;
sparkMC._y = bullet_array[_local3]._y;
sparkMC._rotation = bullet_array[_local3]._rotation + 180;
bullet_array[_local3].removeMovieClip();
bullet_array.splice(_local3, 1);
bullet_x.splice(_local3, 1);
bullet_y.splice(_local3, 1);
enemy_array[_local2].gotoAndStop(2);
enemy_array[_local2].inside.gotoAndPlay(1);
if (enemy_lives[_local2] <= 0) {
score = score + score_worth[_local2];
if (shake == 0) {
shake = 1;
}
if ((enemy_array[_local2]._x > 80) && (enemy_array[_local3]._x < 560)) {
DMC = attachMovie("aa2", "death" + depth1, depth1);
DMC._x = enemy_array[_local2]._x;
DMC._y = enemy_array[_local2]._y;
DMC.onEnterFrame = function () {
if (removeGamer == 1) {
this.removeMovieClip();
}
};
depth1++;
var _local4 = randRange(1, 2);
if (_local4 == 1) {
CMC = attachMovie("coin", "coin" + depth1, depth1);
CMC._x = randRange(100, 540);
CMC._y = randRange(30, 450);
depth1++;
}
CMC.onEnterFrame = function () {
if (removeGamer == 1) {
this.removeMovieClip();
}
if (game == 1) {
if (this.hitTest(mechtop.inside)) {
this.removeMovieClip();
money_collect.start();
money = money + (randRange(1, 5) * (level + 1));
}
}
if (game == 0) {
this.gotoAndStop(1);
}
};
}
EMC = attachMovie("explosion", "explosion" + depth, depth);
depth++;
enemies_alive = enemies_alive - 1;
EMC._x = enemy_array[_local2]._x;
EMC._y = enemy_array[_local2]._y;
enemy_array[_local2].removeMovieClip();
if ((((level == 4) || (level == 9)) || (level == 14)) || (level == 19)) {
boss_expload.start();
} else {
enemy_expload.start();
}
enemy_array.splice(_local2, 1);
enemy_space.splice(_local2, 1);
enemy_speed.splice(_local2, 1);
enemy_bullet_type.splice(_local2, 1);
score_worth.splice(_local2, 1);
enemy_shoot_dir.splice(_local2, 1);
enemy_x.splice(_local2, 1);
enemy_y.splice(_local2, 1);
enemy_lives.splice(_local2, 1);
shooting_en.splice(_local2, 1);
shooting_delay.splice(_local2, 1);
}
}
}
}
}
function enemy_attack() {
rate_to_add = rate_to_add - 1;
enemiesLeft = enemies_to_add - enemies_on_field;
if (((enemies_alive == 0) && (enemies_to_add <= enemies_on_field)) && (removeGamer == 0)) {
var _local2 = bullet_array.length;
while (_local2 >= 0) {
_local2--;
bullet_array[_local2].removeMovieClip();
bullet_array.splice(_local2, 1);
bullet_x.splice(_local2, 1);
bullet_y.splice(_local2, 1);
}
b_gone = 1;
level = level + 1;
mechbottom.gotoAndStop(1);
mechbottom._x = mechtop._x;
mechbottom._y = mechtop._y;
startBattle = 0;
game = 0;
if (level == 19) {
obstacles.removeMovieClip();
attachMovie("explosion", "explosion1", depth);
depth++;
explosion1._x = Stage.width / 2;
explosion1._y = 100;
obstacles.removeMovieClip();
attachMovie("explosion", "explosion2", depth);
depth++;
explosion2._x = (Stage.width / 2) + 200;
explosion2._y = 100;
obstacles.removeMovieClip();
attachMovie("explosion", "explosion3", depth);
depth++;
explosion3._x = Stage.width / 2;
explosion3._y = 380;
obstacles.removeMovieClip();
attachMovie("explosion", "explosion4", depth);
depth++;
explosion4._x = (Stage.width / 2) + 200;
explosion4._y = 380;
}
attachMovie("shadowa", "shadowa", 1000201);
shadowa._x = Stage.width / 2;
shadowa._y = Stage.height / 2;
attachMovie("info", "info", 1000301);
info._x = Stage.width / 2;
info._y = Stage.height / 2;
if (select == 1) {
shadowa.inside1.gotoAndStop(2);
}
if (select2 == 1) {
shadowa.inside2.gotoAndStop(2);
}
if (select3 == 1) {
shadowa.inside3.gotoAndStop(2);
}
if (select4 == 1) {
shadowa.inside4.gotoAndStop(2);
}
if (select5 == 1) {
shadowa.inside5.gotoAndStop(2);
}
shadowa.inside1.onRollOver = function () {
shadowa.inside1.gotoAndStop(2);
};
shadowa.inside1.onRollOut = function () {
if (select != 1) {
shadowa.inside1.gotoAndStop(1);
}
};
shadowa.inside1.onPress = function () {
shadowa.inside1.gotoAndStop(2);
select = 1;
};
shadowa.done.onPress = function () {
shadowa.removeMovieClip();
info.removeMovieClip();
bg.removeMovieClip();
b_gone = 0;
game = 1;
};
shadowa.inside2.onRollOver = function () {
shadowa.inside2.gotoAndStop(2);
};
shadowa.inside2.onRollOut = function () {
if (select2 != 1) {
shadowa.inside2.gotoAndStop(1);
}
};
shadowa.inside2.onPress = function () {
if ((money >= 50) && (select2 != 1)) {
gun_select.start();
money = money - 50;
updatestats();
shadowa.inside2.gotoAndStop(2);
select2 = 1;
}
};
shadowa.inside3.onPress = function () {
if ((money >= 200) && (select3 != 1)) {
gun_select.start();
money = money - 200;
updatestats();
shadowa.inside3.gotoAndStop(2);
select3 = 1;
}
};
shadowa.inside4.onPress = function () {
if ((money >= 800) && (select4 != 1)) {
gun_select.start();
money = money - 800;
updatestats();
shadowa.inside4.gotoAndStop(2);
select4 = 1;
}
};
shadowa.inside5.onPress = function () {
if ((money >= 3000) && (select5 != 1)) {
gun_select.start();
money = money - 3000;
updatestats();
shadowa.inside5.gotoAndStop(2);
select5 = 1;
}
};
shadowa.inside6.onPress = function () {
if (money >= 50) {
gun_select.start();
money = money - 50;
if (life <= 90) {
life = life + 10;
} else {
life = 100;
}
updatestats();
xpbartop._xscale = life;
shadowa.inside6.gotoAndStop(2);
}
};
shadowa.inside3.onRollOver = function () {
shadowa.inside3.gotoAndStop(2);
};
shadowa.inside3.onRollOut = function () {
if (select3 != 1) {
shadowa.inside3.gotoAndStop(1);
}
};
shadowa.inside4.onRollOver = function () {
shadowa.inside4.gotoAndStop(2);
};
shadowa.inside4.onRollOut = function () {
if (select4 != 1) {
shadowa.inside4.gotoAndStop(1);
}
};
shadowa.inside5.onRollOver = function () {
shadowa.inside5.gotoAndStop(2);
};
shadowa.inside5.onRollOut = function () {
if (select5 != 1) {
shadowa.inside5.gotoAndStop(1);
}
};
shadowa.inside6.onRollOver = function () {
shadowa.inside6.gotoAndStop(2);
};
shadowa.inside6.onRollOut = function () {
if (select6 != 1) {
shadowa.inside6.gotoAndStop(1);
}
};
enemies_to_add = enemys_per_wave[level];
rate_to_add = enemies_arrive[level];
enemies_on_field = 0;
if ((((level != 4) && (level != 9)) && (level != 14)) && (level != 19)) {
EW = attachMovie("endwave", "endwave", 1001007);
if (level == 20) {
EW.gotoAndStop(2);
}
} else {
EW = attachMovie("bosslevel", "endwave", 1001007);
}
EW._x = Stage.width / 2;
EW._y = Stage.height / 2;
EW.onEnterFrame = function () {
this._alpha = this._alpha - 1;
if (this._alpha < 0) {
this.removeMovieClip();
}
};
}
if (((((((enemies_to_add > enemies_on_field) && (rate_to_add < 0)) && (enemies_alive < 20)) && (level != 4)) && (level != 9)) && (level != 14)) && (level != 19)) {
rate_to_add = enemies_arrive[level];
enemies_on_field = enemies_on_field + 1;
enemies_alive = enemies_alive + 1;
var _local3 = randRange(1, types_of_en[level]);
if (_local3 == 1) {
enemy_MC = attachMovie("enemy1", "enemy" + depth, depth);
enemy_space.push(0);
enemy_speed.push(0);
shooting_en.push(0);
shooting_delay.push(0);
enemy_shoot_dir.push(0);
enemy_bullet_type.push(0);
enemy_lives.push(3);
score_worth.push(3);
}
if (_local3 == 2) {
enemy_MC = attachMovie("enemy2", "enemy" + depth, depth);
enemy_space.push(0);
enemy_speed.push(0);
shooting_en.push(0);
shooting_delay.push(0);
enemy_shoot_dir.push(0);
enemy_bullet_type.push(0);
enemy_lives.push(5);
score_worth.push(5);
}
if (_local3 == 3) {
enemy_space.push(40);
enemy_MC = attachMovie("enemy3", "enemy" + depth, depth);
enemy_speed.push(30);
shooting_en.push(1);
shooting_delay.push(15);
enemy_shoot_dir.push(1);
enemy_bullet_type.push(1);
enemy_lives.push(3);
score_worth.push(7);
}
if (_local3 == 4) {
enemy_space.push(40);
enemy_MC = attachMovie("enemy4", "enemy" + depth, depth);
enemy_speed.push(30);
shooting_en.push(1);
shooting_delay.push(8);
enemy_shoot_dir.push(1);
enemy_bullet_type.push(2);
enemy_lives.push(5);
score_worth.push(7);
}
if (_local3 == 5) {
enemy_space.push(40);
enemy_MC = attachMovie("enemy5", "enemy" + depth, depth);
enemy_speed.push(30);
shooting_en.push(1);
shooting_delay.push(20);
enemy_shoot_dir.push(1);
enemy_bullet_type.push(1);
enemy_lives.push(8);
score_worth.push(10);
}
if (_local3 == 6) {
enemy_space.push(40);
enemy_MC = attachMovie("enemy6", "enemy" + depth, depth);
enemy_speed.push(30);
shooting_en.push(1);
shooting_delay.push(20);
enemy_shoot_dir.push(1);
enemy_bullet_type.push(2);
enemy_lives.push(11);
score_worth.push(13);
}
if (_local3 == 7) {
enemy_space.push(60);
enemy_MC = attachMovie("enemy7", "enemy" + depth, depth);
enemy_speed.push(30);
shooting_en.push(1);
shooting_delay.push(20);
enemy_shoot_dir.push(1);
enemy_bullet_type.push(2);
enemy_lives.push(14);
score_worth.push(17);
}
if (_local3 == 8) {
enemy_space.push(30);
enemy_MC = attachMovie("enemy8", "enemy" + depth, depth);
enemy_speed.push(30);
shooting_en.push(1);
shooting_delay.push(20);
enemy_shoot_dir.push(1);
enemy_bullet_type.push(1);
enemy_lives.push(17);
score_worth.push(20);
}
if (_local3 == 9) {
enemy_space.push(0);
enemy_MC = attachMovie("enemy9", "enemy" + depth, depth);
enemy_speed.push(30);
shooting_en.push(1);
shooting_delay.push(20);
enemy_shoot_dir.push(1);
enemy_bullet_type.push(1);
enemy_lives.push(20);
score_worth.push(23);
}
if (_local3 == 10) {
enemy_space.push(60);
enemy_MC = attachMovie("enemy10", "enemy" + depth, depth);
enemy_speed.push(30);
shooting_en.push(1);
shooting_delay.push(20);
enemy_shoot_dir.push(1);
enemy_bullet_type.push(1);
enemy_lives.push(23);
score_worth.push(27);
}
enemy_array.push(enemy_MC);
depth++;
var _local4 = randRange(1, 2);
if (_local4 == 1) {
enemy_MC._x = -enemy_MC._width;
enemy_MC._y = randRange(0, 480);
}
if (_local4 == 2) {
enemy_MC._x = Stage.width + enemy_MC._width;
enemy_MC._y = randRange(0, 480);
}
var _local7 = enemy_MC._x - mechtop._x;
var _local5 = enemy_MC._y - mechtop._y;
var _local6 = Math.atan2(_local5, _local7);
enemy_MC._rotation = (_local6 * 180) / Math.PI;
var _local9 = Math.cos((enemy_MC._rotation * Math.PI) / 180) * 3;
var _local8 = Math.sin((enemy_MC._rotation * Math.PI) / 180) * 3;
enemy_x.push(-_local9);
enemy_y.push(-_local8);
} else if ((((level == 4) || (level == 9)) || (level == 14)) || (level == 19)) {
bossBattle();
}
}
function bossBattle() {
if (startBattle == 0) {
if (level == 4) {
Boss = attachMovie("boss1", "boss" + depth, depth);
enemy_bullet_type.push(1);
enemy_space.push(100);
shooting_delay.push(3);
enemy_speed.push(3);
enemy_lives.push(300);
}
if (level == 9) {
Boss = attachMovie("boss2", "boss" + depth, depth);
enemy_bullet_type.push(3);
enemy_space.push(0);
shooting_delay.push(100);
enemy_speed.push(100);
enemy_lives.push(700);
}
if (level == 14) {
Boss = attachMovie("boss3", "boss" + depth, depth);
enemy_bullet_type.push(1);
enemy_space.push(100);
shooting_delay.push(3);
enemy_speed.push(3);
enemy_lives.push(1500);
}
if (level == 19) {
Boss = attachMovie("boss4", "boss" + depth, depth);
enemy_bullet_type.push(1);
enemy_space.push(100);
shooting_delay.push(3);
enemy_speed.push(3);
enemy_lives.push(3000);
}
Boss._x = -(Boss._width / 2);
Boss._y = Stage.height / 2;
Boss._rotation = Boss._rotation + 180;
depth++;
startBattle = 1;
shooting_en.push(1);
enemy_shoot_dir.push(1);
score_worth.push(100);
enemy_array.push(Boss);
enemy_x.push(0);
enemy_y.push(0);
bossDir = 1;
enemies_on_field = enemies_on_field + 1;
enemies_alive = enemies_alive + 1;
}
if (mechtop._x < 200) {
mechtop._x = 200;
}
if (Boss._x < 100) {
Boss._x = Boss._x + 1;
} else {
Boss._x = 100;
}
if (Boss2._x > 540) {
Boss2._x = Boss2._x - 1;
} else {
Boss2._x = 540;
}
if (bossDir == 1) {
Boss._y = Boss._y + 3;
if (Boss._y > 400) {
bossDir = 2;
}
}
if (bossDir == 2) {
Boss._y = Boss._y - 3;
if (Boss._y < 80) {
bossDir = 1;
}
}
if (bossDir2 == 1) {
Boss2._y = Boss2._y + 5;
if (Boss2._y > 400) {
bossDir2 = 2;
}
}
if (bossDir2 == 2) {
Boss2._y = Boss2._y - 5;
if (Boss2._y < 80) {
bossDir2 = 1;
}
}
}
function randRange(smallNum, bigNum) {
return(Math.floor(Math.random() * ((bigNum - smallNum) + 1)) + smallNum);
}
stop();
var my_sound = new Sound();
my_sound.loadSound("song3.mp3", true);
hsapi.startGame("Default", 1, 0, null);
var ak47 = new Sound();
ak47.attachSound("ak47");
ak47.setVolume(50);
boss_expload = new Sound();
boss_expload.attachSound("boss_expload");
boss_expload.setVolume(50);
var enemy_expload = new Sound();
enemy_expload.attachSound("enemy_expload");
enemy_expload.setVolume(30);
pistol = new Sound();
pistol.attachSound("pistol");
pistol.setVolume(50);
rocket_en = new Sound();
rocket_en.attachSound("rocket_en");
rocket_en.setVolume(50);
rocket = new Sound();
rocket.attachSound("rocket");
rocket.setVolume(50);
shotgun = new Sound();
shotgun.attachSound("shotgun");
shotgun.setVolume(50);
sniper = new Sound();
sniper.attachSound("sniper");
sniper.setVolume(50);
menu_press = new Sound();
menu_press.attachSound("menu_press");
menu_press.setVolume(50);
gun_select = new Sound();
gun_select.attachSound("gun_select");
gun_select.setVolume(50);
money_collect = new Sound();
money_collect.attachSound("money_collect");
money_collect.setVolume(50);
music = new Sound();
music.attachSound("music");
music.start(0, 99);
var my_txt = new TextFormat();
my_txt.bold = true;
my_txt.font = "Arial";
my_txt.size = 12;
my_txt.color = 16777215 /* 0xFFFFFF */;
this.createTextField("values", 1000007, 15, 2, 550, 30);
values.setNewTextFormat(my_txt);
values.selectable = true;
values.tabStops = [100, 300, 300, 400];
startGame();
startingStats();
updatestats();
keyListener = new Object();
keyListener.onKeyDown = function () {
num = Key.getAscii();
if (num == 49) {
mechtop.gun.gotoAndStop(1);
bullet_color = 1;
gunNum = 0;
gunDamage = 1;
}
if ((num == 50) && (select2 == 1)) {
mechtop.gun.gotoAndStop(2);
bullet_color = 1;
gunNum = 1;
gunDamage = 1;
}
if ((num == 51) && (select3 == 1)) {
mechtop.gun.gotoAndStop(3);
bullet_color = 2;
gunNum = 2;
gunDamage = 3;
}
if ((num == 52) && (select4 == 1)) {
mechtop.gun.gotoAndStop(4);
bullet_color = 1;
gunNum = 3;
gunDamage = 5;
}
if ((num == 53) && (select5 == 1)) {
mechtop.gun.gotoAndStop(5);
bullet_color = 1;
gunNum = 4;
gunDamage = 2;
}
if ((num == 112) || (num == 32)) {
if (game == 0) {
game = 1;
paused2.removeMovieClip();
} else if (game == 1) {
game = 0;
mechbottom.gotoAndStop(1);
mechbottom._x = mechtop._x;
mechbottom._y = mechtop._y;
attachMovie("paused", "paused2", 1000500);
paused2._x = Stage.width / 2;
paused2._y = Stage.height / 2;
var _local1 = enemy_array.length;
while (_local1 >= 0) {
_local1--;
trace(enemy_array[_local1]);
enemy_array[_local1].gotoAndStop(1);
enemy_array[_local1].inser.insa.gotoAndStop(1);
}
}
}
};
Key.addListener(keyListener);
onMouseDown = function () {
MouseDown = 1;
};
onMouseUp = function () {
MouseDown = 0;
};
Frame 6
stop();
goin.onPress = function () {
gotoAndStop (5);
};
goin2.onPress = function () {
mochi.MochiScores.showLeaderboard({boardID:"a5b1d1307060f7e1", score:score, onClose:function () {
gotoAndStop (4);
}});
gotoAndStop (4);
};
goin3.onPress = function () {
gotoAndStop (4);
};
Frame 7
stop();
tp.onRelease = function () {
gotoAndStop (5);
};
tb.onRelease = function () {
gotoAndStop (4);
};
Symbol 15 MovieClip Frame 20
_parent.gotoAndStop(1);
Symbol 16 MovieClip Frame 1
stop();
Symbol 76 MovieClip [boom3] Frame 29
this.removeMovieClip();
Symbol 88 MovieClip [spark] Frame 23
this.removeMovieClip();
Symbol 95 MovieClip [aa2] Frame 200
this.removeMovieClip();
Symbol 114 MovieClip [endwave] Frame 1
stop();
Symbol 160 MovieClip Frame 20
_parent.gotoAndStop(1);
Symbol 161 MovieClip [enemy4] Frame 1
stop();
Symbol 161 MovieClip [enemy4] Frame 2
stop();
Symbol 168 MovieClip Frame 12
stop();
Symbol 172 Button
on (release) {
gotoAndPlay (2);
_root.music.stop();
}
Symbol 173 MovieClip Frame 11
stop();
Symbol 175 Button
on (release) {
gotoAndPlay (1);
_root.music.start(0, 99);
}
Symbol 176 MovieClip Frame 1
stop();
Symbol 176 MovieClip Frame 2
stop();
Instance of Symbol 180 MovieClip in Symbol 181 MovieClip [sound_contr] Frame 1
onClipEvent (load) {
_root.soundstatus = "on";
_root.mySound = new Sound(_level0);
_root.mySound2 = new Sound(_level1);
_root.mySound3 = new Sound(_level2);
_root.mySound4 = new Sound(_level3);
_root.mySound5 = new Sound(_level4);
maxvolume = 100;
minvolume = 0;
}
onClipEvent (enterFrame) {
if (_root.soundstatus == "on") {
step = 5;
}
if (_root.soundstatus == "off") {
step = -5;
}
maxvolume = maxvolume + step;
if (maxvolume > 100) {
maxvolume = 100;
}
if (maxvolume < 0) {
maxvolume = 0;
}
_root.mySound.setVolume(maxvolume);
_root.mySound2.setVolume(maxvolume);
_root.mySound3.setVolume(maxvolume);
_root.mySound4.setVolume(maxvolume);
_root.mySound5.setVolume(maxvolume);
}
Symbol 196 MovieClip Frame 20
_parent.gotoAndStop(1);
Symbol 197 MovieClip [enemy2] Frame 1
stop();
Symbol 202 MovieClip Frame 20
_parent.gotoAndStop(1);
Symbol 203 MovieClip [enemy1] Frame 1
stop();
Symbol 208 MovieClip Frame 20
_parent.gotoAndStop(1);
Symbol 209 MovieClip [enemy10] Frame 1
stop();
Symbol 213 MovieClip Frame 20
_parent.gotoAndStop(1);
Symbol 214 MovieClip [enemy9] Frame 1
stop();
Symbol 218 MovieClip Frame 20
_parent.gotoAndStop(1);
Symbol 219 MovieClip [enemy8] Frame 1
stop();
Symbol 223 MovieClip Frame 20
_parent.gotoAndStop(1);
Symbol 224 MovieClip [enemy7] Frame 1
stop();
Symbol 228 MovieClip Frame 20
_parent.gotoAndStop(1);
Symbol 229 MovieClip [enemy6] Frame 1
stop();
Symbol 277 MovieClip [info] Frame 200
stop();
Symbol 282 MovieClip Frame 20
_parent.gotoAndStop(1);
Symbol 283 MovieClip [enemy5] Frame 1
stop();
Symbol 304 MovieClip Frame 50
_parent.removeMovieClip();
Symbol 305 MovieClip [bullet1] Frame 1
stop();
Symbol 308 MovieClip [inside6] Frame 1
stop();
Symbol 309 MovieClip [inside5] Frame 1
stop();
Symbol 310 MovieClip [inside4] Frame 1
stop();
Symbol 311 MovieClip [inside3] Frame 1
stop();
Symbol 312 MovieClip [inside2] Frame 1
stop();
Symbol 313 MovieClip [inside1] Frame 1
stop();
Symbol 321 MovieClip [shadowa] Frame 200
stop();
Symbol 325 MovieClip [coin] Frame 300
this.removeMovieClip();
Symbol 372 MovieClip Frame 20
_parent.gotoAndStop(1);
Symbol 373 MovieClip [enemy3] Frame 1
stop();
Symbol 436 MovieClip Frame 1
stop();
Symbol 441 MovieClip Frame 20
_parent.gotoAndStop(1);
Symbol 442 MovieClip [mechtop] Frame 1
stop();
Symbol 442 MovieClip [mechtop] Frame 2
stop();
Symbol 448 MovieClip [play_btn] Frame 1
stop();
Symbol 591 MovieClip [__Packages.mochi.MochiServices] Frame 0
class mochi.MochiServices
{
static var _id, _container, _clip, _sendChannelName, _rcvChannelName, __get__comChannelName, onError, _listenChannel, _rcvChannel, _loader, _loaderListener, _sendChannel;
function MochiServices () {
}
static function get id() {
return(_id);
}
static function get clip() {
return(_container);
}
static function get childClip() {
return(_clip);
}
static function getVersion() {
return("1.32");
}
static function allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function get isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function set comChannelName(val) {
if (val != undefined) {
if (val.length > 3) {
_sendChannelName = val + "_fromgame";
_rcvChannelName = val;
initComChannels();
}
}
//return(__get__comChannelName());
}
static function get connected() {
return(_connected);
}
static function connect(id, clip, onError) {
if ((!_connected) && (_clip == undefined)) {
trace("MochiServices Connecting...");
_connecting = true;
init(id, clip);
}
if (onError != undefined) {
mochi.MochiServices.onError = onError;
} else if (mochi.MochiServices.onError == undefined) {
mochi.MochiServices.onError = function (errorCode) {
trace(errorCode);
};
}
}
static function disconnect() {
if (_connected || (_connecting)) {
_connecting = (_connected = false);
flush(true);
if (_clip != undefined) {
_clip.removeMovieClip();
delete _clip;
}
_listenChannel.close();
_rcvChannel.close();
}
}
static function init(id, clip) {
_id = id;
if (clip != undefined) {
_container = clip;
} else {
_container = _root;
}
loadCommunicator(id, _container);
}
static function loadCommunicator(id, clip) {
var _local2 = "_mochiservices_com_" + id;
if (_clip != null) {
return(_clip);
}
if (!isNetworkAvailable) {
return(null);
}
allowDomains(_gatewayURL);
_clip = clip.createEmptyMovieClip(_local2, 10336, false);
_loader = new MovieClipLoader();
if (_loaderListener.waitInterval != null) {
clearInterval(_loaderListener.waitInterval);
}
_loaderListener = {};
_loaderListener.onLoadError = function (target_mc, errorCode, httpStatus) {
trace("MochiServices could not load.");
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, [errorCode]);
};
_loaderListener.onLoadStart = function (target_mc) {
this.isLoading = true;
};
_loaderListener.startTime = getTimer();
_loaderListener.wait = function () {
if ((getTimer() - this.startTime) > 10000) {
if (!this.isLoading) {
mochi.MochiServices.disconnect();
mochi.MochiServices.onError.apply(null, ["IOError"]);
}
clearInterval(this.waitInterval);
}
};
_loaderListener.waitInterval = setInterval(_loaderListener, "wait", 1000);
_loader.addListener(_loaderListener);
_loader.loadClip(_gatewayURL, _clip);
_sendChannel = new LocalConnection();
_sendChannel._queue = [];
_rcvChannel = new LocalConnection();
_rcvChannel.allowDomain = function (d) {
return(true);
};
_rcvChannel.allowInsecureDomain = _rcvChannel.allowDomain;
_rcvChannel._nextcallbackID = 0;
_rcvChannel._callbacks = {};
listen();
return(_clip);
}
static function onStatus(infoObject) {
if (!(infoObject.level === "error")) {
} else {
_connected = false;
_listenChannel.connect(_listenChannelName);
}
}
static function listen() {
_listenChannel = new LocalConnection();
_listenChannel.handshake = function (args) {
mochi.MochiServices.__set__comChannelName(args.newChannel);
};
_listenChannel.allowDomain = function (d) {
return(true);
};
_listenChannel.allowInsecureDomain = _listenChannel.allowDomain;
_listenChannel.connect(_listenChannelName);
trace("Waiting for MochiAds services to connect...");
}
static function initComChannels() {
if (!_connected) {
_sendChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"handshakeDone"});
_sendChannel.send(_sendChannelName, "onReceive", {methodName:"registerGame", id:_id, clip:_clip, version:getVersion()});
_rcvChannel.onStatus = function (infoObject) {
mochi.MochiServices.onStatus(infoObject);
};
_rcvChannel.onReceive = function (pkg) {
var _local5 = pkg.callbackID;
var _local4 = this._callbacks[_local5];
if (!_local4) {
return(undefined);
}
var _local2 = _local4.callbackMethod;
var _local3 = _local4.callbackObject;
if (_local3 && (typeof(_local2) == "string")) {
_local2 = _local3[_local2];
}
if (_local2 != undefined) {
_local2.apply(_local3, pkg.args);
}
delete this._callbacks[_local5];
};
_rcvChannel.onError = function () {
mochi.MochiServices.onError.apply(null, ["IOError"]);
};
_rcvChannel.connect(_rcvChannelName);
trace("connected!");
_connecting = false;
_connected = true;
_listenChannel.close();
while (_sendChannel._queue.length > 0) {
_sendChannel.send(_sendChannelName, "onReceive", _sendChannel._queue.shift());
}
}
}
static function flush(error) {
var _local1;
var _local2;
while (_sendChannel._queue.length > 0) {
_local1 = _sendChannel._queue.shift();
if (_local1.callbackID != null) {
_local2 = _rcvChannel._callbacks[_local1.callbackID];
}
delete _rcvChannel._callbacks[_local1.callbackID];
if (error) {
handleError(_local1.args, _local2.callbackObject, _local2.callbackMethod);
}
}
}
static function handleError(args, callbackObject, callbackMethod) {
if (args != null) {
if (args.onError != null) {
args.onError.apply(null, ["NotConnected"]);
}
if ((args.options != null) && (args.options.onError != null)) {
args.options.onError.apply(null, ["NotConnected"]);
}
}
if (callbackMethod != null) {
args = {};
args.error = true;
args.errorCode = "NotConnected";
if ((callbackObject != null) && (typeof(callbackMethod) == "string")) {
callbackObject[callbackMethod](args);
} else if (callbackMethod != null) {
callbackMethod.apply(args);
}
}
}
static function send(methodName, args, callbackObject, callbackMethod) {
if (_connected) {
_sendChannel.send(_sendChannelName, "onReceive", {methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
} else {
if ((_clip == undefined) || (!_connecting)) {
onError.apply(null, ["NotConnected"]);
handleError(args, callbackObject, callbackMethod);
flush(true);
return(undefined);
}
_sendChannel._queue.push({methodName:methodName, args:args, callbackID:_rcvChannel._nextcallbackID});
}
_rcvChannel._callbacks[_rcvChannel._nextcallbackID] = {callbackObject:callbackObject, callbackMethod:callbackMethod};
_rcvChannel._nextcallbackID++;
}
static var _gatewayURL = "http://www.mochiads.com/static/lib/services/services.swf";
static var _listenChannelName = "__mochiservices";
static var _connecting = false;
static var _connected = false;
}
Symbol 592 MovieClip [__Packages.Hsapi] Frame 0
class Hsapi extends MovieClip
{
var initialized, portal_mc;
function Hsapi (pURL) {
super();
if (pURL == undefined) {
pURL = "hsapitest_as2";
}
initialized = false;
var _local5 = new MovieClipLoader();
var _local4 = new Object();
_local4.parent = this;
portal_mc = _root.createEmptyMovieClip("portal_mc", _root.getNextHighestDepth());
_local4.onLoadError = function (target_mc) {
trace("unable to load:" + pURL);
};
_local4.onLoadComplete = function (target_mc) {
this.parent.initialized = true;
trace("loading completed: " + pURL);
};
_local5.addListener(_local4);
_local5.loadClip(pURL + ".swf", portal_mc);
}
function startGame(gameStr, gameLevel, score, gameParams) {
if (initialized) {
portal_mc.startGame(gameStr, gameLevel, score, gameParams);
} else {
trace("Error: startGame() but Hsapi not yet initialized");
}
}
function levelComplete(gameLevel, score, gameParams) {
if (initialized) {
portal_mc.levelComplete(gameLevel, score, gameParams);
} else {
trace("Error: levelComplete() but Hsapi not yet initialized");
}
}
function milestoneComplete(milestone, score, gameParams) {
if (initialized) {
portal_mc.milestoneComplete(milestone, score, gameParams);
} else {
trace("Error: milestoneComplete() but Hsapi not yet initialized");
}
}
function endGame(gameLevel, score, gameParams) {
if (initialized) {
portal_mc.endGame(gameLevel, score, gameParams);
} else {
trace("Error: endGame() but Hsapi not yet initialized");
}
}
}
Symbol 593 MovieClip [__Packages.mochi.MochiScores] Frame 0
class mochi.MochiScores
{
static var boardID, onClose, onError;
function MochiScores () {
}
static function setBoardID(boardID) {
mochi.MochiScores.boardID = boardID;
mochi.MochiServices.send("scores_setBoardID", {boardID:boardID});
}
static function showLeaderboard(options) {
if (options.clip != null) {
if ((options.clip != mochi.MochiServices.__get__clip()) || (mochi.MochiServices.__get__childClip()._target == undefined)) {
mochi.MochiServices.disconnect();
mochi.MochiServices.connect(mochi.MochiServices.__get__id(), options.clip);
}
delete options.clip;
}
if (options.name != null) {
if (typeof(options.name) == "object") {
if (options.name.text != undefined) {
options.name = options.name.text;
}
}
}
if (options.score != null) {
if (typeof(options.score) == "object") {
if (options.score.text != undefined) {
options.score = options.score.text;
}
}
}
if (options.onDisplay != null) {
options.onDisplay();
} else {
mochi.MochiServices.__get__clip().stop();
}
if (options.onClose != null) {
onClose = options.onClose;
} else {
onClose = function () {
mochi.MochiServices.__get__clip().play();
};
}
if (options.onError != null) {
onError = options.onError;
} else {
onError = onClose;
}
if (options.boardID == null) {
if (boardID != null) {
options.boardID = boardID;
}
}
mochi.MochiServices.send("scores_showLeaderboard", {options:options}, null, doClose);
}
static function closeLeaderboard() {
mochi.MochiServices.send("scores_closeLeaderboard");
}
static function getPlayerInfo(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_getPlayerInfo", null, callbackObj, callbackMethod);
}
static function submit(score, name, callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_submit", {score:score, name:name}, callbackObj, callbackMethod);
}
static function requestList(callbackObj, callbackMethod) {
mochi.MochiServices.send("scores_requestList", null, callbackObj, callbackMethod);
}
static function scoresArrayToObjects(scores) {
var _local5 = {};
var _local1;
var _local4;
var _local2;
var _local6;
for (var _local8 in scores) {
if (typeof(scores[_local8]) == "object") {
if ((scores[_local8].cols != null) && (scores[_local8].rows != null)) {
_local5[_local8] = [];
_local2 = scores[_local8];
_local4 = 0;
while (_local4 < _local2.rows.length) {
_local6 = {};
_local1 = 0;
while (_local1 < _local2.cols.length) {
_local6[_local2.cols[_local1]] = _local2.rows[_local4][_local1];
_local1++;
}
_local5[_local8].push(_local6);
_local4++;
}
} else {
_local5[_local8] = {};
for (var _local7 in scores[_local8]) {
_local5[_local8][_local7] = scores[_local8][_local7];
}
}
} else {
_local5[_local8] = scores[_local8];
}
}
return(_local5);
}
static function doClose(args) {
if (args.error == true) {
if (args.errorCode == undefined) {
args.errorCode = "IOError";
}
onError.apply(null, [args.errorCode]);
} else {
onClose.apply();
}
}
}
Symbol 471 MovieClip Frame 175
_root.gotoAndStop(3);
Instance of Symbol 465 MovieClip in Symbol 474 MovieClip Frame 1
on (release) {
getURL ("http://itch.com");
}
Symbol 474 MovieClip Frame 135
_root.nextFrame();
Symbol 481 MovieClip Frame 1
stop();
Symbol 484 MovieClip Frame 1
stop();
Symbol 487 MovieClip Frame 1
stop();
Symbol 493 MovieClip Frame 1
stop();
Symbol 554 MovieClip [explosion] Frame 29
this.removeMovieClip();
Symbol 566 MovieClip Frame 182
stop();
Instance of Symbol 465 MovieClip in Symbol 573 MovieClip Frame 215
on (release) {
getURL ("http://itch.com");
}
Symbol 573 MovieClip Frame 230
stop();
Instance of Symbol 465 MovieClip in Symbol 573 MovieClip Frame 230
on (release) {
getURL ("http://itch.com/?source=fg_26", "_self");
}