Frame 1
mochi.MochiServices.connect("d66e0f92cbed07f8");
Frame 4
function goodword(t) {
r = "good";
part = t.split(" ");
for (i in banlist) {
for (p in part) {
if (banlist[i].toLowerCase() == part[p].toLowerCase()) {
b = part[p];
r = "bad";
}
}
}
nameinput = part.join(" ");
if (t.length < 3) {
r = "short";
}
}
stop();
nameinput = "";
banlist = ["shit", "fuck", "dick"];
inputbox.onChanged = function () {
save._visible = true;
};
onEnterFrame = function () {
if (active) {
cont._alpha = 100;
} else {
cont._alpha = 20;
}
};
save.onPress = function () {
goodword(nameinput);
if (r == "good") {
outputtxt = ("welcome " + nameinput) + " click continue to play";
pname = nameinput;
active = true;
save._visible = false;
}
if (r == "bad") {
outputtxt = ("you can't use \"" + b) + "\" in your name sorry";
active = false;
}
if (r == "short") {
outputtxt = "name must be a minimum of 3 characters long";
active = false;
}
};
cont.onPress = function () {
if (active) {
gotoAndStop ("mainmenu");
}
};
Frame 6
stop();
Frame 7
arrows.left.gotoAndStop(2);
arrows.right.gotoAndStop(2);
space.space.gotoAndStop(2);
menub.menu.gotoAndStop(2);
Frame 8
function make(a, b) {
_root[a] = b;
}
function movegun() {
if (you._y > _ymouse) {
you.gun._rotation = Math.atan((_xmouse - you._x) / (you._y - _ymouse)) * 57.2957795130823;
} else if (you._x > _xmouse) {
you.gun._rotation = 270;
} else {
you.gun._rotation = 90;
}
}
function loadyou() {
attachMovie(upgrades[upglvl], "you", 1);
you._x = 275;
you._y = 350;
if (gmode == "story") {
you.HP = 20;
}
if (gmode == "cade") {
you.HP = 4;
}
if (upglvl == 1) {
attachMovie("xhair", "x", 6);
}
}
function loadstuff() {
trace("Loading...");
loadyou();
rate = 0;
frame = 0;
framea = 0;
n = 100;
wavecount = 0;
gspeed = 0.9;
music.stop();
music.start(0, 100);
trace("vars set");
createEmptyMovieClip("shotHolder", 4);
createEmptyMovieClip("enemyHolder", 2);
createEmptyMovieClip("bullHolder", 3);
createEmptyMovieClip("PUHolder", 5);
trace("containers made");
if (gmode == "story") {
lvlevents = this[("lvl" + glevel) + "events"].slice();
trace(("level " + glevel) + " events loaded");
healthbar._visible = true;
money = 100000 /* 0x0186A0 */;
}
if (gmode == "cade") {
lvlevents = arcadeloop.slice();
trace("arcade loop loaded");
healthbar._visible = false;
}
cevent = lvlevents.shift();
kills = 0;
misses = 0;
hits = 0;
shotsfired = 0;
landede = false;
trace("cake baked");
}
function loadeditor() {
gPause = true;
attachMovie("leveleditor", "editor", 7);
gmenu = true;
}
function loadgmenu() {
gPause = true;
if (gmode == "cade") {
attachMovie("arcademenu", "gamemenu", 8);
Mouse.show();
}
if (gmode == "story") {
attachMovie("gamemenu", "gamemenu", 8);
Mouse.show();
}
gmenu = true;
}
function centprint(txt) {
centmessage = txt;
centtime = 30;
}
function unloadstuff() {
bullHolder.removeMovieClip();
shotHolder.removeMovieClip();
enemyHolder.removeMovieClip();
PUHolder.removeMovieClip();
music.stop();
x.removeMovieClip();
you.removeMovieClip();
stats.kills = stats.kills + kills;
stats.misses = stats.misses + misses;
stats.hits = stats.hits + hits;
stats.shotsfired = stats.shotsfired + shotsfired;
}
function shoot() {
shotHolder.attachMovie(shottypes[shotlvl].sname, "n" + n, n, {_x:you._x, _y:350});
s = shottypes[shotlvl].speed;
shotHolder["n" + n].HP = shottypes[shotlvl].HP;
shotHolder["n" + n].maxHP = shottypes[shotlvl].HP;
shotHolder["n" + n].snd = new Sound();
shotHolder["n" + n].snd.attachSound(shottypes[shotlvl].snd);
shotHolder["n" + n].snd.start();
if (upglvl > 0) {
r = you.gun._rotation;
shotHolder["n" + n]._rotation = r;
shotHolder["n" + n].xspeed = s * Math.sin(r / 57.2957795130823);
shotHolder["n" + n].yspeed = s * Math.cos(r / 57.2957795130823);
shotHolder["n" + n]._x = shotHolder["n" + n]._x + (25 * Math.sin(r / 57.2957795130823));
shotHolder["n" + n]._y = shotHolder["n" + n]._y - (25 * Math.cos(r / 57.2957795130823));
} else {
shotHolder["n" + n].yspeed = s;
shotHolder["n" + n].xspeed = 0;
}
n = n + 1;
shotsfired = shotsfired + 1;
if (shotlvl == 2) {
fireammo = fireammo - 1;
if (fireammo <= 0) {
shotlvl = 1;
}
}
}
function launchpro(a, b, c) {
bullHolder.attachMovie(bulltypes[a].sname, "n" + n, n, bulltypes[a]);
bullHolder["n" + n]._x = b;
bullHolder["n" + n]._y = c;
s = bulltypes[a].speed;
if (bulltypes[a].aimmode) {
rise = you._y - c;
run = you._x - b;
dist = Math.sqrt(Math.pow(rise, 2) + Math.pow(run, 2));
bullHolder["n" + n].xspeed = s * (run / dist);
bullHolder["n" + n].yspeed = s * (rise / dist);
bullHolder["n" + n]._rotation = Math.atan((-run) / rise) * 57.2957795130823;
} else {
bullHolder["n" + n].xspeed = 0;
bullHolder["n" + n].yspeed = s;
}
n = n + 1;
}
function spawnenemy(a, b, c, m, p) {
enemyHolder.attachMovie(enemytypes[a].ename, "n" + n, n, enemytypes[a]);
enemyHolder["n" + n].sx = b;
enemyHolder["n" + n].sy = c;
enemyHolder["n" + n].mpath = m;
enemyHolder["n" + n].pos = p;
enemyHolder["n" + n].sframe = 0;
n = n + 1;
}
function moveenemy(a) {
with (enemyHolder[a]) {
sframe = sframe + 1;
opos = (sframe * speed) * gspeed;
if (mpath == 1) {
_y = opos - 10;
_x = ((30 * Math.sin(opos / 10)) + sx) + (pos * 400);
if (((sframe + Math.ceil(20 * (pos - 1))) % 40) == 0) {
launchpro(3, _x, _y);
}
}
if (mpath == 2) {
_x = (40 * Math.sin(((sframe * Math.PI) / 30) + ((pos * 2) * Math.PI))) + sx;
_y = ((40 * Math.cos(((sframe * Math.PI) / 30) + ((pos * 2) * Math.PI))) + opos) - 50;
if (((sframe + Math.round(60 * pos)) % (60 * firerate)) == 0) {
launchpro(1, _x, _y);
}
}
if (mpath == 3) {
_x = (40 * Math.sin(((sframe * Math.PI) / 30) + ((pos * 2) * Math.PI))) + sx;
_y = ((40 * Math.cos(((sframe * Math.PI) / 30) + ((pos * 2) * Math.PI))) + opos) - 50;
}
if (mpath == 4) {
_x = (200 * Math.sin(((sframe * Math.PI) / 100) + (((pos * 2) * Math.PI) / 5))) + sx;
_y = ((40 * Math.cos(((sframe * Math.PI) / 50) + (((pos * 2) * Math.PI) / 5))) + (opos / 2)) - 50;
if (((sframe + Math.round(50 * pos)) % (50 * firerate)) == 0) {
launchpro(0, _x, _y);
}
}
if (mpath == 5) {
_y = opos - 10;
_x = ((30 * Math.sin(opos / 10)) + sx) + (pos * 400);
if (((sframe + Math.ceil(20 * (pos - 1))) % 60) == 0) {
launchpro(2, _x, _y);
}
}
}
}
function spawngroup(a, sx, gm, no) {
if (typeof(a) == "object") {
no = a.no;
gm = a.gm;
sx = a.sx;
ga = a.ga;
} else {
ga = a;
}
i = 0;
while (i < no) {
spawnenemy(ga, sx, -100, gm, (i / no) - ((no - 1) / (2 * no)));
i++;
}
}
function spawnmoney(a, b) {
PUHolder.attachMovie("$$$", "n" + n, n, {_x:a, _y:b});
n = n + 1;
}
function keyflash(k, s) {
if (typeof(s) == "string") {
s = int(s);
}
fingks[k] = s;
}
function dead() {
if (lives <= 0) {
if (gmode == "cade") {
mochi.MochiScores.showLeaderboard({boardID:"2f6ad3002bc38120", score:score, name:pname});
gPause = true;
unloadstuff();
centmessage = "Game Over";
} else {
unloadstuff();
Mouse.show();
gotoAndStop ("gameover");
}
} else {
lives = lives - 1;
gPause = true;
for (e in enemyHolder) {
if ((enemyHolder[e]._y > 150) && (e != landede)) {
enemyHolder[e].removeMovieClip();
}
}
for (i in bullHolder) {
if (bullHolder[i]._y > 50) {
bullHolder[i].removeMovieClip();
}
}
recovtime = 22;
}
}
var my_cm = new ContextMenu();
my_cm.hideBuiltInItems();
_root.menu = my_cm;
stop();
boom1 = new Sound();
boom2 = new Sound();
boom3 = new Sound();
music = new Sound();
music.attachSound("music");
boom1.attachSound("Boom-1");
boom2.attachSound("Boom-2");
boom3.attachSound("Boom-3");
mute = 1;
stats = {kills:0, shotsfired:0, misses:0, hits:0};
gPause = 0;
money = 0;
gmenu = 0;
console._visible = 0;
input = "";
score = 0;
centmessage = "";
centtime = 0;
vars = ["number", "string", "boolean"];
fireammo = 0;
lives = 3;
recovtime = 0;
landede = false;
lvl1events = [{typ:"f", e:1, actions:["keyflash left 37", "keyflash right 39", "centprint Level-1"]}, {typ:"f", e:100, spawn:[{ga:1, sx:275, gm:3, no:4}], actions:["keyflash space 32"]}, {typ:"el", spawn:[{ga:1, sx:275, gm:3, no:4}]}, {typ:"fa", e:100, spawn:[{ga:1, sx:150, gm:3, no:3}, {ga:1, sx:400, gm:3, no:3}]}, {typ:"fa", e:100, spawn:[{ga:1, sx:275, gm:2, no:4}]}, {typ:"el", spawn:[{ga:1, sx:275, gm:1, no:6}]}, {typ:"fa", e:120, spawn:[{ga:1, sx:275, gm:1, no:3}]}, {typ:"fa", e:50, spawn:[{ga:2, sx:275, gm:1, no:3}]}, {typ:"el", spawn:[{ga:0, sx:150, gm:2, no:3}, {ga:0, sx:400, gm:3, no:3}]}, {typ:"fa", e:130, spawn:[{ga:0, sx:275, gm:1, no:5}]}, {typ:"fa", e:50, spawn:[{ga:1, sx:150, gm:2, no:3}, {ga:1, sx:400, gm:2, no:3}]}, {typ:"el", spawn:[{ga:1, sx:150, gm:2, no:3}, {ga:1, sx:400, gm:3, no:3}]}, {typ:"fa", e:130, spawn:[{ga:0, sx:275, gm:1, no:5}]}, {typ:"fa", e:50, spawn:[{ga:0, sx:150, gm:2, no:3}, {ga:0, sx:400, gm:2, no:3}]}, {typ:"el", spawn:[{ga:1, sx:150, gm:2, no:5}, {ga:1, sx:400, gm:2, no:5}]}, {typ:"fa", e:100, spawn:[{ga:2, sx:125, gm:2, no:3}, {ga:2, sx:275, gm:2, no:3}, {ga:2, sx:425, gm:2, no:3}]}, {typ:"el", actions:["loadgmenu", "make glevel 2"]}, {typ:"end"}];
lvl2events = [{typ:"f", e:1, actions:["centprint Level-2"]}, {typ:"fa", e:50, spawn:[{ga:0, sx:275, gm:1, no:5}]}, {typ:"fa", e:50, spawn:[{ga:0, sx:275, gm:1, no:6}]}, {typ:"fa", e:50, spawn:[{ga:0, sx:275, gm:1, no:7}]}, {typ:"el", spawn:[{ga:3, sx:275, gm:2, no:4}]}, {typ:"fa", e:80, spawn:[{ga:3, sx:183, gm:2, no:4}, {ga:3, sx:367, gm:2, no:4}]}, {typ:"fa", e:80, spawn:[{ga:3, sx:92, gm:2, no:4}, {ga:3, sx:458, gm:2, no:4}]}, {typ:"el", spawn:[{ga:3, sx:275, gm:2, no:6}]}, {typ:"fa", e:130, spawn:[{ga:2, sx:275, gm:1, no:6}]}, {typ:"fa", e:50, spawn:[{ga:2, sx:275, gm:1, no:6}]}, {typ:"el", actions:["unloadstuff"]}, {typ:"el", actions:["gotoAndStop gameover"]}];
lvl3events = [];
arcadeloop = [{typ:"el", spawn:[{ga:0, sx:150, gm:2, no:2}, {ga:0, sx:400, gm:3, no:2}]}, {typ:"fa", e:130, spawn:[{ga:0, sx:275, gm:1, no:5}]}, {typ:"money"}, {typ:"el", spawn:[{ga:1, sx:150, gm:2, no:3}, {ga:1, sx:400, gm:3, no:3}]}, {typ:"fa", e:130, spawn:[{ga:0, sx:275, gm:1, no:5}]}, {typ:"fa", e:50, spawn:[{ga:0, sx:150, gm:2, no:3}, {ga:0, sx:400, gm:2, no:3}]}, {typ:"el"}, {typ:"money"}, {typ:"fa", e:40, spawn:[{ga:3, sx:275, gm:5, no:1}]}, {typ:"fa", e:50, spawn:[{ga:3, sx:275, gm:5, no:2}]}, {typ:"fa", e:50, spawn:[{ga:3, sx:275, gm:5, no:3}]}, {typ:"money"}, {typ:"wave"}, {typ:"el", spawn:[{ga:2, sx:275, gm:4, no:2}]}, {typ:"loop", e:"arcadeloop"}];
upgrades = ["M1", "M2"];
shottypes = [{sname:"shot1", speed:8, HP:1, firerate:7, snd:"gunsnd1"}, {sname:"shot2", speed:5, HP:1, firerate:5, snd:"gunsnd2"}, {sname:"shot3", speed:4, HP:3, firerate:12, snd:"gunsnd3"}];
bulltypes = [{sname:"bull1", speed:6, HP:1, aimmode:false, tracking:true, damage:5, turning:3}, {sname:"bull2", speed:10, HP:1, aimmode:true, tracking:false, damage:5}, {sname:"bull4", speed:10, HP:1, aimmode:true, tracking:false, damage:5}, {sname:"bull5", speed:6, HP:1, aimmode:false, tracking:false, damage:5}, {sname:"bull3", speed:4, HP:3, aimmode:false, tracking:false, damage:5}];
enemytypes = [{ename:"enemy1", speed:1.2, HP:1, firerate:1}, {ename:"enemy2", speed:1, HP:1, firerate:2}, {ename:"enemy3", speed:0.7, HP:3, firerate:2}, {ename:"enemy4", speed:1, HP:1, firerate:1}];
abc = ["a", "b", "c"];
shotlvl = 0;
upglvl = 0;
glevel = 1;
keyframes = [1, 0, 1, 0, 0, 0, 0, 0];
fingks = {left:0, right:0, space:0, menu:0};
youflashy = [1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0];
loadstuff();
onEnterFrame = function () {
output = " Score: " + score;
if (gmode == "cade") {
output = (output + " Money: ") + money;
}
if (shotlvl == 2) {
output = (output + " Ammo: ") + fireammo;
}
x._x = _xmouse;
x._y = _ymouse;
healthbar.bar.block._yscale = you.HP * 5;
livesbar.num = "x " + lives;
if (recovtime > 0) {
recovtime = recovtime - 1;
you._visible = youflashy[recovtime];
if (landede != false) {
enemyHolder[landede]._visible = youflashy[recovtime];
}
if (recovtime == 0) {
enemyHolder[landede].removeMovieClip();
if (gmenu != true) {
gPause = false;
}
loadyou();
}
}
if (centtime > 0) {
centtime = centtime - 1;
if (centtime == 0) {
centmessage = "";
}
}
if (gPause == false) {
if ((you._x > 25) && (Key.isDown(37))) {
you._x = you._x - (6 * gspeed);
}
if ((you._x < 525) && (Key.isDown(39))) {
you._x = you._x + (6 * gspeed);
}
if (upglvl > 0) {
movegun();
}
if ((mdown || (Key.isDown(32))) && (rate < 0)) {
shoot();
rate = shottypes[shotlvl].firerate;
}
rate = rate - 1;
frame = frame + 1;
framea = framea + 1;
if (gmode == "cade") {
gspeed = gspeed + 0.0001;
}
if ((cevent.typ == "el") && (noenemys)) {
trace("Event: 0 enemies");
for (i in cevent.spawn) {
spawngroup(cevent.spawn[i]);
}
for (i in cevent.actions) {
trace("Action: " + cevent.actions[i]);
part = cevent.actions[i].split(" ");
called = eval (part[0]);
called(part[1], part[2], part[3], part[4], part[5], part[6]);
}
cevent = lvlevents.shift();
framea = 0;
}
if (cevent.typ == "wave") {
wavecount = wavecount + 1;
if (((wavecount % 3) == 0) && (lives < 4)) {
lives = lives + 1;
}
cevent = lvlevents.shift();
}
if (cevent.typ == "loop") {
frame = 0;
lvlevents = this[cevent.e + ""].slice();
cevent = lvlevents.shift();
}
if (cevent.typ == "end") {
unloadstuff();
loadstuff();
}
if (cevent.typ == "money") {
spawnmoney(random(500) + 25, -10);
cevent = lvlevents.shift();
}
if ((cevent.typ == "f") && (cevent.e == frame)) {
trace("Event: Frame");
for (i in cevent.spawn) {
spawngroup(cevent.spawn[i]);
}
for (i in cevent.actions) {
trace("Action: " + cevent.actions[i]);
part = cevent.actions[i].split(" ");
called = eval (part[0]);
called(part[1], part[2], part[3], part[4], part[5], part[6]);
}
cevent = lvlevents.shift();
framea = 0;
}
if ((cevent.typ == "fa") && (cevent.e == framea)) {
trace("Event: Frames after");
for (i in cevent.spawn) {
spawngroup(cevent.spawn[i]);
}
for (i in cevent.actions) {
trace("Action: " + cevent.actions[i]);
part = cevent.actions[i].split(" ");
called = eval (part[0]);
called(part[1], part[2], part[3], part[4], part[5], part[6]);
}
cevent = lvlevents.shift();
framea = 0;
}
for (i in shotHolder) {
with (shotHolder[i]) {
_x = _x + (xspeed * gspeed);
_y = _y - (yspeed * gspeed);
if (((_x < 0) || (_y < 0)) || (_x > 550)) {
if (HP == maxHP) {
misses = misses + 1;
} else {
hits = hits + 1;
}
removeMovieClip();
continue;
}
if (HP <= 0) {
score = score + 5;
hits = hits + 1;
removeMovieClip();
}
}
for (e in enemyHolder) {
if (shotHolder[i].hitTest(enemyHolder[e])) {
_root["boom" + (random(3) + 1)].start();
enemyHolder[e].HP = enemyHolder[e].HP - 1;
shotHolder[i].HP = shotHolder[i].HP - 1;
}
}
}
for (i in bullHolder) {
with (bullHolder[i]) {
if (tracking) {
rise = (_root.you._y + 6) - _y;
run = _root.you._x - _x;
angle = Math.atan((-run) / rise) * 57.2957795130823;
if (angle > (_rotation - turning)) {
_rotation = _rotation + turning;
}
if (angle < (_rotation + turning)) {
_rotation = _rotation - turning;
}
xspeed = (-s) * Math.sin(_rotation / 57.2957795130823);
yspeed = s * Math.cos(_rotation / 57.2957795130823);
}
_x = _x + (xspeed * gspeed);
_y = _y + (yspeed * gspeed);
if ((((_x < 0) || (_y > 400)) || (_x > 550)) || (_y < 0)) {
removeMovieClip();
}
if (_root.you.hitTest(_x, _y, 1)) {
_root.you.HP = _root.you.HP - damage;
HP = 0;
if (_root.you.HP <= 0) {
_root.dead();
break;
}
}
if (HP <= 0) {
removeMovieClip();
}
}
}
noenemys = true;
for (e in enemyHolder) {
noenemys = false;
if (enemyHolder[e]._y > 350) {
landede = e;
dead();
break;
}
moveenemy(e);
if (enemyHolder[e].HP <= 0) {
kills = kills + 1;
enemyHolder[e].removeMovieClip();
}
}
for (p in PUHolder) {
with (PUHolder[p]) {
_y = _y + 3;
if (_root.you.hitTest(_x, _y, 1) || (_root.you.hitTest(_x, _y - _height, 0))) {
money = money + 25;
removeMovieClip();
}
}
}
for (i in fingks) {
if (fingks[i] > 0) {
keypad[i].gotoAndStop((keyframes[frame % 8] + 1) * 2);
} else {
keypad[i].gotoAndStop(1);
}
}
}
};
onMouseDown = function () {
mdown = true;
};
onMouseUp = function () {
mdown = false;
};
kl = new Object();
Key.addListener(kl);
kl.onKeyUp = function () {
key = Key.getCode();
if (((key == 77) && (gmenu == 0)) && (gmode == "cade")) {
loadgmenu();
}
if ((key == 80) && (gmenu == 0)) {
gPause = !gPause;
}
};
kl.onKeyDown = function () {
key = Key.getCode();
for (i in fingks) {
if (key == fingks[i]) {
fingks[i] = 0;
}
}
};
Frame 9
if (lives < 0) {
winner._visible = 0;
} else {
gameover._visible = 0;
}
onEnterFrame = function () {
};
if (gmode == "cade") {
gotoAndStop ("mainmenu");
statsout = ((((((((((("Kills: " + stats.kills) + newline) + "Accuracy: ") + Math.round((stats.hits / (stats.hits + stats.misses)) * 100)) + "%") + newline) + "Money: ") + money) + newline) + "Score: ") + score) + newline;
}
if (gmode == "story") {
statsout = (((((((((((((((("Kills: " + stats.kills) + newline) + "Accuracy: ") + Math.round((stats.hits / (stats.hits + stats.misses)) * 100)) + "%") + newline) + "Money: ") + money) + newline) + "Score: ") + score) + newline) + "Extra Lives: ") + lives) + newline) + newline) + "Highscores are only recorded for Arcade Mode";
}
Symbol 19 MovieClip [shp_m2] Frame 1
stop();
Symbol 48 MovieClip Frame 2
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
_root.play();
}
Symbol 48 MovieClip Frame 3
gotoAndPlay (2);
Symbol 51 Button
on (release) {
getURL ("http://MaxGames.com", "_blank");
}
Symbol 257 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.35");
}
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 function addLinkEvent(url, btn, onClick) {
var _local1 = new Object();
_local1.mav = getVersion();
_local1.swfv = btn.getSWFVersion() || 6;
_local1.swfurl = btn._url;
_local1.fv = System.capabilities.version;
_local1.os = System.capabilities.os;
_local1.lang = System.capabilities.language;
_local1.scres = (System.capabilities.screenResolutionX + "x") + System.capabilities.screenResolutionY;
var s = "?";
var _local2 = 0;
for (var _local5 in _local1) {
if (_local2 != 0) {
s = s + "&";
}
_local2++;
s = ((s + _local5) + "=") + escape(_local1[_local5]);
}
var _local3 = btn.createEmptyMovieClip("clk", 1001);
_local3._alpha = 0;
_local3.beginFill(1044735);
_local3.moveTo(0, 0);
_local3.lineTo(0, btn._height);
_local3.lineTo(btn._width, btn._height);
_local3.lineTo(btn._width, 0);
_local3.lineTo(0, 0);
_local3.endFill();
_local3.onRelease = function () {
getURL (url + s, "_blank");
if (onClick != undefined) {
onClick();
}
};
}
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 258 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 65 MovieClip Frame 1
_root.stop();
Symbol 65 MovieClip Frame 80
_root.play();
Symbol 71 Button
on (release) {
getURL ("http://www.maxgames.com", "_blank");
}
Symbol 74 MovieClip Frame 60
stop();
Symbol 88 MovieClip Frame 14
stop();
Symbol 89 MovieClip Frame 1
_root.stop();
Symbol 89 MovieClip Frame 139
_root.play();
Symbol 108 MovieClip Frame 1
stop();
Symbol 122 MovieClip [arcademenu] Frame 1
function loadstats() {
stats = (((((((((("Kills: " + _root.kills) + newline) + "Accuracy: ") + Math.round((_root.hits / (_root.hits + _root.misses)) * 100)) + "%") + newline) + "Money: ") + _root.money) + newline) + "Score: ") + _root.score;
}
function loadbtns() {
if (_root.upglvl == 0) {
attachMovie("shp_m2", "btn_m2", _root.n, {_x:320, _y:220});
_root.n = _root.n + 1;
pr2 = "$200";
}
if (_root.shotlvl == 0) {
attachMovie("shp_s1", "btn_s1", _root.n, {_x:200, _y:220});
_root.n = _root.n + 1;
pr1 = "$100";
} else {
attachMovie("shp_s2", "btn_s2", _root.n, {_x:200, _y:220});
_root.n = _root.n + 1;
pr1 = "$50";
}
trace("buttons loaded");
}
loadbtns();
loadstats();
btn_m2.onRelease = function () {
if (_root.money >= 200) {
_root.upglvl = 1;
_root.loadyou();
_root.money = _root.money - 200;
loadstats();
this.removeMovieClip();
}
};
btn_s1.onRelease = function () {
if (_root.money >= 100) {
_root.shotlvl = 1;
_root.money = _root.money - 100;
loadstats();
this.removeMovieClip();
}
};
btn_s2.onRelease = function () {
if (_root.money >= 50) {
_root.shotlvl = 2;
_root.fireammo = _root.fireammo + 10;
_root.money = _root.money - 50;
loadstats();
}
};
btn_cont.onRelease = function () {
if (_root.upglvl == 1) {
Mouse.hide();
}
_root.gPause = false;
_root.gmenu = false;
_root.gamemenu.removeMovieClip();
};
Symbol 152 MovieClip [gamemenu] Frame 1
function loadbtns() {
if (_root.upglvl == 0) {
attachMovie("shp_m2", "btn_m2", _root.n, {_x:320, _y:220});
_root.n = _root.n + 1;
}
if (_root.shotlvl == 0) {
attachMovie("shp_s1", "btn_s1", _root.n, {_x:200, _y:220});
_root.n = _root.n + 1;
} else {
attachMovie("shp_s2", "btn_s2", _root.n, {_x:200, _y:220});
_root.n = _root.n + 1;
}
}
stats = ((((((("Kills: " + _root.kills) + newline) + "Accuracy: ") + Math.round((_root.hits / (_root.hits + _root.misses)) * 100)) + "%") + newline) + "Score: ") + _root.score;
loadbtns();
btn_m2.onRelease = function () {
_root.upglvl = 1;
_root.loadyou();
this.removeMovieClip();
Mouse.hide();
_root.gPause = false;
_root.gmenu = false;
_root.gamemenu.removeMovieClip();
};
btn_s1.onRelease = function () {
_root.shotlvl = 1;
this.removeMovieClip();
_root.gPause = false;
_root.gmenu = false;
_root.gamemenu.removeMovieClip();
};
btn_s2.onRelease = function () {
_root.shotlvl = 2;
_root.fireammo = _root.fireammo + 10;
};
btn_cont._visible = 0;
Symbol 156 MovieClip Frame 1
stop();
Symbol 160 MovieClip Frame 1
stop();
Symbol 164 MovieClip Frame 1
stop();
Symbol 172 MovieClip Frame 1
stop();
Symbol 174 MovieClip [keypad] Frame 1
stop();
Symbol 188 MovieClip [leveleditor] Frame 1
num = 0;
scrolly = 0;
plus.onRelease = function () {
attachMovie("set", "s" + num, num + 1, {_x:15, _y:(num * 50) + 30});
num = num + 1;
};
onMouseDown = function () {
i = 0;
while (i < num) {
s = 1;
while (s <= 5) {
if (this["s" + i]["s" + s].hitTest(_xmouse, _ymouse)) {
this["s" + i]["s" + s].gotoAndStop(ctype);
this["s" + i]["s" + s].etype = ctype;
this["s" + i]["s" + s].num = cnum;
this["s" + i]["s" + s].path = cpath;
this["s" + i]["s" + s].out = (((("t" + ctype) + "p") + cpath) + "n") + cnum;
trace("hit");
}
s++;
}
i++;
}
};
save.onRelease = function () {
trace("[");
i = 0;
while (i < num) {
ev = ((("{typ:\"" + _root.editor["s" + i].evt) + "\",e:") + _root.editor["s" + i].time) + ",spawn:[";
s = 1;
while (s <= 5) {
if (_root.editor["s" + i]["s" + s].etype) {
ev = (ev + "{ga:") + _root.editor["s" + i]["s" + s].etype;
ev = (ev + ",sx:") + (91.6666666666667 * s);
ev = (ev + ",gm:") + _root.editor["s" + i]["s" + s].path;
ev = ((ev + ",no:") + _root.editor["s" + i]["s" + s].num) + "},";
}
s++;
}
ev = ev.substr(0, length(ev) - 1) + "]},";
if (i < (num - 1)) {
trace(ev);
} else {
trace(ev.substr(0, length(ev) - 1));
trace("]");
}
i++;
}
};
Symbol 208 Button
on (release) {
gotoAndStop ("tut");
}
Symbol 209 Button
on (release) {
getURL ("http://www.threemenwise.com", "_blank");
}
Symbol 210 Button
on (release) {
gotoAndStop ("credits");
}
Symbol 211 Button
on (release) {
gmode = "cade";
gotoAndStop ("game");
}
Symbol 212 Button
on (release) {
gmode = "story";
gotoAndStop ("game");
}
Symbol 215 Button
on (release) {
getURL ("http://MaxGames.com", "_blank");
}
Symbol 223 Button
on (release) {
gotoAndStop ("mainmenu");
}
Symbol 237 Button
on (release) {
mute = !mute;
music.setVolume(mute * 100);
}