Frame 1
MochiAd.showPreGameAd({id:"5238a9a4ebc0003b", res:"550x600", background:16777215, color:0, outline:9539985, no_bg:true});
var savefile = SharedObject.getLocal("bbbalhc");
highscore2 = savefile.data.highsc;
if (savefile.data.mxlv == null) {
savefile.data.mxlv = 1;
}
maxlvl = savefile.data.mxlv;
level = savefile.data.mxlv;
gbeat = savefile.data.gbt;
thecolors = new Array(8952752.38043684, 8952752.38043684, 2001984.16973494, 13231772.4144499, 14774747.4709189, 3824441.13142053, 9168111.23478795, 3241298.84586602, 11394819.6098783, 5228061.44619574, 1504373.84001983, 8934027.70186542, 10155589.4649922, 15943319.924704, 12877573.1386868, 2364798.68717201, 6131424.11110112, 15843654.922832, 13566228.6288897, 14731790.0828543, 4922497.73003375, 1345035.70889212, 1802038.05665266, 5226606.41503246, 8431846.31773527, 3231056.37772652, 2221290.18010078, 1737599.91986847, 12821117.2123643, 2708282.25263629, 10225994.2732957, 3646770.46232303, 4522990.59759624, 10754263.6714959, 12919369.5424455, 13815337.2546667, 5359419.50867868, 15574591.5482444, 6084744.77794593, 4309946.68841964, 5770772.01541016, 5430006.0982214, 8621142.32207734, 11086731.7688668, 7752742.24102553, 9911987.92482445, 15708884.6730525, 6013178.34471162, 7184713.95457015, 4207982.2179347, 1396952.33079765, 15739427.093107, 1861010.07657515, 12817492.7047679, 7246735.23993589, 9569709.32803834, 8063034.62096816, 15318825.9384893, 375748.477603644, 6168597.37451042, 9767640.53499072, 2292358.92586475, 10497312.4446239, 12266054.9016986, 9684581.10244145, 4480482.7407549, 10274144.7782382, 2570659.41708925, 15535671.5427518, 15344215.155726, 3724404.00457071, 9387641.15139045, 4673708.67455024, 11118170.5794929, 9366088.61361258, 7511832.47413487, 7719137.55552852, 8296678.99766687, 7188717.58714402, 7367588.88898246, 8521981.42955029, 3656963.00859051, 5499725.93781577, 3924863.93793487, 12675074.0335692, 15232038.2249122, 6668444.7587797, 6288755.39078595, 96676.5645501274, 16712671.9257221, 14970037.0374037, 8841734.54330402, 9025196.82924382, 11957905.1544408, 12022647.8224568, 84413.299656075, 13810900.3643061, 9410765.09532466, 6587557.65422594, 14278565.6176811);
lvlcolor = thecolors[random(100)];
stop();
Instance of Symbol 72 MovieClip in Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Frame 2
lives = 5;
_quality = "LOW";
colorcont = new Array();
if (Key.isDown(32)) {
editting = true;
}
bounce = new Sound();
bounce.attachSound("bounceb");
pop = new Sound();
pop.attachSound("bleep");
popb = new Sound();
popb.attachSound("bloopsoft");
tick = new Sound();
tick.attachSound("tick");
ssnd = new Sound();
ssnd.attachSound("ssnd");
dingr = new Sound();
dingr.attachSound("dingreverb");
death = new Sound();
death.attachSound("death");
ding = new Sound();
ding.attachSound("ding");
cheer = new Sound();
cheer.attachSound("cheer");
gsong = new Sound();
gsong.attachSound("modern");
Frame 3
lvlcolor = thecolors[random(100)];
stop();
Frame 4
for (var i in _root) {
removeMovieClip(_root[i]);
}
gsong.stop();
gotoAndStop(_currentframe + 1);
highscore = 0;
Frame 5
stop();
gsong.stop();
lives = 6;
gameover = false;
lvlcolor = thecolors[random(100)];
songon = false;
batr.swapDepths(2000);
batr.removeMovieClip();
selct = 0;
slcted = true;
onEnterFrame = function () {
hgl.gotoAndStop(selct + 1);
if (Key.isDown(40)) {
if (selct == 1) {
selct = 2;
tick.start(0, 0);
}
}
if (Key.isDown(38)) {
if (selct == 2) {
selct = 1;
tick.start(0, 0);
}
}
if (Key.isDown(32)) {
if ((selct == 1) and slcted) {
level = 1;
slcted = false;
score = 0;
hgl.slct.gotoAndStop(2);
dingr.start(0, 0);
setTimeout(function () {
gotoAndStop(_currentframe + 2);
}, 1600);
}
if ((selct == 2) and slcted) {
score = 0;
slcted = false;
hgl.slct.gotoAndStop(2);
dingr.start(0, 0);
setTimeout(function () {
gotoAndStop(_currentframe + 1);
}, 1600);
}
}
};
Instance of Symbol 72 MovieClip in Frame 5
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Frame 6
function lvlset() {
lvlse.lvlsel = level;
if (level < 10) {
lvlse.lvlsel = "0" + level;
}
if ((level > 9) and (level < 20)) {
lvlse._x = lvllocx + 58;
} else {
lvlse._x = lvllocx;
}
}
lvlcolor = thecolors[random(100)];
lvllocx = lvlse._x;
noSPACE = false;
if (maxlvl > 40) {
maxlvl = 40;
}
if (level > 40) {
level = 40;
}
lvlset();
udly = 1;
ut = 0;
slu = false;
ddly = 1;
dt = 0;
sld = false;
onEnterFrame = function () {
if (level == maxlvl) {
up._visible = false;
} else {
up._visible = true;
}
if (level == 1) {
down._visible = false;
} else {
down._visible = true;
}
if (!Key.isDown(38)) {
ut = 0;
slu = false;
}
if (Key.isDown(38) and (level < maxlvl)) {
if (slu != true) {
level++;
tick.start(0, 0);
}
slu = true;
ut++;
if (ut > 20) {
udly++;
if (udly > 4) {
udly = 1;
level++;
tick.start(0, 0);
}
}
lvlset();
}
if (!Key.isDown(40)) {
dt = 0;
sld = false;
}
if (Key.isDown(40) and (level > 1)) {
if (sld != true) {
level--;
tick.start(0, 0);
}
sld = true;
dt++;
if (dt > 20) {
ddly++;
if (ddly > 4) {
ddly = 1;
level--;
tick.start(0, 0);
}
}
lvlset();
}
if (Key.isDown(32) and noSPACE) {
gotoAndPlay(_currentframe + 1);
}
if (!Key.isDown(32)) {
noSPACE = true;
}
};
Frame 7
for (var i in _root) {
removeMovieClip(_root[i]);
}
gotoAndStop(_currentframe + 1);
Frame 8
function scoreadj() {
gscore.scorea.scr = score;
if (score < 100000) {
gscore.scorea.scr = "0" + score;
}
if (score < 10000) {
gscore.scorea.scr = "00" + score;
}
if (score < 1000) {
gscore.scorea.scr = "000" + score;
}
if (score < 100) {
gscore.scorea.scr = "0000" + score;
}
if (score < 10) {
gscore.scorea.scr = "00000" + score;
}
}
function paction(key) {
if (!editting) {
i = 1;
while (i <= blockdep) {
hit = false;
if ((blocks["tile" + i].hitTest(bal._x, bal._y - r) and (bal.vmov < 0)) and (hit == false)) {
bal.vmov = bal.vmov * -1;
hit = true;
vshake = bal.vmov / 2;
}
if ((blocks["tile" + i].hitTest(bal._x + r, bal._y) and (bal.hmov > 0)) and (hit == false)) {
bal.hmov = bal.hmov * -1;
hit = true;
hshake = bal.hmov / 2;
}
if ((blocks["tile" + i].hitTest(bal._x - r, bal._y) and (bal.hmov < 0)) and (hit == false)) {
bal.hmov = bal.hmov * -1;
hit = true;
hshake = bal.hmov / 2;
}
if ((blocks["tile" + i].hitTest(bal._x, bal._y + r) and (bal.vmov > 0)) and (hit == false)) {
bal.vmov = bal.vmov * -1;
hit = true;
vshake = bal.vmov / 2;
}
if (blocks["tile" + i].hitTest(bal._x + b, bal._y + b) and (hit == false)) {
diaghit = 315;
}
if (blocks["tile" + i].hitTest(bal._x + b, bal._y - b) and (hit == false)) {
diaghit = 45;
}
if (blocks["tile" + i].hitTest(bal._x - b, bal._y - b) and (hit == false)) {
diaghit = 135;
}
if (blocks["tile" + i].hitTest(bal._x - b, bal._y + b) and (hit == false)) {
diaghit = 225;
}
if (diaghit != 0) {
angle = diaghit;
speed = Math.sqrt((bal.hmov * bal.hmov) + (bal.vmov * bal.vmov));
if (speed < 10) {
speed = 10;
}
bal.hmov = (-speed) * Math.sin(((angle + 90) / 180) * Math.PI);
bal.vmov = (-speed) * Math.cos(((angle + 90) / 180) * Math.PI);
hit = true;
vshake = bal.vmov / 2;
hshake = bal.hmov / 2;
}
if ((hit == true) and (blocks["tile" + i]._currentframe < 11)) {
pop.start(0, 0);
score = score + 50;
scoreadj();
blocks["tile" + i].gotoAndStop(blocks["tile" + i]._currentframe - 1);
}
diaghit = 0;
i++;
}
}
if (hmov > maxh) {
hmov = maxh;
}
if (hmov < (-maxh)) {
hmov = -maxh;
}
if (vmov < (-maxh)) {
vmov = -maxh;
}
if (vmov > maxh) {
vmov = maxh;
}
}
function showhearts() {
hrts = 1;
for (var _local1 in hearty) {
hearty[_local1].removeMovieClip();
}
if (lives < 5) {
i = 1;
while (i <= lives) {
hearty.attachMovie("heart", "hrt" + hrts, hrts);
hearty["hrt" + hrts]._x = 30.8 + (62 * (i - 1));
hearty["hrt" + hrts]._y = 570.35;
hrts++;
i++;
}
} else {
hearty.attachMovie("heartmulti", "hrt" + hrts, hrts);
hearty["hrt" + hrts]._x = 31.9;
hearty["hrt" + hrts]._y = 567.2;
}
}
stop();
var key = 0;
if (!songon) {
gsong.start(0, 10000);
songon = true;
}
if (!editting) {
movspeed = 3;
} else {
movspeed = 0;
}
paus = false;
lvlcolor = thecolors[random(100)];
if (level == 1) {
grid = new Array([1, 2, 1, 1, 1, 2, 1, 1, 1], [1, 1, 1, 2, 1, 1, 1, 2, 1], [1, 2, 1, 1, 1, 2, 1, 1, 1], [1, 1, 1, 2, 1, 1, 1, 2, 1]);
}
if (level == 2) {
grid = new Array([1, 1, 1, 3, 1, 1, 1, 3, 1], [1, 2, 1, 1, 1, 2, 1, 1, 1], [1, 1, 1, 3, 1, 1, 1, 3, 1], [1, 2, 1, 1, 1, 2, 1, 1, 1]);
}
if (level == 3) {
grid = new Array([1, 2, 1, 2, 1, 2, 1, 2, 1], [1, 2, 1, 2, 1, 2, 1, 2, 1], [1, 2, 1, 2, 1, 2, 1, 2, 1], [1, 2, 1, 2, 1, 2, 1, 2, 1]);
}
if (level == 4) {
grid = new Array([2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1], [1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1], [1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1], [1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1]);
}
if (level == 5) {
grid = new Array([2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1], [1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1], [2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1], [1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1]);
}
if (level == 6) {
grid = new Array([1, 3, 1, 2, 1, 3, 1, 2, 1], [1, 3, 1, 2, 1, 3, 1, 2, 1], [1, 3, 1, 2, 1, 3, 1, 2, 1], [1, 3, 1, 2, 1, 3, 1, 2, 1]);
}
if (level == 7) {
grid = new Array([1, 3, 1, 2, 1, 3, 1, 2, 1], [2, 1, 3, 1, 2, 1, 3, 1, 2], [1, 3, 1, 2, 1, 3, 1, 2, 1], [2, 1, 3, 1, 2, 1, 3, 1, 2]);
}
if (level == 8) {
grid = new Array([1, 9, 1, 9, 1, 1, 1, 9, 1, 9], [1, 5, 1, 5, 1, 1, 1, 5, 1, 5], [1, 9, 1, 9, 1, 1, 1, 9, 1, 9], [1, 5, 1, 5, 1, 1, 1, 5, 1, 5]);
}
if (level == 9) {
grid = new Array([3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 1], [1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1], [1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1], [1, 1, 2, 1, 4, 1, 2, 1, 1, 1, 1], [3, 1, 1, 1, 4, 1, 1, 1, 3, 1, 1]);
}
if (level == 10) {
grid = new Array([1, 4, 1, 2, 1, 2, 1, 1, 1, 1, 1], [1, 1, 2, 1, 2, 1, 2, 1, 1, 1, 1], [3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 1], [3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 1], [1, 5, 1, 1, 5, 1, 1, 5, 1, 1, 5]);
}
if (level == 11) {
grid = new Array([1, 3, 1, 3, 1, 3, 1, 3, 1], [1, 4, 1, 4, 1, 4, 1, 4, 1], [1, 3, 1, 3, 1, 3, 1, 3, 1], [1, 3, 1, 3, 1, 3, 1, 3, 1]);
}
if (level == 12) {
grid = new Array([2, 1, 2, 1, 2, 1, 1, 1, 1], [2, 1, 2, 1, 2, 1, 1, 1, 1], [2, 1, 2, 1, 2, 1, 1, 1, 1], [2, 1, 2, 1, 2, 1, 1, 1, 1], [11, 11, 11, 11, 11, 11, 1, 1, 1]);
}
if (level == 13) {
grid = new Array([1, 3, 1, 3, 1, 3, 1, 3, 1], [3, 1, 3, 1, 3, 1, 3, 1, 3], [3, 1, 1, 1, 3, 1, 1, 1, 3], [3, 1, 3, 1, 3, 1, 3, 1, 3], [3, 1, 1, 1, 3, 1, 1, 1, 3]);
}
if (level == 14) {
grid = new Array([1, 2, 1, 2, 1, 2, 1, 2, 1], [1, 3, 1, 2, 1, 3, 1, 2, 1], [1, 2, 1, 3, 1, 2, 1, 3, 1], [1, 2, 1, 2, 1, 2, 1, 2, 1], [1, 1, 11, 1, 1, 1, 11, 1, 1]);
}
if (level == 15) {
grid = new Array([1, 9, 1, 9, 1, 1, 1, 9, 1, 9], [5, 1, 5, 1, 1, 1, 5, 1, 5, 1], [1, 12, 1, 12, 1, 1, 1, 12, 1, 12], [1, 13, 1, 13, 1, 1, 1, 13, 1, 13]);
}
if (level == 16) {
grid = new Array([3, 1, 4, 1, 2, 1, 4, 1, 3, 1, 1], [1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1], [4, 1, 3, 1, 4, 1, 3, 1, 4, 1, 1], [1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1], [3, 1, 4, 1, 2, 1, 4, 1, 3, 1, 1]);
}
if (level == 17) {
grid = new Array([4, 1, 4, 1, 1, 1, 4, 1, 4, 1, 1], [1, 1, 3, 1, 1, 1, 3, 1, 1, 1, 1], [1, 1, 1, 11, 11, 11, 1, 1, 1, 1, 1], [4, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1], [1, 4, 1, 4, 1, 4, 1, 4, 1, 1, 1]);
}
if (level == 18) {
grid = new Array([1, 1, 3, 1, 4, 1, 3, 1, 1, 1, 1], [3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 1], [4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 1], [3, 1, 3, 1, 2, 1, 3, 1, 3, 1, 1], [1, 1, 3, 1, 4, 1, 3, 1, 1, 1, 1]);
}
if (level == 19) {
grid = new Array([1, 6, 1, 1, 6, 1, 6, 1, 6, 1, 1], [1, 1, 6, 1, 6, 1, 6, 1, 1, 1, 6], [1, 1, 6, 1, 6, 1, 1, 1, 6, 1, 6], [1, 1, 6, 1, 6, 1, 1, 1, 1, 1, 1], [1, 6, 1, 1, 6, 1, 6, 1, 6, 1, 1]);
}
if (level == 20) {
grid = new Array([1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1], [1, 1, 1, 2, 1, 3, 1, 1, 1, 1, 1], [1, 1, 2, 1, 3, 1, 3, 1, 1, 1, 1], [1, 2, 1, 3, 1, 3, 1, 4, 1, 1, 1], [2, 1, 3, 1, 3, 1, 4, 1, 4, 1, 1]);
}
if (level == 21) {
grid = new Array([1, 13, 1, 13, 1, 1, 1, 13, 1, 13, 1], [1, 13, 1, 13, 1, 1, 1, 13, 1, 13, 1], [1, 4, 1, 3, 1, 4, 1, 3, 1, 1, 1], [1, 4, 1, 3, 1, 4, 1, 3, 1, 1, 1], [1, 13, 1, 13, 1, 1, 1, 13, 1, 13, 1]);
}
if (level == 22) {
grid = new Array([1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1], [3, 1, 1, 3, 1, 1, 3, 1, 1, 3, 1], [1, 3, 1, 1, 3, 1, 1, 3, 1, 1, 1], [4, 1, 1, 4, 1, 1, 4, 1, 1, 4, 1], [1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 1]);
}
if (level == 23) {
grid = new Array([1, 1, 4, 1, 3, 1, 4, 1, 1, 1, 1], [3, 1, 1, 4, 1, 4, 1, 1, 3, 1, 1], [1, 4, 1, 4, 1, 4, 1, 4, 1, 1, 1], [3, 1, 1, 4, 1, 4, 1, 1, 3, 1, 1], [1, 1, 4, 1, 3, 1, 4, 1, 1, 1, 1]);
}
if (level == 24) {
grid = new Array([3, 1, 3, 1, 1, 1, 3, 1, 3], [3, 1, 2, 1, 1, 1, 2, 1, 3], [2, 1, 3, 1, 1, 1, 3, 1, 2], [3, 1, 2, 1, 1, 1, 2, 1, 3], [11, 11, 1, 1, 1, 1, 1, 11, 11]);
}
if (level == 25) {
grid = new Array([4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 1], [3, 1, 4, 1, 1, 1, 4, 1, 3, 1, 1], [1, 3, 1, 4, 1, 4, 1, 3, 1, 1, 1], [1, 1, 3, 1, 4, 1, 3, 1, 1, 1, 1], [1, 1, 1, 4, 1, 4, 1, 1, 1, 1, 1]);
}
if (level == 26) {
movspeed = 10;
grid = new Array([4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1], [1, 1, 1, 1, 12, 12, 1, 1, 1, 1, 1], [4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1], [1, 1, 1, 1, 13, 13, 1, 1, 1, 1, 1], [4, 1, 1, 1, 4, 1, 1, 1, 4, 1, 1]);
}
if (level == 27) {
grid = new Array([11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11], [6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6], [7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7], [6, 1, 6, 1, 6, 1, 6, 1, 6, 1, 6], [7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7]);
}
if (level == 28) {
grid = new Array([11, 11, 1, 1, 1, 1, 2, 1, 3, 1, 1], [11, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1], [11, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1], [11, 1, 1, 1, 1, 1, 2, 1, 3, 1, 1], [11, 1, 1, 1, 1, 1, 11, 1, 11, 1, 1]);
}
if (level == 29) {
grid = new Array([1, 1, 1, 1, 7, 1, 7, 1, 7, 1, 7], [10, 1, 10, 1, 10, 1, 10, 1, 1, 1, 1], [1, 1, 7, 1, 7, 1, 7, 1, 7, 1, 1], [1, 1, 1, 1, 10, 1, 10, 1, 10, 1, 10], [7, 1, 7, 1, 7, 1, 7, 1, 1, 1, 1]);
}
if (level == 30) {
grid = new Array([4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 1], [3, 1, 4, 1, 3, 1, 4, 1, 3, 1, 1], [4, 1, 3, 1, 4, 1, 3, 1, 4, 1, 1], [2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 1], [3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 1]);
}
if (level == 31) {
grid = new Array([1, 9, 1, 9, 1, 1, 1, 12, 12, 12, 1], [10, 1, 9, 1, 9, 1, 12, 12, 12, 12, 12], [9, 1, 9, 1, 9, 1, 12, 12, 1, 1, 12], [9, 1, 9, 1, 9, 1, 1, 1, 1, 1, 12], [9, 1, 9, 1, 9, 1, 1, 12, 12, 12, 1]);
}
if (level == 32) {
grid = new Array([1, 10, 1, 10, 11, 1, 7, 1, 7, 1, 1], [10, 1, 10, 1, 1, 7, 1, 7, 1, 1, 1], [1, 10, 1, 10, 11, 1, 7, 1, 7, 1, 1], [10, 1, 10, 1, 1, 7, 1, 7, 1, 1, 1], [1, 10, 1, 10, 11, 1, 7, 1, 7, 1, 1]);
}
if (level == 33) {
grid = new Array([3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 1], [2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1], [3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 1], [2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1], [11, 1, 1, 1, 11, 1, 1, 1, 11, 1, 1]);
}
if (level == 34) {
grid = new Array([3, 1, 4, 1, 11, 1, 4, 1, 3, 1, 1], [3, 1, 4, 1, 11, 1, 4, 1, 3, 1, 1], [3, 1, 4, 1, 11, 1, 4, 1, 3, 1, 1], [3, 1, 4, 1, 11, 1, 4, 1, 3, 1, 1], [3, 1, 4, 1, 11, 1, 4, 1, 3, 1, 1]);
}
if (level == 35) {
grid = new Array([1, 1, 11, 1, 4, 1, 11, 1, 1, 1, 1], [1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 1], [11, 1, 4, 1, 4, 1, 4, 1, 11, 1, 1], [1, 4, 1, 1, 4, 1, 1, 4, 1, 1, 1], [4, 1, 11, 1, 4, 1, 11, 1, 4, 1, 1]);
}
if (level == 36) {
grid = new Array([1, 1, 10, 1, 10, 1, 10, 1, 1, 1, 1], [1, 1, 10, 1, 10, 1, 10, 1, 1, 1, 1], [1, 1, 10, 1, 10, 1, 10, 1, 12, 1, 1], [1, 1, 10, 1, 10, 1, 10, 1, 12, 1, 1], [1, 1, 12, 1, 12, 1, 12, 1, 1, 1, 1]);
}
if (level == 37) {
grid = new Array([4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 1], [4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 1], [4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 1], [4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 1], [4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 1]);
}
if (level == 38) {
grid = new Array([1, 1, 1, 4, 1, 4, 1, 1, 1, 1, 1], [1, 4, 1, 4, 1, 4, 1, 4, 1, 1, 1], [1, 4, 1, 4, 1, 4, 1, 4, 1, 1, 1], [4, 1, 1, 4, 1, 4, 1, 1, 4, 1, 1], [1, 1, 1, 11, 1, 11, 1, 1, 1, 1, 1]);
}
if (level == 39) {
grid = new Array([4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 1], [2, 1, 4, 1, 4, 1, 4, 1, 2, 1, 1], [2, 1, 4, 1, 4, 1, 4, 1, 2, 1, 1], [4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 1], [13, 1, 13, 1, 1, 1, 1, 1, 1, 1, 13]);
}
if (level == 40) {
grid = new Array([4, 1, 11, 1, 4, 1, 11, 1, 4, 1, 1], [4, 1, 11, 1, 4, 1, 11, 1, 4, 1, 1], [4, 1, 11, 1, 4, 1, 11, 1, 4, 1, 1], [4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 1], [4, 1, 11, 1, 4, 1, 11, 1, 4, 1, 1]);
}
if (editting) {
grid = new Array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
}
tilew = 55;
tileh = 55;
mapWidth = grid[0].length;
mapHeight = grid.length;
createEmptyMovieClip("blocks", 98);
blocks._x = 0;
blocks._y = 0;
blockdep = 1;
var i = 0;
while (i < mapHeight) {
var j = 0;
while (j < mapWidth) {
if (grid[i][j] != 1) {
blocks.attachMovie("tile", "tile" + blockdep, blockdep);
blocks["tile" + blockdep]._x = j * tilew;
blocks["tile" + blockdep]._y = i * tileh;
blocks["tile" + blockdep].gridx = j;
blocks["tile" + blockdep].gridy = i;
blocks["tile" + blockdep].gotoAndStop(grid[i][j]);
blocks["tile" + blockdep].istile = true;
blockdep++;
}
j++;
}
i++;
}
attachMovie("paddle", "pad", 97);
pad._x = 275;
pad._y = 560;
if (!editting) {
if (!gbeat) {
attachMovie("ball", "bal", 96);
} else {
attachMovie("ball2", "bal", 96);
}
}
bal._x = 275;
bal._y = 300;
pausee.swapDepths(400000);
bal.hmov = 0;
bal.vmov = 0;
bal.maxh = 15.5;
vcam._x = 275;
vcam._y = 300;
vshake = 0;
hshake = 0;
lvltext.lvl = "LEVEL " + level;
lvltext.swapDepths(100);
winner.swapDepths(101);
deadmsg.swapDepths(11000);
r = bal._width / 2;
b = 28.3;
hmov = 0;
tilt = 0;
maxh = 15;
vmov = 0;
hmov = 0;
maxt = 31;
diaghit = 0;
sttimer = 60;
die = false;
array = new Array(360);
go = false;
win = false;
scoreadj();
nodblsp = false;
createEmptyMovieClip("hearty", 2);
showhearts();
if (editting) {
attachMovie("cur", "cur", 999);
attachMovie("disblk", "disblk", 998);
disblk._x = 440;
disblk._y = 550;
maxchoice = disblk._totalframes;
choice = 1;
}
if (!editting) {
if (!gbeat) {
attachMovie("balltrail", "batr", 0);
} else {
attachMovie("ball2", "batr", 0);
}
}
batr._x = bal._x;
batr._y = bal._y;
fps = 30;
timer = 0;
onEnterFrame = function () {
timer++;
time = timer / fps;
if (editting) {
mlocx = _xmouse / tilew;
mlocx = int(mlocx);
mlocy = _ymouse / tileh;
mlocy = int(mlocy);
if (mlocy > 4) {
mlocy = 4;
}
cur._x = mlocx * tilew;
cur._y = mlocy * tileh;
disblk.gotoAndStop(choice);
if (Key.isDown(1)) {
grid[mlocy][mlocx] = choice;
forceupdate = true;
}
if (Key.isDown(68) and no68) {
no68 = false;
if (choice < maxchoice) {
choice++;
}
}
if (!Key.isDown(68)) {
no68 = true;
}
if (Key.isDown(65) and no65) {
no65 = false;
if (choice > 1) {
choice--;
}
}
if (!Key.isDown(65)) {
no65 = true;
}
if (Key.isDown(9) and noTAB) {
noTAB = false;
if (movspeed == 0) {
movspeed = 5;
} else {
movspeed = 0;
forceupdate = true;
}
}
if (!Key.isDown(9)) {
noTAB = true;
}
if (Key.isDown(16) and noSHIFT) {
noSHIFT = false;
w = 0;
while (w < grid.length) {
trace(("[" + grid[w]) + "],");
w++;
}
}
if (!Key.isDown(16)) {
noSHIFT = true;
}
if (forceupdate) {
forceupdate = false;
for (var _local4 in blocks) {
blocks[_local4].removeMovieClip();
}
var _local1 = 0;
while (_local1 < mapHeight) {
var _local2 = 0;
while (_local2 < mapWidth) {
if (grid[_local1][_local2] != 1) {
blocks.attachMovie("tile", "tile" + blockdep, blockdep);
blocks["tile" + blockdep]._x = _local2 * tilew;
blocks["tile" + blockdep]._y = _local1 * tileh;
blocks["tile" + blockdep].gridx = _local2;
blocks["tile" + blockdep].gridy = _local1;
blocks["tile" + blockdep].gotoAndStop(grid[_local1][_local2]);
blocks["tile" + blockdep].istile = true;
blockdep++;
}
_local2++;
}
_local1++;
}
}
} else {
if (Key.isDown(16) and noSHIFT) {
noSHIFT = false;
gotoAndPlay(_currentframe - 4);
}
if (!Key.isDown(16)) {
noSHIFT = true;
}
}
blockcnt = 0;
if (((Key.isDown(32) and (die != true)) and (win != true)) and (nodblsp == true)) {
nodblsp = false;
if (go != true) {
go = true;
lvltext._visible = false;
bal.vmov = 10;
} else if (paus == false) {
paus = true;
} else {
paus = false;
}
}
if (bal._y > 725) {
if ((die != true) and (win != true)) {
die = true;
gsong.stop();
death.start(0, 0);
songon = false;
deadmsg.gotoAndPlay(1);
attachMovie("explode", "expld", 10035);
expld._y = 607.1;
expld._x = bal._x;
vshake = bal.vmov;
}
bal.vmov = 0;
bal.hmov = 0;
}
if (!Key.isDown(32)) {
nodblsp = true;
}
if (!editting) {
for (var _local3 in blocks) {
if ((blocks[_local3].istile == true) and (blocks[_local3]._currentframe < 11)) {
blockcnt++;
}
}
if (blockcnt <= 0) {
if (win != true) {
win = true;
winner.gotoAndPlay(1);
}
}
}
batr._x = bal._x;
batr._y = bal._y;
vcam._y = 300 + vshake;
vshake = vshake * -0.9;
if (tilt > maxt) {
tilt = maxt;
}
if (tilt < (-maxt)) {
tilt = -maxt;
}
vshake = int(vshake);
vcam._x = 275 + hshake;
hshake = hshake * -0.9;
hshake = int(hshake);
if (pad._x < (0 + (pad._width / 2))) {
pad._x = 0 + (pad._width / 2);
if ((hitleft != true) and Key.isDown(37)) {
bounce.start(0, 0);
hitleft = true;
hshake = hmov;
if (go) {
bal.hmov = bal.hmov + (hmov / 2);
}
hmov = hmov * -0.5;
}
}
if (pad._x > (550 - (pad._width / 2))) {
pad._x = 550 - (pad._width / 2);
if ((hitright != true) and Key.isDown(39)) {
hitright = true;
bounce.start(0, 0);
hshake = hmov;
if (go) {
bal.hmov = bal.hmov + (hmov / 2);
}
hmov = hmov * -0.5;
}
}
if (!Key.isDown(37)) {
hitleft = false;
}
if (!Key.isDown(39)) {
hitright = false;
}
if (bal.hmov > bal.maxh) {
bal.hmov = bal.maxh;
}
if (bal.hmov < (-bal.maxh)) {
bal.hmov = -bal.maxh;
}
if (bal.vmov > bal.maxh) {
bal.vmov = bal.maxh;
}
if (bal.vmov < (-bal.maxh)) {
bal.vmov = -bal.maxh;
}
if (!paus) {
bal._x = bal._x + bal.hmov;
bal._y = bal._y + bal.vmov;
key = 0;
pad._rotation = tilt;
pad._x = pad._x + hmov;
pad._y = pad._y + vmov;
hmov = hmov * 0.9;
hmov = int(hmov);
vmov = vmov * 0.9;
vmov = int(vmov);
pausee._visible = false;
} else {
pausee._visible = true;
}
if (pad._y < 400) {
pad._y = 400;
vmov = 0;
}
if (pad._y > 650) {
pad._y = 650;
vmov = 0;
}
tilt = tilt * 0.8;
tilt = int(tilt);
if (Key.isDown(37)) {
hmov = hmov - 8;
tilt = tilt - 7;
}
if (Key.isDown(39)) {
hmov = hmov + 8;
tilt = tilt + 7;
}
if (Key.isDown(38)) {
vmov = vmov - 8;
}
if (Key.isDown(40)) {
vmov = vmov + 8;
}
paction(key);
if (go) {
var _local1 = 0;
while (_local1 < 360) {
x = bal._x + (r * Math.cos((_local1 / 180) * Math.PI));
y = bal._y - (r * Math.sin((_local1 / 180) * Math.PI));
(pad.padi.hitTest(x, y, true) ? ((array[_local1] = 1)) : ((array[_local1] = 0)));
_local1 = _local1 + 5;
}
}
strt = 0;
end = 0;
var _local1 = 0;
while (_local1 < 360) {
(((!last) and array[_local1]) ? ((strt = _local1)) : 0);
((last and (!array[_local1])) ? ((end = _local1)) : 0);
last = array[_local1];
_local1 = _local1 + 5;
}
((strt > end) ? ((angle = ((strt + end) / 2) + 180)) : ((angle = (strt + end) / 2)));
speed = Math.sqrt((bal.hmov * bal.hmov) + (bal.vmov * bal.vmov));
if (speed < 10) {
speed = 10;
}
if ((!dblhit) and (!die)) {
if (strt != end) {
bal.hmov = (-speed) * Math.sin(((angle + 90) / 180) * Math.PI);
bal.vmov = (-speed) * Math.cos(((angle + 90) / 180) * Math.PI);
dblhit = true;
dbltm = 5;
saveh = bal.hmov;
savev = bal.vmov;
bounce.start(0, 0);
bal.hmov = bal.hmov + hmov;
bal.vmov = bal.vmov + vmov;
hmov = hmov - saveh;
vmov = vmov - savev;
vshake = bal.vmov / 2;
}
}
if (dblhit) {
dbltm--;
if (dbltm < 0) {
dblhit = false;
}
}
if (((bal._x - r) < 0) and (bal.hmov < 0)) {
bal.hmov = bal.hmov * -1;
bounce.start(0, 0);
hshake = bal.hmov / 2;
}
if (((bal._x + r) > 550) and (bal.hmov > 0)) {
bal.hmov = bal.hmov * -1;
bounce.start(0, 0);
hshake = bal.hmov / 2;
}
if (((bal._y - r) < 0) and (bal.vmov < 0)) {
bal.vmov = bal.vmov * -1;
bounce.start(0, 0);
vshake = bal.vmov / 2;
}
};
Instance of Symbol 72 MovieClip in Frame 8
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Frame 9
for (var i in _root) {
removeMovieClip(_root[i]);
}
gotoAndStop(_currentframe + 1);
Frame 10
function scoreadj() {
if (score < 1000000) {
aaa.aab.aaa = "SCORE:0" + bsc;
} else {
aaa.aab.aaa = "SCORE:" + bsc;
}
if (score < 100000) {
aaa.aab.aaa = "SCORE:00" + bsc;
}
if (score < 10000) {
aaa.aab.aaa = "SCORE:000" + bsc;
}
if (score < 1000) {
aaa.aab.aaa = "SCORE:0000" + bsc;
}
if (score < 100) {
aaa.aab.aaa = "SCORE:00000" + bsc;
}
if (score < 10) {
aaa.aab.aaa = "SCORE:000000" + bsc;
}
}
function scoreadjb() {
if (score < 1000000) {
aaa.aab.ddd = "FINAL:0" + sc;
} else {
aaa.aab.ddd = "FINAL:" + sc;
}
if (score < 100000) {
aaa.aab.ddd = "FINAL:00" + sc;
}
if (score < 10000) {
aaa.aab.ddd = "FINAL:000" + sc;
}
if (score < 1000) {
aaa.aab.ddd = "FINAL:0000" + sc;
}
if (score < 100) {
aaa.aab.ddd = "FINAL:00000" + sc;
}
if (score < 10) {
aaa.aab.ddd = "FINAL:000000" + sc;
}
}
stop();
bsc = 0;
gostat = 1;
time = int(time);
multi = 1.5 - (time / 120);
createEmptyMovieClip("hearty", 2);
showhearts();
if (multi < 1) {
multi = 1;
}
multi = int(multi * 100) / 100;
bscore = score;
scinc = int(bscore / 25);
score = score * multi;
score = int(score);
sc = 0;
tscinc = int(score / 25);
onEnterFrame = function () {
scoreadj();
if (bsc < bscore) {
bsc = bsc + scinc;
popb.start(0, 0);
} else if (gostat == 1) {
gostat = 2;
}
if (bsc > bscore) {
bsc = bscore;
}
if (gostat == 2) {
setTimeout(function () {
if (gostat == 2) {
aaa.aab.bbb = "TIME: " + time;
gostat = 3;
pop.start(0, 0);
}
}, 400);
}
if (gostat == 3) {
setTimeout(function () {
if (gostat == 3) {
aaa.aab.ccc = "MULTI: x" + multi;
gostat = 4;
pop.start(0, 0);
}
}, 400);
}
if (gostat == 4) {
setTimeout(function () {
if (gostat == 4) {
scoreadjb();
if (sc < score) {
sc = sc + tscinc;
popb.start(0, 0);
} else {
gostat = 5;
}
if (sc > score) {
sc = score;
}
}
}, 400);
}
if (gostat == 5) {
setTimeout(function () {
if (gostat == 5) {
gostat = 6;
for (var _local2 in _root) {
removeMovieClip(_root[_local2]);
}
if (level > 40) {
gbeat = true;
savefile.data.gbt = gbeat;
gotoAndStop(_currentframe + 3);
} else {
gotoAndStop(_currentframe - 2);
}
}
}, 800);
}
};
Frame 11
for (var i in _root) {
removeMovieClip(_root[i]);
}
gotoAndStop(_currentframe + 1);
Frame 12
function scoreadjd() {
if (score < 1000000) {
aaa.aab.aaa = "0" + bsc;
} else {
aaa.aab.aaa = bsc;
}
if (score < 100000) {
aaa.aab.aaa = "00" + bsc;
}
if (score < 10000) {
aaa.aab.aaa = "000" + bsc;
}
if (score < 1000) {
aaa.aab.aaa = "0000" + bsc;
}
if (score < 100) {
aaa.aab.aaa = "00000" + bsc;
}
if (score < 10) {
aaa.aab.aaa = "000000" + bsc;
}
}
stop();
bsc = 0;
noSPACE = false;
if (gameover) {
gsong.stop();
}
slct = 0;
gostat = 0;
time = int(time);
multi = 1;
createEmptyMovieClip("hearty", 2);
repl._visible = false;
showhearts();
if (multi < 1) {
multi = 1;
}
scinc = int(score / 70);
if (scinc < 1) {
scinc = 1;
}
sc = 0;
aaa.aab.aaa = "0000000";
tscinc = int(score / 70);
if (level > 40) {
gvertxt.gotoAndStop(2);
}
if (highscore2 == null) {
highscore2 = 0;
}
if (highscore2 < 1000000) {
hscr.aaa.hsc = "0" + highscore2;
} else {
hscr.aaa.hsc = highscore2;
}
if (highscore2 < 100000) {
hscr.aaa.hsc = "00" + highscore2;
}
if (highscore2 < 10000) {
hscr.aaa.hsc = "000" + highscore2;
}
if (highscore2 < 1000) {
hscr.aaa.hsc = "0000" + highscore2;
}
if (highscore2 < 100) {
hscr.aaa.hsc = "00000" + highscore2;
}
if (highscore2 < 10) {
hscr.aaa.hsc = "000000" + highscore2;
}
onEnterFrame = function () {
if (gostat == 0) {
setTimeout(function () {
if (gostat == 0) {
gostat = 1;
}
}, 400);
}
if (gostat == 1) {
scoreadjd();
if (bsc < score) {
bsc = bsc + scinc;
if (bsc < score) {
popb.start(0, 0);
} else {
pop.start(0, 0);
}
} else if (gostat == 1) {
gostat = 2;
slct = 1;
}
}
if (gostat == 2) {
setTimeout(function () {
if (gostat == 2) {
gostat = 3;
if (score > highscore2) {
hscr.aaa.gotoAndStop(2);
highscore2 = score;
savefile.data.highsc = highscore2;
hscr.aaa.hsc = highscore2;
if (highscore2 < 1000000) {
hscr.aaa.hsc = "0" + highscore2;
} else {
hscr.aaa.hsc = highscore2;
}
if (highscore2 < 100000) {
hscr.aaa.hsc = "00" + highscore2;
}
if (highscore2 < 10000) {
hscr.aaa.hsc = "000" + highscore2;
}
if (highscore2 < 1000) {
hscr.aaa.hsc = "0000" + highscore2;
}
if (highscore2 < 100) {
hscr.aaa.hsc = "00000" + highscore2;
}
if (highscore2 < 10) {
hscr.aaa.hsc = "000000" + highscore2;
}
}
cheer.start(0, 0);
}
}, 400);
}
if (gostat == 3) {
repl._visible = true;
slct = 2;
if (Key.isDown(32) and (noSPACE == true)) {
if (slct == 2) {
tick.start(0, 0);
gotoAndPlay (4);
}
}
if (!Key.isDown(32)) {
noSPACE = true;
}
} else {
slct = 0;
}
if (slct == 0) {
sub.gotoAndStop(1);
repl.gotoAndStop(1);
}
if (slct == 1) {
sub.gotoAndStop(2);
repl.gotoAndStop(1);
}
if (slct == 2) {
sub.gotoAndStop(1);
repl.gotoAndStop(2);
}
if (bsc > score) {
bsc = score;
}
};
Frame 13
cheer.start(0, 0);
onEnterFrame = function () {
if (Key.isDown(32)) {
tick.start(0, 0);
gotoAndStop(_currentframe - 1);
}
};
Instance of Symbol 14 MovieClip in Symbol 15 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Instance of Symbol 20 MovieClip in Symbol 21 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 22 MovieClip Frame 16
stop();
Instance of Symbol 24 MovieClip in Symbol 25 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 29 MovieClip [paddle] Frame 1
stop();
Instance of Symbol 38 MovieClip in Symbol 40 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 47 MovieClip Frame 5
_parent.removeMovieClip();
stop();
Symbol 49 MovieClip [tile] Frame 2
stop();
Symbol 49 MovieClip [tile] Frame 3
stop();
Symbol 49 MovieClip [tile] Frame 4
stop();
if (movrbl == true) {
gotoAndStop (1);
}
Symbol 49 MovieClip [tile] Frame 5
onEnterFrame = function () {
_x = (_x + _root.movspeed);
if (_x > (_root.tilew * 10)) {
_x = (_root.tilew * -2);
}
movrbl = true;
};
Symbol 49 MovieClip [tile] Frame 6
onEnterFrame = function () {
_x = (_x + _root.movspeed);
if (_x > (_root.tilew * 10)) {
_x = (_root.tilew * -2);
}
movrbl = true;
};
Symbol 49 MovieClip [tile] Frame 7
onEnterFrame = function () {
_x = (_x + _root.movspeed);
if (_x > (_root.tilew * 10)) {
_x = (_root.tilew * -2);
}
movrbl = true;
};
if (movlbl == true) {
gotoAndStop (1);
}
Symbol 49 MovieClip [tile] Frame 8
onEnterFrame = function () {
_x = (_x - _root.movspeed);
if (_x < (_root.tilew * -2)) {
_x = (_root.tilew * 10);
}
movlbl = true;
};
Symbol 49 MovieClip [tile] Frame 9
onEnterFrame = function () {
_x = (_x - _root.movspeed);
if (_x < (_root.tilew * -2)) {
_x = (_root.tilew * 10);
}
movlbl = true;
};
Symbol 49 MovieClip [tile] Frame 10
onEnterFrame = function () {
_x = (_x - _root.movspeed);
if (_x < (_root.tilew * -2)) {
_x = (_root.tilew * 10);
}
movlbl = true;
};
Symbol 49 MovieClip [tile] Frame 12
onEnterFrame = function () {
_x = (_x - _root.movspeed);
if (_x < (_root.tilew * -2)) {
_x = (_root.tilew * 10);
}
movlbl = true;
};
Symbol 49 MovieClip [tile] Frame 13
onEnterFrame = function () {
_x = (_x + _root.movspeed);
if (_x > (_root.tilew * 10)) {
_x = (_root.tilew * -2);
}
movrbl = true;
};
Instance of Symbol 52 MovieClip in Symbol 53 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Instance of Symbol 57 MovieClip "h2" in Symbol 58 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 59 MovieClip [heartmulti] Frame 1
h1.h2.nlives = "x" + _root.lives;
Symbol 67 MovieClip [explode] Frame 20
stop();
Instance of Symbol 74 MovieClip in Symbol 75 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 180 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.3");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}};
options = _parseOptions(options, _local27);
if ("5cc6f7dfb67f2f08341c831480f7c2a7".length == 0) {
options.ad_started();
options.ad_finished();
return(undefined);
}
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
options.ad_failed();
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}, ad_failed:function () {
trace("[MochAd] Couldn't load an ad, make sure that your game's local security sandbox is configured for Access Network Only and that you are not using ad blocking software");
}, ad_loaded:function (width, height) {
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_failed();
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = options.ad_loaded;
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
options.ad_failed();
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
trace("[MochiAd] DEPRECATED: showTimedAd was renamed to showInterLevelAd in 2.0");
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
trace("[MochiAd] DEPRECATED: showPreloaderAd was renamed to showPreGameAd in 2.0");
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
if (_local4.id == "test") {
trace("[MochiAd] WARNING: Using the MochiAds test identifier, make sure to use the code from your dashboard, not this example!");
}
return(_local4);
}
}
Instance of Symbol 72 MovieClip in Symbol 77 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Instance of Symbol 80 MovieClip in Symbol 81 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Instance of Symbol 83 MovieClip in Symbol 84 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Instance of Symbol 86 MovieClip in Symbol 87 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 90 MovieClip Frame 95
_root.gotoAndPlay(_root._currentframe + 1);
stop();
Symbol 91 MovieClip Frame 1
stop();
Symbol 93 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 1
stop();
Instance of Symbol 97 MovieClip in Symbol 98 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 99 MovieClip Frame 27
_root.ssnd.start(0, 0);
Symbol 99 MovieClip Frame 31
_root.selct = 1;
Symbol 99 MovieClip Frame 91
stop();
Instance of Symbol 101 MovieClip in Symbol 102 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 103 MovieClip Frame 83
stop();
Instance of Symbol 105 MovieClip in Symbol 106 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 107 MovieClip Frame 79
stop();
Instance of Symbol 109 MovieClip in Symbol 110 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 123 MovieClip Frame 1
function camControl() {
parentColor.setTransform(camColor.getTransform());
var _local4 = sX / this._width;
var _local3 = sY / this._height;
_parent._x = cX - (this._x * _local4);
_parent._y = cY - (this._y * _local3);
_parent._xscale = 100 * _local4;
_parent._yscale = 100 * _local3;
}
function resetStage() {
var _local2 = {ra:100, rb:0, ga:100, gb:0, ba:100, bb:0, aa:100, ab:0};
parentColor.setTransform(_local2);
_parent._xscale = 100;
_parent._yscale = 100;
_parent._x = 0;
_parent._y = 0;
}
this._visible = true;
var oldMode = Stage.scaleMode;
Stage.scaleMode = "exactFit";
var cX = (Stage.width / 2);
var cY = (Stage.height / 2);
var sX = Stage.width;
var sY = Stage.height;
Stage.scaleMode = oldMode;
var camColor = new Color(this);
var parentColor = new Color(_parent);
this.onEnterFrame = camControl;
camControl();
this.onUnload = resetStage;
Instance of Symbol 125 MovieClip in Symbol 126 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 127 MovieClip Frame 1
stop();
Symbol 127 MovieClip Frame 11
if ((_root.level + 1) > _root.maxlvl) {
_root.maxlvl = _root.level + 1;
_root.savefile.data.mxlv = _root.level + 1;
}
Symbol 127 MovieClip Frame 116
_root.level = _root.level + 1;
_root.gotoAndPlay(_root._currentframe + 1);
stop();
Symbol 130 MovieClip Frame 1
lvl = "LEVEL " + _root.level;
Instance of Symbol 130 MovieClip in Symbol 131 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Instance of Symbol 133 MovieClip in Symbol 134 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 135 MovieClip Frame 1
stop();
Symbol 135 MovieClip Frame 15
_root.lives = _root.lives - 1;
_root.showhearts();
Symbol 135 MovieClip Frame 75
if (_root.lives < 0) {
_root.gameover = true;
_root.gotoAndPlay(_root._currentframe + 4);
stop();
}
_root.gotoAndPlay(_root._currentframe - 1);
stop();
Instance of Symbol 137 MovieClip "scorea" in Symbol 138 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 140 MovieClip Frame 10
cnt++;
if (cnt > 4) {
_parent._visible = false;
}
Symbol 141 MovieClip Frame 1
arr.cnt = 0;
Instance of Symbol 140 MovieClip "arr" in Symbol 141 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Instance of Symbol 143 MovieClip in Symbol 144 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Instance of Symbol 147 MovieClip "ttt" in Symbol 148 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Instance of Symbol 153 MovieClip "aab" in Symbol 154 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Instance of Symbol 157 MovieClip "aab" in Symbol 158 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 164 MovieClip Frame 1
stop();
Instance of Symbol 161 MovieClip in Symbol 164 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Instance of Symbol 163 MovieClip in Symbol 164 MovieClip Frame 2
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Instance of Symbol 166 MovieClip in Symbol 167 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Symbol 172 MovieClip Frame 1
stop();
Symbol 172 MovieClip Frame 2
cnt = 0;
cnt2 = 0;
_root.dingr.start(0, 0);
onEnterFrame = function () {
cnt2++;
if (cnt2 < 50) {
cnt++;
if (cnt > 2) {
ata._visible = false;
} else {
ata._visible = true;
}
if (cnt > 4) {
cnt = 0;
}
} else {
ata._visible = true;
}
};
Instance of Symbol 172 MovieClip "aaa" in Symbol 173 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Instance of Symbol 175 MovieClip in Symbol 176 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}
Instance of Symbol 178 MovieClip in Symbol 179 MovieClip Frame 1
onClipEvent (load) {
new Color(this).setRGB(_root.lvlcolor);
}