Frame 1
function bitOR(a, b) {
var lsb = ((a & 1) | (b & 1));
var msb31 = ((a >>> 1) | (b >>> 1));
return((msb31 << 1) | lsb);
}
function bitXOR(a, b) {
var lsb = ((a & 1) ^ (b & 1));
var msb31 = ((a >>> 1) ^ (b >>> 1));
return((msb31 << 1) | lsb);
}
function bitAND(a, b) {
var lsb = ((a & 1) & (b & 1));
var msb31 = ((a >>> 1) & (b >>> 1));
return((msb31 << 1) | lsb);
}
function addme(x, y) {
var lsw = ((x & 65535) + (y & 65535));
var msw = (((x >> 16) + (y >> 16)) + (lsw >> 16));
return((msw << 16) | (lsw & 65535));
}
function rhex(num) {
str = "";
j = 0;
while (j <= 3) {
str = str + (hex_chr.charAt((num >> ((j * 8) + 4)) & 15) + hex_chr.charAt((num >> (j * 8)) & 15));
j++;
}
return(str);
}
function str2blks_MD5(str) {
nblk = ((str.length + 8) >> 6) + 1;
blks = new Array(nblk * 16);
i = 0;
while (i < (nblk * 16)) {
blks[i] = 0;
i++;
}
i = 0;
while (i < str.length) {
blks[i >> 2] = blks[i >> 2] | (str.charCodeAt(i) << ((((str.length * 8) + i) % 4) * 8));
i++;
}
blks[i >> 2] = blks[i >> 2] | (128 << ((((str.length * 8) + i) % 4) * 8));
var l = (str.length * 8);
blks[(nblk * 16) - 2] = l & 255;
blks[(nblk * 16) - 2] = blks[(nblk * 16) - 2] | (((l >>> 8) & 255) << 8);
blks[(nblk * 16) - 2] = blks[(nblk * 16) - 2] | (((l >>> 16) & 255) << 16);
blks[(nblk * 16) - 2] = blks[(nblk * 16) - 2] | (((l >>> 24) & 255) << 24);
return(blks);
}
function rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
function cmn(q, a, b, x, s, t) {
return(addme(rol(addme(addme(a, q), addme(x, t)), s), b));
}
function ff(a, b, c, d, x, s, t) {
return(cmn(bitOR(bitAND(b, c), bitAND(~b, d)), a, b, x, s, t));
}
function gg(a, b, c, d, x, s, t) {
return(cmn(bitOR(bitAND(b, d), bitAND(c, ~d)), a, b, x, s, t));
}
function hh(a, b, c, d, x, s, t) {
return(cmn(bitXOR(bitXOR(b, c), d), a, b, x, s, t));
}
function ii(a, b, c, d, x, s, t) {
return(cmn(bitXOR(c, bitOR(b, ~d)), a, b, x, s, t));
}
function calcMD5(str) {
x = str2blks_MD5(str);
a = 1732584193 /* 0x67452301 */;
b = -271733879;
c = -1732584194;
d = 271733878 /* 0x10325476 */;
var step;
i = 0;
while (i < x.length) {
olda = a;
oldb = b;
oldc = c;
oldd = d;
step = 0;
a = ff(a, b, c, d, x[i + 0], 7, -680876936);
d = ff(d, a, b, c, x[i + 1], 12, -389564586);
c = ff(c, d, a, b, x[i + 2], 17, 606105819);
b = ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = ff(a, b, c, d, x[i + 4], 7, -176418897);
d = ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = ff(b, c, d, a, x[i + 7], 22, -45705983);
a = ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = ff(c, d, a, b, x[i + 10], 17, -42063);
b = ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = ff(d, a, b, c, x[i + 13], 12, -40341101);
c = ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = gg(a, b, c, d, x[i + 1], 5, -165796510);
d = gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = gg(c, d, a, b, x[i + 11], 14, 643717713);
b = gg(b, c, d, a, x[i + 0], 20, -373897302);
a = gg(a, b, c, d, x[i + 5], 5, -701558691);
d = gg(d, a, b, c, x[i + 10], 9, 38016083);
c = gg(c, d, a, b, x[i + 15], 14, -660478335);
b = gg(b, c, d, a, x[i + 4], 20, -405537848);
a = gg(a, b, c, d, x[i + 9], 5, 568446438);
d = gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = gg(c, d, a, b, x[i + 3], 14, -187363961);
b = gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = gg(d, a, b, c, x[i + 2], 9, -51403784);
c = gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = hh(a, b, c, d, x[i + 5], 4, -378558);
d = hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = hh(b, c, d, a, x[i + 14], 23, -35309556);
a = hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = hh(c, d, a, b, x[i + 7], 16, -155497632);
b = hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = hh(a, b, c, d, x[i + 13], 4, 681279174);
d = hh(d, a, b, c, x[i + 0], 11, -358537222);
c = hh(c, d, a, b, x[i + 3], 16, -722521979);
b = hh(b, c, d, a, x[i + 6], 23, 76029189);
a = hh(a, b, c, d, x[i + 9], 4, -640364487);
d = hh(d, a, b, c, x[i + 12], 11, -421815835);
c = hh(c, d, a, b, x[i + 15], 16, 530742520);
b = hh(b, c, d, a, x[i + 2], 23, -995338651);
a = ii(a, b, c, d, x[i + 0], 6, -198630844);
d = ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = ii(b, c, d, a, x[i + 5], 21, -57434055);
a = ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = ii(c, d, a, b, x[i + 10], 15, -1051523);
b = ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = ii(d, a, b, c, x[i + 15], 10, -30611744);
c = ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = ii(a, b, c, d, x[i + 4], 6, -145523070);
d = ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = ii(c, d, a, b, x[i + 2], 15, 718787259);
b = ii(b, c, d, a, x[i + 9], 21, -343485551);
a = addme(a, olda);
b = addme(b, oldb);
c = addme(c, oldc);
d = addme(d, oldd);
i = i + 16;
}
return(((rhex(a) + rhex(b)) + rhex(c)) + rhex(d));
}
function levelclearup() {
if (Math.floor(this.nyc) == this.nyc) {
nm = "ball" + this.nyc;
if (field[nm]._currentframe > 1) {
field[nm].gotoAndStop(1);
field[nm].fademe.play();
soundobj.popone.start(0, 1);
this.nyc = this.nyc + 0.5;
} else {
this.nyc = this.nyc + 1;
}
} else {
this.nyc = this.nyc + 0.5;
}
if (this.nyc == (gwid * (ghei + 2))) {
field.dests = 1700;
field.destr = 170;
field.onEnterFrame = zoomto;
field.zoomrate = 0.05;
this.onEnterFrame = null;
}
}
function leveldrawup() {
if (field.dests == field._xscale) {
if (Math.floor(this.nyc) == this.nyc) {
var j = (this.nyc % gwid);
var i = Math.floor(this.nyc / gwid);
if (gamegrid[i][j] > 1) {
nm = "ball" + this.nyc;
field[nm].gotoAndStop(gamegrid[i][j]);
soundobj.popone.start(0, 1);
field[nm].fademe.play();
this.nyc = this.nyc + 0.5;
} else {
this.nyc = this.nyc + 1;
}
} else {
this.nyc = this.nyc + 0.5;
}
if (this.nyc == (gwid * (ghei + 2))) {
this.onEnterFrame = null;
timedtitle();
}
}
}
function summarizeGame() {
_root.createEmptyMovieClip("summary", 344);
summary.nyc = 0;
summary.onEnterFrame = levelclearup;
mainframe.continuebutton._visible = true;
mainframe.levelstatbox._visible = true;
mainframe.levelsummary.text = ((("Wave " + level) + " Cleared") + newline) + "Prepare to Warp";
}
function handleGameOver() {
clearInterval(gotimer);
mainframe.boxback._visible = false;
ball.removeMovieClip();
if (mousehide) {
Mouse.show();
}
title._visible = true;
title.swirly.restartme();
_level5._x = 100;
_level5._y = 100;
_level5.dosubmit(score, 3);
_root.instructions.gotoAndStop(3);
_root.instructions._visible = true;
}
function handleprogresslevel() {
mainframe.levelstatbox._visible = false;
mainframe.levelsummary.text = "";
mainframe.continuebutton._visible = false;
mainframe.boxback._visible = false;
clearInterval(goltimer);
goltimer = null;
ball.removeMovieClip();
level++;
startgame();
}
stop();
var hex_chr = "0123456789abcdef";
loader.swapDepths(90000);
goltimer = null;
mainframe.boxback._visible = false;
mainframe.pausebutton._visible = false;
mainframe.pauseback._visible = false;
mainframe.levelstatbox._visible = false;
mainframe.continuebutton._visible = false;
instructions.swapDepths(10002);
instructions._visible = false;
_root.createEmptyMovieClip("soundobj", 8960);
soundobj.drop = new Sound(soundobj);
soundobj.drop.attachSound("drop");
soundobj.beep1 = new Sound(soundobj);
soundobj.beep1.attachSound("beep1");
soundobj.autodrop = new Sound(soundobj);
soundobj.autodrop.attachSound("autodrop");
soundobj.novasfx = new Sound(soundobj);
soundobj.novasfx.attachSound("novasfx");
soundobj.spacedrone = new Sound(soundobj);
soundobj.spacedrone.attachSound("spacedrone");
soundobj.movement = new Sound(soundobj);
soundobj.movement.attachSound("movement");
soundobj.descend = new Sound(soundobj);
soundobj.descend.attachSound("descend");
soundobj.gameover = new Sound(soundobj);
soundobj.gameover.attachSound("gameover");
soundobj.autodrop = new Sound(soundobj);
soundobj.autodrop.attachSound("autodrop");
soundobj.clear1 = new Sound(soundobj);
soundobj.clear1.attachSound("clear1");
soundobj.clear2 = new Sound(soundobj);
soundobj.clear2.attachSound("clear2");
soundobj.clear5 = new Sound(soundobj);
soundobj.clear5.attachSound("clear5");
soundobj.addrow = new Sound(soundobj);
soundobj.addrow.attachSound("addrow");
soundobj.popone = new Sound(soundobj);
soundobj.popone.attachSound("popone");
_root.createEmptyMovieClip("wsoundobj", 8961);
wsoundobj.warning = new Sound(wsoundobj);
wsoundobj.warning.attachSound("warning");
wsoundobj.warningslow = new Sound(wsoundobj);
wsoundobj.warningslow.attachSound("warningslow");
_root.createEmptyMovieClip("msoundobj", 9988);
loadMovieNum ("songpack.swf", 6);
msoundobj.internalsong = new Sound(msoundobj);
msoundobj.internalsong.attachSound("internalsong");
moveoff = 0;
numsteps = 3;
startlevel = 1;
cursong = 0;
numsongs = 7;
musicon = true;
mousehide = false;
_root.qual = "MEDIUM";
_quality = _root.qual;
req = 3;
cx = 263;
cy = 275;
gwid = (nump = 8);
da = (Math.PI*2) / nump;
ghei = (rows = 9);
rad = 40;
oc = 0;
rowrads = new Array();
gamegrid = new Array();
matchg = new Array();
gridpos = new Array();
r360 = (Math.PI*2);
finals = new Array(2, 3, 4, 5, 6, 7, 8);
_root.createEmptyMovieClip("field", 1);
field.c = new Color(field);
field._x = cx;
field._y = cy;
field.dests = 100;
_root.attachMovie("theclaw", "theclaw", 99);
theclaw._y = -2000;
theclaw.tbeam.gotoAndStop(1);
surrounder.swapDepths(10000);
mainframe.swapDepths(101);
mainframe.nextball.arrow._visible = false;
mainframe.nextball.tbeam.stop();
mainframe.nextball.tbeam._visible = false;
mainframe.nextball.grid._visible = false;
mainframe.nextball.bKatras._visible = false;
mainframe.nextball.vKatras.gotoAndStop(2);
stopcursong = function () {
msoundobj.internalsong.stop();
var nm = ("song" add (Math.floor(cursong) + 1));
_level6[nm].stop();
};
startcursong = function () {
if (musicon) {
if (_level6.getBytesLoaded() != _level6.getBytesTotal()) {
msoundobj.internalsong.start(0, 9999);
} else {
var nm = ("song" add (Math.floor(cursong) + 1));
_level6[nm].setVolume(70);
_level6[nm].start(0, 9999);
}
}
};
title.swapDepths(102);
title.playButton.onRelease = function () {
title._visible = false;
score = 0;
level = 1;
displayScore();
startgame();
};
mainframe.quitButton.onRelease = function () {
ball.removeMovieClip();
clearInterval(titleTimer);
clearInterval(goTimer);
field.onEnterFrame = null;
summary.onEnterFrame = null;
drawup.onEnterFrame = null;
_root.onEnterFrame = null;
mainframe.levelstatbox._visible = false;
mainframe.levelsummary.text = "";
mainframe.continuebutton._visible = false;
mainframe.boxback._visible = false;
wsoundobj.warningslow.stop();
wsoundobj.warning.stop();
stopcursong();
_root.soundobj.spacedrone.start(0, 9991);
if (mousehide) {
Mouse.show();
}
title._visible = true;
title.swirly.restartme();
};
paused = false;
mainframe.pausebutton.onPress = function () {
if (paused == false) {
if (mousehide) {
Mouse.show();
}
doTitle("PAUSED");
mainframe.pauseback._visible = true;
paused = true;
ball.onMouseUp = null;
ball.onEnterFrame = null;
} else {
if (mousehide) {
Mouse.hide();
}
clearTitle();
mainframe.pauseback._visible = false;
paused = false;
ball.onEnterFrame = moveball;
ball.onMouseUp = startfallmouse;
}
};
doTitle = function (message) {
mainframe.supertitle.text = message;
mainframe.supertitleb.text = message;
mainframe.boxback._visible = true;
};
cleartitle = function () {
mainframe.supertitle.text = "";
mainframe.supertitleb.text = "";
mainframe.boxback._visible = false;
};
timedtitle = function () {
cleartitle();
clearmatchg();
createBall();
clearInterval(titleTimer);
};
startgame = function () {
if (mousehide) {
Mouse.hide();
}
_level5.clear_screen();
mainframe.leveltext.text = level;
need = Math.floor(level * 5) + 15;
if (need > 60) {
need = 60;
}
clearsince = 1;
playmove = 0;
inANova = false;
mainframe.needtext.text = need;
stopcursong();
startcursong();
cursong = cursong + 0.5;
cursong = cursong % numsongs;
_root.soundobj.spacedrone.stop();
field._x = cx;
field._y = cy;
if (level < 4) {
field.dests = 170;
field.destr = 0;
field.onEnterFrame = zoomto;
field.zoomrate = 0.3;
field._xscale = (field._yscale = 1);
field._rotation = 40;
} else {
field.dests = 100;
field.destr = 0;
field.onEnterFrame = zoomto;
field.zoomrate = 0.3;
field._xscale = (field._yscale = 1);
field._rotation = 40;
}
if (level < 4) {
dropwarns = 4;
mainframe.dropwarning1._visible = false;
mainframe.dropwarning2._visible = false;
mainframe.dropwarning._visible = true;
} else if (level < 7) {
dropwarns = 3;
mainframe.dropwarning1._visible = false;
mainframe.dropwarning2._visible = true;
mainframe.dropwarning._visible = false;
} else {
dropwarns = 2;
mainframe.dropwarning1._visible = true;
mainframe.dropwarning2._visible = false;
mainframe.dropwarning._visible = false;
}
theclaw._y = -2000;
theclaw.tbeam.gotoAndStop(1);
moveoff = 0;
numsteps = 6;
_quality = _root.qual;
req = 3;
cx = 263;
cy = 275;
gwid = (nump = 8);
da = (Math.PI*2) / nump;
ghei = (rows = 9);
rad = 40;
oc = 0;
maxdiffpieces = Math.ceil(level) + 3;
if (maxdiffpieces > 7) {
maxdiffpieces = 7;
}
maxrows = Math.ceil(level) + 2;
if (maxrows > 6) {
maxrows = 6;
}
i = 0;
while (i < (rows + 2)) {
rowrads[i] = rad;
gamegrid[i] = new Array();
matchg[i] = new Array();
gridpos[i] = new Array();
da = (Math.PI*2) / nump;
angoff = ((i % 2) * da) / 2;
j = 0;
while (j < nump) {
nm2 = "grid" + oc;
if (i <= 8) {
field.attachMovie("gridunit", nm2, oc);
field[nm2]._x = Math.cos((j * da) + angoff) * rad;
field[nm2]._y = Math.sin((j * da) + angoff) * rad;
field[nm2]._yscale = (field[nm2]._xscale = rad / 2.63999382654604);
field[nm2]._rotation = ((j * da) + angoff) * 57.2957795130823;
if (i == 4) {
field[nm2].grid.gotoAndStop(2);
} else if (i == 8) {
field[nm2].grid.gotoAndStop(3);
} else {
field[nm2].grid.gotoAndStop(3 + level);
}
}
nm = "ball" + oc;
field.attachMovie("ball", nm, oc + 900);
gridpos[i][j] = oc;
field[nm]._x = Math.cos((j * da) + angoff) * rad;
field[nm]._y = Math.sin((j * da) + angoff) * rad;
field[nm]._yscale = (field[nm]._xscale = rad / 2.63999382654604);
field[nm]._rotation = ((j * da) + angoff) * 57.2957795130823;
field[nm].arrow._visible = false;
field[nm].tbeam.stop();
field[nm].tbeam._visible = false;
if (i < maxrows) {
gamegrid[i][j] = random(maxdiffpieces) + 2;
} else {
gamegrid[i][j] = 1;
}
oc++;
j++;
}
rad = rad + (rad * 0.2);
i++;
}
rowrads[i] = rad;
nextp = random(maxdiffpieces) + 2;
mainframe.nextball.vKatras.gotoAndStop(nextp);
centx = 263;
centy = 275;
var da = ((Math.PI*2) / nump);
dropspeed = 0;
shimmy = 0;
doTitle("WAVE " + level);
_root.createEmptyMovieClip("drawup", 344);
drawup.nyc = 0;
drawup.onEnterFrame = leveldrawup;
};
moveball = function () {
var tmpd = (level / 1.7);
if (tmpd < 1) {
tmpd = 1;
}
if (tmpd > 6) {
tmpd = 6;
}
if (dropspeed == 0) {
shimmy = shimmy + (tmpd * 0.03);
} else {
shimmy = 0;
}
this.rowi = Math.floor(this.rad / 30);
this.actrow = rowrads[this.rowi];
this.offang = (this.rowi % 2) * (da / 2);
this.angi = (Math.floor((this.ang + this.offang) / da) + 32) % nump;
this.actang = this.angi * da;
var rowdiff = (rowrads[this.rowi + 1] - this.actrow);
var radstage = (((this.rad / 30) - this.rowi) * rowdiff);
if (dropspeed == 0) {
scc = 1;
} else {
scc = field._xscale / 100;
}
this._x = centx + ((Math.cos(this.ang) * (this.actrow + radstage)) * scc);
this._y = centy + ((Math.sin(this.ang) * (this.actrow + radstage)) * scc);
this._yscale = (this._xscale = ((this.actrow + radstage) / 2.63999382654604) * scc);
this._rotation = (this.ang / Math.PI) * 180;
if (dropspeed == 0) {
theclaw._x = this._x;
theclaw._y = this._y;
theclaw._rotation = this._rotation;
var diffx = (_root._xmouse - cx);
var diffy = (_root._ymouse - cy);
var ta = Math.atan2(diffy, diffx);
if ((ta < -1) && (this.ang > 1)) {
this.ang = this.ang - r360;
} else if ((ta > 1) && (this.ang < -1)) {
this.ang = this.ang + r360;
}
diffa = ta - this.ang;
diffa = diffa * 0.5;
if (((diffa > 0.3) || (diffa < -0.3)) && (playmove == 0)) {
soundobj.movement.start(0, 1);
playmove = 40;
}
if (playmove > 0) {
playmove--;
}
if (diffa > 0.25) {
diffa = 0.25;
}
if (diffa < -0.25) {
diffa = -0.25;
}
this.ang = this.ang + diffa;
}
this.rad = this.rad - dropspeed;
mainframe.tbeam.powerbar.gotoAndStop(Math.floor(shimmy * 2.5));
if (shimmy > 10) {
soundobj.autodrop.start(0, 1);
startfall();
}
if (this.rad <= 1) {
ball.dostuff();
}
if ((gamegrid[this.rowi - 1][this.angi] > 1) && (dropspeed > 0)) {
ball.dostuff();
}
};
startfall = function () {
if (field.dests == 170) {
ball.rad = 180;
}
ball.gameball.arrow._visible = false;
theclaw.tbeam.gotoAndStop(2);
ball.onMouseUp = null;
shimmy = 0;
dropspeed = 14;
soundobj.drop.start(0, 1);
mainframe.pausebutton._visible = false;
};
startfallmouse = function () {
if (_root._xmouse < 515) {
if (field.dests == 170) {
this.rad = 180;
}
ball.gameball.arrow._visible = false;
theclaw.tbeam.gotoAndStop(2);
ball.onMouseUp = null;
shimmy = 0;
dropspeed = 14;
soundobj.drop.start(0, 1);
mainframe.pausebutton._visible = false;
}
};
releasemouse = function () {
var closecall = false;
this.rowi = Math.floor(this.rad / 30);
if (this.rowi < 0) {
this.rowi = 0;
}
this.actrow = rowrads[this.rowi];
this.offang = (this.rowi % 2) * (da / 2);
this.angi = (Math.round((this.ang - this.offang) / da) + 32) % nump;
mnum1 = (this.rowi * 8) + this.angi;
p1 = gamegrid[this.rowi][this.angi];
mnum2 = ((this.rowi - 1) * 8) + this.angi;
p2 = gamegrid[this.rowi - 1][this.angi];
mnum3 = (this.rowi * 8) + (((this.angi - 1) + 8) % 8);
p3 = gamegrid[this.rowi][((this.angi - 1) + 8) % 8];
if (closecall == false) {
gamegrid[this.rowi][this.angi] = this.gameball.vKatras._currentframe;
var oc = gridpos[this.rowi][this.angi];
field["ball" + oc].gotoAndStop(this.gameball.vKatras._currentframe);
}
ga = ball.ang;
moveoff = 0;
this._visible = false;
this.onEnterFrame = null;
falliterations = 0;
addingrow = false;
activerow = this.rowi;
activeang = this.angi;
_root.onEnterFrame = fallcall;
};
fallcall = function () {
var p = true;
if (moveoff == 0) {
p = fallboard();
}
if (p == false) {
var k = findActiveMatch();
if (k == 0) {
this.onEnterFrame = null;
_root.gamedover = false;
gonova = false;
applyboard();
if ((((!addingrow) && (!gamedover)) && (!gonova)) && (!inANova)) {
createBall();
}
} else {
if (k == 3) {
soundobj.clear2.start(0, 1);
} else if (k == 4) {
soundobj.clear1.start(0, 1);
} else {
soundobj.clear5.start(0, 1);
}
need = need - k;
if (need < 0) {
need = 0;
}
mainframe.needtext.text = need;
falliterations++;
var actt = (k - 2);
score = score + (((actt * actt) * 10) * falliterations);
displayScore();
}
}
moveoff++;
moveoff = moveoff % numsteps;
};
displayScore = function () {
mainFrame.scoretext.text = score;
};
createBall = function () {
dropspeed = 0;
_root.createEmptyMovieClip("ball", 98);
_root.ball.attachMovie("ball", "gameball", 1);
ball.gameball.vKatras.gotoAndStop(nextp);
ball.gameball.grid._visible = false;
ball.gameball.tbeam.stop();
oldp = nextp;
nextp = finals[random(finals.length - 1)];
if (nextp == oldp) {
nextp = finals[random(finals.length - 1)];
}
if (random(20) == 2) {
nextp = 9;
}
if (Key.isDown(38)) {
nextp = 9;
}
mainframe.nextball.vKatras.gotoAndStop(nextp);
ball.gameball.arrow._visible = false;
ball.rad = ((rows + 1) * 30) - 1;
ball.ang = ga;
ball._x = -100;
ball._y = -100;
ball.onEnterFrame = moveball;
ball.onMouseUp = startfallmouse;
ball.dostuff = releasemouse;
theclaw.tbeam.gotoAndStop(1);
mainframe.pausebutton._visible = true;
if (clearsince > dropwarns) {
addrowtobottom();
clearsince = 1;
}
};
moveto = function () {
var dx = (((this.destx - this.startx) / numsteps) * moveoff);
var dy = (((this.desty - this.starty) / numsteps) * moveoff);
var ds = (((this.dests - this.starts) / numsteps) * moveoff);
this._x = this.startx + dx;
this._y = this.starty + dy;
this._yscale = (this._xscale = this.starts + ds);
if (moveoff == (numsteps - 1)) {
field["ball" + this.oc2].gotoAndStop(this._currentframe);
this.gotoAndStop(1);
if (raising != true) {
applyboard();
}
this._x = this.startx;
this._y = this.starty;
this._xscale = (this._yscale = this.starts);
this.onEnterFrame = null;
}
};
fallboard = function () {
var fell = false;
var rowtype;
var i = 1;
while (i < (rows + 2)) {
rowtype = i % 2;
var j = 0;
while (j < nump) {
if (gamegrid[i][j] > 1) {
if (rowtype == 0) {
ioff = -1;
}
if (rowtype == 1) {
ioff = 1;
}
var oc = gridpos[i][j];
if (gamegrid[i - 2][j] == 1) {
if ((activerow == i) && (activeang == j)) {
activerow = i - 2;
}
var oc2 = gridpos[i - 2][j];
field["ball" + oc2].makeme = gamegrid[i][j];
gamegrid[i - 2][j] = gamegrid[i][j];
gamegrid[i][j] = 1;
field["ball" + oc].oc2 = oc2;
field["ball" + oc].oc = oc;
field["ball" + oc].startx = field["ball" + oc]._x;
field["ball" + oc].starty = field["ball" + oc]._y;
field["ball" + oc].destx = field["ball" + oc2]._x;
field["ball" + oc].desty = field["ball" + oc2]._y;
field["ball" + oc].starts = field["ball" + oc]._xscale;
field["ball" + oc].dests = field["ball" + oc2]._xscale;
field["ball" + oc].onEnterFrame = moveto;
fell = true;
}
}
j++;
}
i++;
}
return(fell);
};
findActiveMatch = function () {
clearmatchg();
cn = 0;
i = activerow;
j = activeang;
if ((gamegrid[i][j] > 1) && (!matchg[i][j])) {
pcnt = 0;
findmatch(i, j);
if (pcnt < req) {
pcnt = 0;
unfindmatch(i, j);
} else {
cn = cn + pcnt;
}
}
applyMatches();
if (cn > 0) {
clearsince = 0;
} else {
clearsince++;
}
mainframe.dropwarning.gotoAndStop(clearsince);
mainframe.dropwarning1.gotoAndStop(clearsince);
mainframe.dropwarning2.gotoAndStop(clearsince);
if (clearsince == 3) {
wsoundobj.warning.stop();
wsoundobj.warningslow.start(0, 9999);
} else if (clearsince == 4) {
wsoundobj.warningslow.stop();
wsoundobj.warning.start(0, 9999);
} else {
wsoundobj.warningslow.stop();
wsoundobj.warning.stop();
}
return(cn);
};
findAllMatches = function () {
clearmatchg();
cn = 0;
var i = 0;
while (i < (rows + 2)) {
var j = 0;
while (j < nump) {
if ((gamegrid[i][j] > 1) && (!matchg[i][j])) {
pcnt = 0;
findmatch(i, j);
if (pcnt < req) {
pcnt = 0;
unfindmatch(i, j);
} else {
cn = cn + pcnt;
}
}
j++;
}
i++;
}
applyMatches();
if (cn > 0) {
clearsince = 0;
} else {
clearsince++;
}
mainframe.dropwarning.gotoAndStop(clearsince);
mainframe.dropwarning1.gotoAndStop(clearsince);
mainframe.dropwarning2.gotoAndStop(clearsince);
return(cn);
};
clearmatchg = function () {
i = 0;
while (i < (ghei + 2)) {
j = 0;
while (j < gwid) {
matchg[i][j] = false;
j++;
}
i++;
}
};
findmatch = function (i, j) {
var num = gamegrid[i][j];
var rowtype = (i % 2);
matchg[i][j] = true;
pcnt++;
var ioff;
if (rowtype == 0) {
ioff = -1;
}
if (rowtype == 1) {
ioff = 1;
}
if ((gamegrid[i + 2][j] == num) && (!matchg[i + 2][j])) {
findmatch(i + 2, j);
}
if ((i > 1) && ((gamegrid[i - 2][j] == num) && (!matchg[i - 2][j]))) {
findmatch(i - 2, j);
}
if ((gamegrid[i + 1][j] == num) && (!matchg[i + 1][j])) {
findmatch(i + 1, j);
}
if ((i > 0) && ((gamegrid[i - 1][j] == num) && (!matchg[i - 1][j]))) {
findmatch(i - 1, j);
}
if ((gamegrid[i + 1][((j + ioff) + nump) % nump] == num) && (!matchg[i + 1][((j + ioff) + nump) % nump])) {
findmatch(i + 1, ((j + ioff) + nump) % nump);
}
if ((i > 0) && ((gamegrid[i - 1][((j + ioff) + nump) % nump] == num) && (!matchg[i - 1][((j + ioff) + nump) % nump]))) {
findmatch(i - 1, ((j + ioff) + nump) % nump);
}
};
unfindmatch = function (i, j) {
var num = gamegrid[i][j];
matchg[i][j] = false;
pcnt--;
var ioff;
var rowtype = (i % 2);
if (rowtype == 0) {
ioff = -1;
}
if (rowtype == 1) {
ioff = 1;
}
if ((gamegrid[i + 2][j] == num) && (matchg[i + 2][j])) {
unfindmatch(i + 2, j);
}
if ((i > 1) && ((gamegrid[i - 2][j] == num) && (matchg[i - 2][j]))) {
unfindmatch(i - 2, j);
}
if ((gamegrid[i + 1][j] == num) && (matchg[i + 1][j])) {
unfindmatch(i + 1, j);
}
if ((i > 0) && ((gamegrid[i - 1][j] == num) && (matchg[i - 1][j]))) {
unfindmatch(i - 1, j);
}
if ((gamegrid[i + 1][((j + ioff) + nump) % nump] == num) && (matchg[i + 1][((j + ioff) + nump) % nump])) {
unfindmatch(i + 1, ((j + ioff) + nump) % nump);
}
if ((i > 0) && ((gamegrid[i - 1][((j + ioff) + nump) % nump] == num) && (matchg[i - 1][((j + ioff) + nump) % nump]))) {
unfindmatch(i - 1, ((j + ioff) + nump) % nump);
}
};
applyMatches = function () {
var nyc = 0;
var foundabomb = false;
var i = 0;
while (i < (ghei + 2)) {
var j = 0;
while (j < gwid) {
nm = "ball" + nyc;
if (matchg[i][j]) {
gamegrid[i][j] = 1;
field[nm].gotoAndStop(1);
field[nm].fademe.play();
}
if ((field[nm]._currentframe == 9) && (i > 1)) {
gamegrid[i][j] = 1;
field[nm].gotoAndStop(1);
field[nm].fademe.play();
foundabomb = true;
cn = cn + 5;
var ioff;
var rowtype = (i % 2);
if (rowtype == 0) {
ioff = -1;
}
if (rowtype == 1) {
ioff = 1;
}
matchg[i + 2][j] = 1;
matchg[i - 2][j] = 1;
matchg[i + 1][j] = 1;
matchg[i - 1][j] = 1;
matchg[i + 1][((j + ioff) + nump) % nump] = 1;
matchg[i - 1][((j + ioff) + nump) % nump] = 1;
}
nyc++;
j++;
}
i++;
}
if (foundabomb) {
applyMatches();
}
};
addrowtobottom = function () {
var i = (ghei - 1);
while (i > 2) {
var j = 0;
while (j < gwid) {
gamegrid[i][j] = gamegrid[i - 2][j];
gamegrid[i - 1][j] = gamegrid[i - 3][j];
j++;
}
i--;
}
var j = 0;
while (j < gwid) {
gamegrid[0][j] = random(maxdiffpieces) + 2;
gamegrid[1][j] = random(maxdiffpieces) + 2;
j++;
}
var nyc = 0;
var i = 0;
while (i < 2) {
var j = 0;
while (j < gwid) {
nm = "ball" + nyc;
field[nm].doanim = true;
nyc++;
j++;
}
i++;
}
raising = true;
mainframe.dropwarning.gotoAndStop(1);
mainframe.dropwarning1.gotoAndStop(1);
mainframe.dropwarning2.gotoAndStop(1);
wsoundobj.warning.stop();
wsoundobj.warningslow.stop();
soundobj.addrow.start(0, 1);
applyboard();
};
raisecall = function () {
var p = true;
if (moveoff == 0) {
p = fallboard();
}
if (p == false) {
this.onEnterFrame = null;
raising = false;
applyboard();
}
moveoff++;
moveoff = moveoff % numsteps;
};
addrowtotop = function () {
var j = 0;
while (j < gwid) {
if (gamegrid[7][j] == 1) {
gamegrid[7][j] = random(maxdiffpieces) + 2;
}
j++;
}
addingrow = true;
applyboard();
_root.onEnterFrame = fallcall;
};
applyboard = function () {
var nyc = 0;
highest = 0;
var hasSomePieces = false;
valids = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
var i = 0;
while (i < (ghei + 2)) {
var j = 0;
while (j < gwid) {
nm = "ball" + nyc;
field[nm].gotoAndStop(gamegrid[i][j]);
if (field[nm].doanim) {
field[nm].fademe.play();
field[nm].doanim = false;
}
valids[gamegrid[i][j]]++;
if (gamegrid[i][j] > 1) {
hasSomePieces = true;
highest = i;
}
if (field[nm]._currentframe == 9) {
if ((i == 1) || (i == 0)) {
gamegrid[i][j] = 1;
field[nm].destx = 0;
field[nm].desty = 0;
field[nm].dests = 10;
field[nm].startx = field[nm]._x;
field[nm].starty = field[nm]._y;
field[nm].starts = field[nm]._xscale;
field[nm].zoomrate = 0.025;
field[nm].nova = true;
gonova = true;
clearsince = 0;
mainframe.dropwarning.gotoAndStop(1);
mainframe.dropwarning1.gotoAndStop(1);
mainframe.dropwarning2.gotoAndStop(1);
wsoundobj.warningslow.stop();
wsoundobj.warning.stop();
novaanim.play();
field[nm].onEnterFrame = zoommoveto;
inANova = true;
shimmy = 0;
mainframe.tbeam.powerbar.gotoAndStop(Math.floor(shimmy * 2.5));
}
}
nyc++;
j++;
}
i++;
}
if ((!hasSomePieces) || (need == 0)) {
addingrow = true;
theclaw._x = 900;
theclaw._y = 900;
ball.removeMovieClip();
if (mousehide) {
Mouse.show();
}
summarizeGame();
return(false);
}
if (highest >= 9) {
doTitle("GAME OVER");
addingrow = true;
theclaw._x = 900;
theclaw._y = 900;
stopcursong();
_root.soundobj.spacedrone.start(0, 9991);
soundobj.gameover.start(0, 1);
wsoundobj.warningslow.stop();
wsoundobj.warning.stop();
goTimer = setInterval(handlegameover, 4000);
ball.onEnterFrame = null;
ball.removeMovieClip();
_root.gamedover = true;
return(false);
}
finals = new Array();
stg = "";
i = 2;
while (i < 9) {
if (valids[i] > 0) {
stg = stg + (i + ",");
}
i++;
}
finals = stg.split(",");
if ((oldhighest != highest) && (!applyingpiece)) {
if (highest < 5) {
field.dests = 170;
field.zoomrate = 0.8;
field.onEnterFrame = zoomto;
} else {
field.dests = 100;
field.zoomrate = 0.8;
field.onEnterFrame = zoomto;
}
}
oldhighest = highest;
if (foundabomb) {
applyMatches();
}
};
zoomto = function () {
var dsc = ((this.dests - this._xscale) * this.zoomrate);
this._xscale = this._xscale + dsc;
this._yscale = this._xscale;
var dsr = ((this.destr - this._rotation) * this.zoomrate);
this._rotation = this._rotation + dsr;
if (Math.abs(dsc) < 0.5) {
this._xscale = (this._yscale = this.dests);
this._rotation = this.destr;
this.onEnterFrame = null;
}
};
zoommoveto = function () {
var dsc = ((this.dests - this._xscale) * this.zoomrate);
this._xscale = this._xscale + dsc;
this._yscale = this._xscale;
var dsr = ((this.destr - this._rotation) * this.zoomrate);
this._rotation = this._rotation + dsr;
var dsx = ((this.destx - this._x) * this.zoomrate);
this._x = this._x + dsx;
var dsy = ((this.desty - this._y) * this.zoomrate);
this._y = this._y + dsy;
this.gotoAndStop(9);
if ((Math.abs(dsx) < 0.01) && (Math.abs(dsy) < 0.01)) {
if (this.nova) {
this.nova = false;
this.gotoAndStop(1);
this.fademe.play();
cn = cn + 8;
matchg[0][0] = 1;
matchg[0][1] = 1;
matchg[0][2] = 1;
matchg[0][3] = 1;
matchg[0][4] = 1;
matchg[0][5] = 1;
matchg[0][6] = 1;
matchg[0][7] = 1;
matchg[1][0] = 1;
matchg[1][1] = 1;
matchg[1][2] = 1;
matchg[1][3] = 1;
matchg[1][4] = 1;
matchg[1][5] = 1;
matchg[1][6] = 1;
matchg[1][7] = 1;
this._x = this.startx;
this._y = this.starty;
this._xscale = this.starts;
this._yscale = this.starts;
applyMatches();
_root.onEnterFrame = fallcall;
need = need - 16;
if (need < 0) {
need = 0;
}
mainframe.needtext.text = need;
score = score + 500;
displayScore();
clearsince = 0;
mainframe.dropwarning.gotoAndStop(1);
mainframe.dropwarning1.gotoAndStop(1);
mainframe.dropwarning2.gotoAndStop(1);
inANova = false;
this.onEnterFrame = null;
} else {
this._xscale = (this._yscale = this.dests);
this._x = this.destx;
this._y = this.desty;
this._rotation = this.destr;
this.onEnterFrame = null;
}
}
};
mainframe.continuebutton.onRelease = function () {
handleprogresslevel();
};
title.hsbutton.onRelease = function () {
_level5._x = 100;
_level5._y = 100;
_level5.doGetScores(3);
};
_level0.hsURL = "http://www.superdudes.net";
loadMovieNum ("hsmodule.swf", 5);
stop();
Instance of Symbol 309 MovieClip "loader" in Frame 1
onClipEvent (load) {
l_targ = "_root";
}
Symbol 109 MovieClip Frame 1
stop();
Symbol 116 MovieClip Frame 1
stop();
Symbol 131 MovieClip [ball] Frame 1
stop();
Symbol 175 MovieClip Frame 1
stop();
Symbol 212 MovieClip Frame 1
stop();
Symbol 215 MovieClip Frame 1
stop();
Symbol 241 MovieClip Frame 1
stop();
Symbol 250 MovieClip Frame 1
stop();
Symbol 251 MovieClip Frame 1
invisibut.tabEnabled = false;
quitButton.tabEnabled = false;
invisibut.onRollOver = function () {
if (((!_root.title._visible) && (_root.need > 0)) && (_root.mousehide)) {
Mouse.hide();
}
};
invisibut.onRollOut = function () {
if (((!_root.title._visible) && (_root.need > 0)) && (_root.mousehide)) {
Mouse.show();
}
};
Symbol 257 MovieClip Frame 1
this.onEnterFrame = function () {
d1._rotation = d1._rotation + 0.4;
d2._rotation = d2._rotation + 0.8;
};
Symbol 263 MovieClip Frame 1
stop();
Symbol 273 MovieClip Frame 1
rotateme = function () {
this._rotation = this._rotation + this.dr;
if (this.pl._x > 1) {
this.pl._x = this.pl._x * (1 - (this.dr * 0.01));
this.pl._yscale = this.pl._yscale * (1 - (this.dr * 0.006));
this.pl._xscale = this.pl._xscale * (1 - (this.dr * 0.006));
} else {
this.pl._visible = false;
}
if (this.speedsteps < 330) {
this._x = this._x + (this.dr * 0.1);
this.dr = this.dr + 0.01;
this.speedsteps++;
}
};
stopme = function () {
d0.onEnterFrame = null;
d1.onEnterFrame = null;
d2.onEnterFrame = null;
d3.onEnterFrame = null;
d4.onEnterFrame = null;
d5.onEnterFrame = null;
d6.onEnterFrame = null;
};
restartme = function () {
d0.onEnterFrame = rotateme;
d1.onEnterFrame = rotateme;
d2.onEnterFrame = rotateme;
d3.onEnterFrame = rotateme;
d4.onEnterFrame = rotateme;
d5.onEnterFrame = rotateme;
d6.onEnterFrame = rotateme;
};
startme = function () {
d0.dr = 5;
d0.ind = 0;
d0.onEnterFrame = rotateme;
d0._rotation = random(360);
d1.dr = 3;
d1.ind = 1;
d1.onEnterFrame = rotateme;
d1._rotation = random(360);
d2.dr = 1.5;
d2.ind = 2;
d2.onEnterFrame = rotateme;
d2._rotation = random(360);
d3.dr = 1;
d3.ind = 3;
d3.onEnterFrame = rotateme;
d3._rotation = random(360);
d4.dr = 0.5;
d4.ind = 4;
d4.onEnterFrame = rotateme;
d4._rotation = random(360);
d5.dr = 0.25;
d5.ind = 5;
d5.onEnterFrame = rotateme;
d5._rotation = random(360);
d6.dr = 0.1;
d6.ind = 6;
d6.onEnterFrame = rotateme;
d6._rotation = random(360);
};
startme();
Symbol 288 MovieClip Frame 39
playButton.tabEnabled = false;
hsButton.tabEnabled = false;
inst.tabEnabled = false;
options.tabEnabled = false;
_root.soundobj.descend.start(0, 1);
_root.soundobj.spacedrone.start(0, 9991);
playButton.onRelease = function () {
_visible = false;
_root.score = 0;
_root.level = _root.startlevel;
_root.displayScore();
_root.startgame();
swirly.stopme();
_root.soundobj.beep1.start(0, 1);
};
hsbutton.onRelease = function () {
_level5._x = 100;
_level5._y = 100;
_level5.doGetScores(3);
_root.soundobj.beep1.start(0, 1);
_root.instructions.gotoAndStop(3);
_root.instructions._visible = true;
};
inst.onRelease = function () {
_root.instructions.gotoAndStop(1);
_root.instructions._visible = true;
_root.soundobj.beep1.start(0, 1);
};
options.onRelease = function () {
_root.instructions.gotoAndStop(2);
_root.instructions._visible = true;
_root.soundobj.beep1.start(0, 1);
};
playbutton.onPress = function () {
_root.soundobj.drop.start(0, 1);
};
hsbutton.onPress = function () {
_root.soundobj.drop.start(0, 1);
};
inst.onPress = function () {
_root.soundobj.drop.start(0, 1);
};
options.onPress = function () {
_root.soundobj.drop.start(0, 1);
};
stop();
Symbol 300 MovieClip Frame 1
stop();
claw.stop();
dropwarning.gotoAndStop(3);
cont.tabEnabled = false;
cont.onRelease = function () {
_level5.clear_screen();
_visible = false;
};
invisibut.tabEnabled = false;
Symbol 300 MovieClip Frame 2
cont.tabEnabled = false;
high.tabEnabled = false;
med.tabEnabled = false;
low.tabEnabled = false;
soundon.tabEnabled = false;
soundoff.tabEnabled = false;
muson.tabEnabled = false;
musoff.tabEnabled = false;
high.onRelease = function () {
_root.qual = "HIGH";
_root._quality = _root.qual;
qualind._y = this._y + 8;
};
med.onRelease = function () {
_root.qual = "MEDIUM";
_root._quality = _root.qual;
qualind._y = this._y + 8;
};
low.onRelease = function () {
_root.qual = "LOW";
_root._quality = _root.qual;
qualind._y = this._y + 8;
};
soundon.onRelease = function () {
soundind._y = this._y + 8;
_root.soundobj.drop.setVolume(100);
_root.wsoundobj.warning.setVolume(0);
};
soundoff.onRelease = function () {
soundind._y = this._y + 8;
_root.soundobj.drop.setVolume(0);
_root.wsoundobj.warning.setVolume(0);
};
muson.onRelease = function () {
musind._y = this._y + 8;
_root.musicon = true;
};
musoff.onRelease = function () {
musind._y = this._y + 8;
_root.musicon = false;
};
Symbol 300 MovieClip Frame 3
cont.tabEnabled = false;
cont.onRelease = function () {
_level5.clear_screen();
_level5.stopGetScores();
_visible = false;
};
Symbol 309 MovieClip Frame 16
loadedBytes = _root.getBytesLoaded();
totalBytes = _root.getBytesTotal();
if (loadedBytes < totalBytes) {
perc = int((loadedBytes / totalBytes) * 100);
loaderBar._xscale = perc;
gotoAndPlay (17);
perctext = perc + "% LOADED";
} else {
gotoAndPlay (21);
}
Symbol 309 MovieClip Frame 20
gotoAndPlay (16);
Symbol 309 MovieClip Frame 33
_visible = false;