Frame 1
fscommand ("showmenu", "false");
fscommand ("trapallkeys", "true");
fscommand ("allowscale", "false");
Frame 14
loadedbytes01 = getBytesLoaded();
totalbytes01 = getBytesTotal();
loadedmovie01 = Math.ceil(loadedbytes01 / 1000) add "Kb";
totalmovie01 = Math.ceil(totalbytes01 / 1000) add "Kb";
percentageloaded01 = Math.ceil((loadedbytes01 / totalbytes01) * 100);
percentageloaded01 = percentageloaded01;
if (((String(totalbytes01) != "") && (totalbytes01 != undefined)) && (totalbytes01 != 0)) {
preloadText01 = ((((("LOADING... " + percentageloaded01) add "%") + newline) + loadedmovie01) + " of ") + totalmovie01;
}
if (loadedbytes01 == totalbytes01) {
gotoAndPlay (16);
}
Frame 15
gotoAndPlay (14);
Frame 25
gotoAndStop (55);
Frame 55
Object.FLEM = function () {
this._listener_array = [];
};
Object.FLEM.prototype.addFLEMListener = function (obj) {
var a = this._listener_array;
var found = false;
var i = a.length;
while (i--) {
if (a[i] == obj) {
found = true;
break;
}
}
if (found) {
return(false);
}
a.unshift(obj);
if (this.sendFLEMEvent == undefined) {
this.sendFLEMEvent = this._sendFLEMEvent;
}
return(true);
};
Object.FLEM.prototype.removeFLEMListener = function (obj) {
var a = this._listener_array;
var i = a.length;
while (i--) {
if (a[i] == obj) {
a.splice(i, 1);
break;
}
}
if (a.length == 0) {
this.sendFLEMEvent = undefined;
}
};
Object.FLEM.prototype._sendFLEMEvent = function (func_str, argObj) {
var a = this._listener_array;
var i = a.length;
while (i--) {
if (a[i] != undefined) {
a[i][func_str](argObj);
} else {
a.splice(i, 1);
}
}
};
Object.addStaticFLEM = function (obj) {
if (obj._listener_array == undefined) {
obj._listener_array = [];
obj._sendFLEMEvent = Object.FLEM.prototype._sendFLEMEvent;
obj.addFLEMListener = Object.FLEM.prototype.addFLEMListener;
obj.removeFLEMListener = Object.FLEM.prototype.removeFLEMListener;
}
};
Object.removeStaticFLEM = function (obj) {
delete obj._listener_array;
delete obj._sendFLEMEvent;
delete obj.addFLEMListener;
delete obj.removeFLEMListener;
};
Object.prototype.registerFLEM = function (objects, reg) {
if (objects.__proto__ == Array.prototype) {
var n = objects.length;
var i = 0;
while (i < n) {
if (reg == false) {
objects[i].removeFLEMListener(this);
} else {
objects[i].addFLEMListener(this);
}
i++;
}
}
};
ASSetPropFlags(Object.prototype, ["registerFLEM"], 1);
Object.addStaticFLEM(MovieClip);
stop();
function mycoll() {
if (!this.glock) {
this.sy = this.sy + this.gravity;
}
myx = ((Math.abs(this.sx + this.sconx) < elx) ? ((this.x = this.x + (((mysx = this.sx)) + this.sconx))) : ((this.x = this.x + ((elx * Math.abs(this.sx)) / ((mysx = this.sx))))));
myy = ((Math.abs(this.sy) < ely) ? ((this.y = this.y + ((mysy = this.sy)))) : ((this.y = this.y + ((ely * Math.abs(this.sy)) / ((mysy = this.sy))))));
mydx = this.dx;
mydy = this.dy;
myj = this.j;
mytop = false;
while (true) {
myfloorx = Math.floor(myx / elx);
myfloory = Math.floor(myy / ely);
myfloorw = Math.floor(((myx + this.w) - 1) / elx);
myfloorh = Math.floor(((myy + this.h) - 1) / ely);
myfloorcx = Math.floor((myx + (this.w / 2)) / elx);
myfloorcy = Math.floor((myy + (this.h / 2)) / ely);
mycollx = ((mapcoll[myfloorh][myfloorx] == 3) ? (mapcoll[(myxh = myfloorh - 1)][myfloorx]) : (mapcoll[(myxh = myfloorh)][myfloorx]));
mycollc = ((mapcoll[myfloorh][myfloorcx] == 3) ? (mapcoll[(mych = myfloorh - 1)][myfloorcx]) : (mapcoll[(mych = myfloorh)][myfloorcx]));
mycollw = ((mapcoll[myfloorh][myfloorw] == 3) ? (mapcoll[(mywh = myfloorh - 1)][myfloorw]) : (mapcoll[(mywh = myfloorh)][myfloorw]));
mygridx = Math.floor(mapgrid[myxh][myfloorx] / 3);
mygridc = Math.floor(mapgrid[mych][myfloorcx] / 3);
mygridw = Math.floor(mapgrid[mywh][myfloorw] / 3);
myslope = 0;
myblock = false;
myconveyor = false;
if ((3 < mycollx) || (3 < mycollw)) {
myslope = (((((2 * Math.round(mycollx / 2)) / mycollx) == 1) || (((2 * Math.round(mycollw / 2)) / mycollw) == 1)) ? -1 : 1);
ptopx = ((24 < mygridx) ? (myxh * ely) : ((((myxh * ely) + mygridx) - (myslope * 6)) - 7));
ptopw = ((24 < mygridw) ? (mywh * ely) : ((((mywh * ely) + mygridw) - (myslope * 6)) - 7));
ptop = ((((((((ptopx < ptopw) && ((((myy + this.h) - 3) - ptopx) < mysy)) && (mapcoll[myfloorh - 1][myfloorx] < 6)) && (2 < mycollx)) || ((((myy + this.h) - 3) - ptopw) >= mysy)) || (5 < mapcoll[myfloorh - 1][myfloorw])) || (mycollw < 3)) ? (ptopx) : (ptopw));
if (((((myy + this.h) - 2) - ptop) < mysy) && (((26 < mygridx) && (mygridx < 33)) || ((26 < mygridw) && (mygridw < 33)))) {
myconveyor = true;
}
if ((5 < mycollx) || (5 < mycollw)) {
myblock = true;
}
} else if ((5 < mapcoll[myfloory][myfloorx]) || (5 < mapcoll[myfloory][myfloorw])) {
myblock = true;
}
if ((this.sprite == "shane") && ((mycollx == 0) || (mycollw == 0))) {
this.edge = 1;
} else {
this.edge = 0;
}
if ((myconveyor && (!this.glock)) && (((mycollx != 0) && (mycollw != 0)) || (this.sprite != "shane"))) {
this.sconx = (myslope * 2) * speed;
} else {
this.sconx = 0;
}
if ((3 < mycollc) && (mygridc < 33)) {
this.ladder = mapgrid[mych][myfloorcx] - (mygridc * 3);
} else {
this.ladder = 0;
}
if ((!this.die) && ((mycollx == 1) || (mycollw == 1))) {
this.mydie();
break;
}
if (((!this.glock) || (this.ladder == 2)) && (myblock)) {
mygrady = ((0 < mysy) ? (((myy + this.h) - ((((myxtray = ((myexacty = myfloorh)) - 1)) + 1) * ely)) * mysx) : ((myy - (((myxtray = ((myexacty = myfloory)) + 1)) * ely)) * mysx));
mygradx = ((0 < mysx) ? (((myx + this.w) - ((((myxtrax = ((myexactx = myfloorw)) - 1)) + 1) * elx)) * mysy) : ((myx - (((myxtrax = ((myexactx = myfloorx)) + 1)) * elx)) * mysy));
if ((((0 < mysy) && ((((myy + this.h) - 3) - ptop) < mysy)) && (ptop < (myy + this.h))) && ((((mygradx * mysx) >= (mygrady * mysx)) && (mapgrid[myxtray][myexactx] < 3)) || (2 < mapgrid[myexacty][myxtrax]))) {
this.y = ptop - this.h;
this.sy = (-mysy) * this.bnce;
this.j = this.jmax;
if (this.glock) {
this.glock = false;
this.ladder = 0;
}
this.dy = 0;
if (this.edge) {
this.dx = -mydx;
if (mycollx == 0) {
this.x = (myfloorx + 1) * elx;
} else if (mycollw == 0) {
this.x = (myfloorw * elx) - this.w;
}
}
} else if ((mysy < 0) && ((((mygrady * mysx) >= (mygradx * mysx)) && (mapgrid[myxtray][myexactx] < 3)) || (5 < mapcoll[myexacty][myxtrax]))) {
this.y = (myfloory + 1) * ely;
this.sy = (-mysy) * this.bnce;
this.j = 0;
}
if ((0 < mysx) && ((((mygrady * mysy) >= (mygradx * mysy)) && (mapgrid[myexacty][myxtrax] < 3)) || (5 < mapcoll[myxtray][myexactx]))) {
this.x = (myfloorw * elx) - this.w;
this.sx = (-mysx) * this.bnce;
if (this.sprite != "bob") {
this.dx = -mydx;
}
} else if ((mysx < 0) && ((((mygradx * mysy) >= (mygrady * mysy)) && (mapgrid[myexacty][myxtrax] < 3)) || (5 < mapcoll[myxtray][myexactx]))) {
this.x = (myfloorx + 1) * elx;
this.sx = (-mysx) * this.bnce;
if (this.sprite != "bob") {
this.dx = -mydx;
}
}
break;
}
if ((((myslope != 0) && ((((myy + this.h) - 3) - ptop) < mysy)) && (ptop < (myy + this.h))) && ((!this.glock) || (this.ladder == 2))) {
if (this.glock) {
this.glock = false;
this.ladder = 0;
}
this.dy = 0;
this.sy = (-this.bnce) * this.sy;
this.y = ptop - this.h;
this.j = this.jmax;
if (this.edge) {
this.dx = -mydx;
if (mycollx == 0) {
this.x = (myfloorx + 1) * elx;
} else if (mycollw == 0) {
this.x = (myfloorw * elx) - this.w;
}
}
break;
}
if (((this.glock && (this.ladder == 1)) && (myslope != 0)) && ((((myy + this.h) - 1) < ptop) || (mytop))) {
this.y = ptop - this.h;
this.glock = false;
this.ladder = 0;
this.dy = 0;
break;
}
if ((this.glock && (!mycollc)) && (this.dy != 0)) {
this.y = ((0 < this.sy) ? ((myy = (myfloorh * ely) - this.h)) : ((myy = (((myfloorh + 1) * ely) - this.h) + 1)));
if (this.sprite != "bob") {
this.dy = -mydy;
}
mytop = true;
} else {
break;
}
}
if (this.glock) {
this.x = ((myfloorcx + 0.5) * elx) - (this.w / 2);
}
}
function myframe() {
this.mframe = this.dmatrix[this.dx + 1][this.dy + 1];
if ((this.sprite == "bob") && (this.battime)) {
tellTarget (this.mc) {
gotoAndStop(this.mframe + 32);
};
} else if (this.j != this.jmax) {
tellTarget (this.mc) {
gotoAndStop(this.mframe + 8);
};
tellTarget (this.mc add "/move") {
gotoAndStop(Math.ceil((_totalframes * (this.jmax - this.j)) / this.jmax));
};
} else if ((this.sx != 0) || (this.sy != 0)) {
tellTarget (this.mc) {
gotoAndStop(this.mframe);
};
tellTarget (this.mc add "/move") {
play();
};
} else {
tellTarget (this.mc) {
gotoAndStop(this.mframe);
};
tellTarget (this.mc add "/move") {
gotoAndStop (1);
};
}
}
function mydelete() {
MovieClip.removeFLEMListener(this);
Object.removeStaticFLEM(this);
removeMovieClip("/game/" add this.mc);
z = /game:sprlist.length;
while (z--) {
if (/game:sprlist[z] == this) {
/game:sprlist.splice(z, 1);
break;
}
}
delete this;
}
function mybobcoll() {
if (bobsprite.battime && ((((bobsprite.batx - this.x) * (bobsprite.batx - this.x)) + ((bobsprite.baty - this.y) * (bobsprite.baty - this.y))) < 400)) {
this.mydie();
this.scorex = Math.round(this.x + (this.w / 2));
this.scorey = Math.round((this.y + (this.h / 2)) + 10);
if (this.sprite == "ball") {
bobsprite.scorenumber = 2;
} else {
bobsprite.scorenumber = 3;
}
this.ball = 0;
while (eval ("spr" add this.ball) != undefined) {
this.ball++;
}
Set("spr" add this.ball, new _root.spriteObj(1, 1, this.ball, this.scorex, this.scorey, 0, 0, 0, 0, 0, 0, 1, 0, 0));
MovieClip.addFLEMListener(eval ("spr" add this.ball));
this.sendFLEMEvent("doaction", "addscore");
bobsprite.scorenumber = 0;
} else if ((((bobsprite.x - this.x) * (bobsprite.x - this.x)) + ((bobsprite.y - this.y) * (bobsprite.y - this.y))) < 200) {
this.mydie();
bobsprite.mydie();
} else if ((this.sprite == "ball") && ((((barrelsprite.x - this.x) * (barrelsprite.x - this.x)) + ((barrelsprite.y - this.y) * (barrelsprite.y - this.y))) < 100)) {
this.mydelete();
if (sprlist.length < 16) {
barrelsprite.fireball = 1;
}
} else if ((((!this.glock) && (!bobsprite.glock)) && (bobsprite.y < this.y)) && ((this.y - this.jumpheight) < bobsprite.y)) {
if (((!this.left) && (bobsprite.x < (this.x + this.w))) && (this.x < bobsprite.x)) {
bobsprite.left++;
if (this.sprite == "ball") {
bobsprite.scorenumber++;
} else {
bobsprite.scorenumber = bobsprite.scorenumber + 2;
}
this.left = 10;
}
if (((!this.right) && ((bobsprite.x + bobsprite.w) < (this.x + this.w))) && (this.x < (bobsprite.x + bobsprite.w))) {
bobsprite.right++;
this.right = 10;
}
}
if (0 < this.left) {
this.left--;
}
if (0 < this.right) {
this.right--;
}
}
function arrayconvert(instring) {
outarray = new Array();
dim = 1;
d1 = 0;
mylength = instring.length;
i = 2;
while (i < mylength) {
mychar = substring(instring, i, 1);
var _local1 = "[";
switch (mychar) {
case _local1 :
outarray[outarray.length] = new Array();
dim++;
Set("d" add dim, 0);
break;
case "," :
eval ("d" add dim)++;
break;
case "]" :
dim--;
eval ("d" add dim)++;
break;
default :
if (dim == 1) {
outarray[d1] = (isNaN(Number(outarray[d1] add mychar)) ? (outarray[d1] add mychar) : (Number(outarray[d1] add mychar)));
} else {
if (dim != 2) {
break;
}
outarray[d1][d2] = (isNaN(Number(outarray[d1][d2] add mychar)) ? (outarray[d1][d2] add mychar) : (Number(outarray[d1][d2] add mychar)));
}
}
i++;
}
return(outarray);
}
function stringconvert(inarray) {
outstring = "[";
i = 0;
while (i < inarray.length) {
ptype = inarray[i];
if (typeof(ptype) == "object") {
outstring = ((outstring add "[") add String(ptype)) add "]";
} else {
outstring = outstring add String(ptype);
if (i < (inarray.length - 1)) {
outstring = outstring add ",";
}
}
i++;
}
outstring = outstring add "]";
return(outstring);
}
function colldetect(mymap, mytxt) {
var mycoll = new Array();
var myarr = new Array();
i = 1;
while (eval (mytxt add i) ne "") {
myarr[i] = eval (mytxt add i);
i++;
}
mynumcoll = i - 1;
mymapx = mymap[0].length;
i = mymap.length;
while (i--) {
mycoll[i] = new Array();
j = mymapx;
while (j--) {
mycoll[i][j] = 0;
k = mynumcoll;
while (0 < k) {
l = myarr[k].length;
while (0 < l) {
if ((mymap[i][j] == myarr[k][l]) || (((myarr[k][l] == "to") && (myarr[k][l - 1] < mymap[i][j])) && (mymap[i][j] < myarr[k][l + 1]))) {
mycoll[i][j] = k;
}
l--;
}
k--;
}
}
}
return(mycoll);
}
function sortScores(a, b) {
var scoreA = a.pScore;
var scoreB = b.pScore;
return(scoreB - scoreA);
}
var loadAudio = true;
var soundToggle = "sOn";
Preloader = function (loadQue, frame) {
this.loadQue = loadQue;
this.frame = frame;
this.path = "http://news.bbc.co.uk/sportacademy/hi/fun/games/newsid_2676000/";
this.toLoad = (this.totalLoad = this.loadQue.length);
this.queUp();
};
Preloader.prototype.queUp = function () {
if (this.loadQue.length != 0) {
_root.loadbox.attachMovie("loadline", "loadline" add this.toLoad, this.toLoad + 10);
tellTarget ("_root.loadbox.loadline" add this.toLoad) {
_x = (178 - Math.round((176 * this.toLoad) / this.totalLoad));
_xscale = ((1 < this.toLoad) ? ((Math.round((176 * this.toLoad) / this.totalLoad) - Math.round((176 * (this.toLoad - 1)) / this.totalLoad)) - 1) : (Math.round((176 * this.toLoad) / this.totalLoad)));
};
this.loadtype = this.loadQue[0][0].substr(-3);
if (this.loadtype == "swf") {
_root.game.map.attachMovie("blank", this.loadQue[0][1], this.toLoad * 20);
this.curLoad = eval ("_root.game.map." add this.loadQue[0][1]);
this.curLoad.loadMovie(this.path add this.loadQue[0][0]);
} else if (this.loadtype == "txt") {
_root.attachMovie("blank", this.loadQue[0][1], this.toLoad * 20);
this.curLoad = eval ("_root." add this.loadQue[0][1]);
this.curLoad.loadVariables(this.path add this.loadQue[0][0]);
this.curLoad.end = "false";
}
if (this.loadQue[0][1] == "sound") {
_root.soundLoadBtn._visible = 1;
} else {
_root.soundLoadBtn._visible = 0;
}
MovieClip.addFLEMListener(this);
} else {
_root.gotoAndStop(this.frame);
}
};
Preloader.prototype.onEnterFrame = function () {
if (this.loadtype == "swf") {
ldBytes = this.curLoad.getBytesLoaded();
tlBytes = this.curLoad.getBytesTotal();
if (((String(tlBytes) != "") && (tlBytes != undefined)) && (tlBytes != 0)) {
ldedMov = Math.ceil(ldBytes / 1000) add "Kb";
tlMov = Math.ceil(tlBytes / 1000) add "Kb";
percLd = Math.ceil((ldBytes / tlBytes) * 100);
_root.preloadText = ((((((("LOADING " add this.loadQue[0][2]) add newline) add percLd) add "%") add newline) add ldedMov) add " of ") add tlMov;
if (ldBytes == tlBytes) {
this.endLoad();
}
} else {
_root.preloadText = "LOADING " add this.loadQue[0][2];
}
} else if (this.loadtype == "txt") {
_root.preloadText = (("LOADING " add this.loadQue[0][2]) add newline) add "PLEASE WAIT...";
if (this.curLoad.end == "true") {
this.endLoad();
}
}
};
Preloader.prototype.endLoad = function () {
MovieClip.removeFLEMListener(this);
this.loadQue.shift();
this.toLoad--;
this.queUp();
};
gamectrl = function () {
Object.addStaticFLEM(this);
_root.theGame.initFLEM(this);
this.die = false;
this.timer = new timer();
this.pause(0, "start");
game.masterSwitch = false;
game.sprlist = new Array();
this.dead = false;
};
gamectrl.prototype.onHit = function (mysprite) {
s = sprlist.length;
while (s--) {
sprlist[s].removeFLEMListener(this);
}
if (mysprite.sprite == "portal") {
bobsprite.portal();
s = sprlist.length;
while (s--) {
if (sprlist[s].sprite != "portal") {
MovieClip.removeFLEMListener(sprlist[s]);
if (sprlist[s].sprite != "bob") {
mymc = sprlist[s].mc;
tellTarget (mymc add "/move") {
stop();
};
}
}
}
this.pause(1000, "complete");
} else if (mysprite.sprite == "wgnoball") {
if (mysprite.die) {
bobsprite.mywin();
this.pause(0, "complete");
} else {
bobsprite.mydie();
this.pause(1500, "die");
}
} else if (mysprite.sprite == "bob") {
this.pause(1500, "die");
}
};
gamectrl.prototype.createspr = function (c) {
mytest = 0;
while (eval ("spr" add mytest) != undefined) {
mytest++;
}
Set("spr" add mytest, new _root.spriteObj(eval ("sprite" add c), eval ("swf" add c), mytest, eval ("x" add c), eval ("y" add c), eval ("sx" add c) * speed, eval ("sy" add c) * speed, eval ("gravity" add c) * speed, eval ("drag" add c), eval ("incrx" add c) * speed, eval ("incry" add c) * speed, eval ("jmax" add c), eval ("jincr" add c), 1 - ((1 - eval ("bnce" add c)) * speed)));
MovieClip.addFLEMListener(eval ("spr" add mytest));
};
gamectrl.prototype.doaction = function (myaction) {
MovieClip.addFLEMListener(this);
this.timer.removeFLEMListener(this);
if (myaction == "die") {
_root.game.map.sound.mainTune.stopAud();
_root.game.map.sound.bobDie.startAud(1);
this.sendFLEMEvent("stopTimer");
s = _root.game.sprlist.length;
while (s--) {
if (_root.game.sprlist[s].sprite != "bob") {
MovieClip.removeFLEMListener(sprlist[s]);
mymc = _root.game.sprlist[s].mc;
tellTarget (mymc add "/move") {
stop();
};
}
}
this.die = true;
this.sendFLEMEvent("gameDead");
trace("this.dead " + this.dead);
} else if (myaction == "end") {
trace("do end 02");
this.sendFLEMEvent("gameOverAni");
} else if (myaction == "start") {
this.sendFLEMEvent("getReady");
this.die = false;
trace("start");
s = sprlist.length;
while (s--) {
sprlist[s].mydelete();
}
s = sprites.length;
while (s--) {
Set("spr" add s, new _root.spriteObj(eval ("sprite" add sprites[s]), eval ("swf" add sprites[s]), s, eval ("x" add sprites[s]), eval ("y" add sprites[s]), eval ("sx" add sprites[s]) * speed, eval ("sy" add sprites[s]) * speed, eval ("gravity" add sprites[s]) * speed, eval ("drag" add sprites[s]), eval ("incrx" add sprites[s]) * speed, eval ("incry" add sprites[s]) * speed, eval ("jmax" add sprites[s]), eval ("jincr" add sprites[s]) / Math.pow(speed, 1.1), eval ("bnce" add sprites[s])));
}
bobsprite = spr0;
barrelsprite = spr2;
s = _root.game.sprlist.length;
while (s--) {
if (_root.game.sprlist[s].sprite == "WGgrace") {
MovieClip.addFLEMListener(_root.game.sprlist[s]);
}
}
} else if (myaction == "addscore") {
this.sendFLEMEvent("gameScore", bobsprite.scorenumber * 100);
trace("addscore" add bobsprite.scorenumber);
} else if (myaction == "complete") {
this.sendFLEMEvent("gameWin");
trace("complete");
} else if (myaction == "block") {
s = sprlist.length;
while (s--) {
if ((sprlist[s].sprite != "wgnoball") && (sprlist[s].sprite != "cupspr")) {
MovieClip.removeFLEMListener(sprlist[s]);
mymc = sprlist[s].mc;
tellTarget (mymc add "/move") {
stop();
};
}
}
this.pause(1000, "crumble");
} else if (myaction == "crumble") {
_root.game.map.sound.mainTune.stopAud();
s = sprlist.length;
while (s--) {
if (((sprlist[s].sprite != "bob") && (sprlist[s].sprite != "wgnoball")) && (sprlist[s].sprite != "cupspr")) {
sprlist[s].mydelete();
}
}
a = 14;
while (a--) {
b = numely + 1;
while (b--) {
if (b < 23) {
tellTarget ((("map/" add swfs[0]) add "/") add String(((a + 9) * (numely + 1)) + b)) {
gotoAndStop (1);
};
} else {
tellTarget ((("map/" add swfs[0]) add "/") add String(((a + 9) * (numely + 1)) + b)) {
gotoAndStop (4);
};
}
}
}
this.pause(500, "bossfall");
} else if (myaction == "bossfall") {
s = sprlist.length;
while (s--) {
if (sprlist[s].sprite == "wgnoball") {
sprlist[s].myfall();
}
}
} else if (myaction == "go") {
this.sendFLEMEvent("startTimer");
s = _root.game.sprlist.length;
if (s--) {
MovieClip.addFLEMListener(_root.game.sprlist[s]);
// unexpected jump
}
}
};
gamectrl.prototype.onEnterFrame = function () {
};
gamectrl.prototype.pause = function (mylength, myaction) {
this.timer.myaction = myaction;
this.timer.mylength = mylength;
this.timer.mystart = getTimer();
MovieClip.removeFLEMListener(this);
this.timer.addFLEMListener(this);
};
timer = function () {
this.base = Object.FLEM;
this.base();
delete this.base;
MovieClip.addFLEMListener(this);
};
timer.prototype.__proto__ = Object.FLEM.prototype;
timer.prototype.onEnterFrame = function () {
if ((getTimer() - this.mystart) >= this.mylength) {
this.sendFLEMEvent("doaction", this.myaction);
}
};
spriteObj = function (mysprite, myswf, mydepth, myx, myy, mysx, mysy, mygravity, mydrag, myincrx, myincry, myjmax, myjincr, mybnce) {
this.depth = mydepth;
this.mc = (("map/" add game.swfs[myswf]) add "/") add mydepth;
this.sprite = eval (("game.map." add game.swfs[myswf]) add ".mylinks")[mysprite];
this.x = myx;
this.y = myy;
this.sx = mysx;
this.sconx = 0;
this.sy = mysy;
this.w = eval (("game.map." add game.swfs[myswf]) add ".myw")[mysprite];
this.h = eval (("game.map." add game.swfs[myswf]) add ".myh")[mysprite];
this.gravity = mygravity;
this.drag = mydrag;
this.incrx = myincrx;
this.incry = myincry;
this.dx = ((mysx == 0) ? -1 : (Math.abs(mysx) / mysx));
this.dy = ((mysy == 0) ? 0 : (Math.abs(mysy) / mysy));
this.move = false;
this.frame = 1;
this.j = myjmax;
this.jmax = myjmax;
this.jincr = myjincr;
this.bnce = mybnce;
eval ("game.map." add game.swfs[myswf]).attachMovie(this.sprite, mydepth, mydepth);
setProperty("game/" add this.mc, _x , this.x);
setProperty("game/" add this.mc, _y , this.y);
this.ladder = false;
this.glock = false;
this.die = 0;
Object.addStaticFLEM(this);
this.addFLEMListener(game.gamectrl);
this.inherit(eval (this.sprite));
game.sprlist[game.sprlist.length] = this;
};
spriteObj.prototype.inherit = function (superClass) {
this.temp = superClass;
this.temp();
delete this.temp;
this.__proto__ = superClass.prototype;
};
bob = function () {
this.dmatrix = new Array();
this.dmatrix[0] = [8, 1, 2];
this.dmatrix[1] = [7, 0, 3];
this.dmatrix[2] = [6, 5, 4];
this.mframe = this.dmatrix[this.dx + 1][this.dy + 1];
tellTarget ("game/" add this.mc) {
gotoAndStop(this.mframe);
};
tellTarget (("game/" add this.mc) add "/move") {
gotoAndStop (1);
};
this.falling = 0;
this.left = 0;
this.right = 0;
this.scorenumber = 0;
this.battime = 0;
this.jmaxstart = this.jmax;
this.win = 0;
};
bob.prototype.myctrl = function () {
if ((this.j == this.jmax) && (!this.battime)) {
if (((this.ladder == 2) || (this.glock)) && (Key.isDown(38) || (Key.isDown(81)))) {
this.dy = -1;
this.sy = this.sy - this.incry;
this.sx = 0;
this.sconx = 0;
this.glock = true;
}
if (((this.ladder == 1) || (this.glock)) && (Key.isDown(40) || (Key.isDown(65)))) {
this.dy = 1;
this.sy = this.sy + this.incry;
this.sx = 0;
this.sconx = 0;
this.glock = true;
}
}
if (!this.glock) {
if (Key.isDown(37) || (Key.isDown(79))) {
this.dx = -1;
this.sx = this.sx - this.incrx;
}
if (Key.isDown(39) || (Key.isDown(80))) {
this.dx = 1;
this.sx = this.sx + this.incrx;
}
this.j = (((0 < this.j) && (0 >= this.sy)) ? (this.j - (1 * speed)) : 0);
if (Key.isDown(32)) {
this.sy = this.sy - (this.j / this.jincr);
}
}
};
bob.prototype.mycoll = mycoll;
bob.prototype.myframe = myframe;
bob.prototype.mydie = function () {
_root.game.map.sound.mainTune.stopAud(1);
_root.game.map.sound.bobAhh.startAud(1);
tellTarget (this.mc) {
gotoAndStop(this.dmatrix[this.dx + 1][this.dy + 1] + 16);
};
this.end = getProperty(this.mc add "/move", _totalframes);
this.die = 1;
this.sendFLEMEvent("onHit", this);
};
bob.prototype.portal = function () {
_root.game.map.sound.mainTune.stopAud();
_root.game.map.sound.vortex.startAud(1);
tellTarget (this.mc) {
gotoAndStop(this.dmatrix[this.dx + 1][this.dy + 1] + 24);
};
};
bob.prototype.mydelete = mydelete;
bob.prototype.myleft = function (myobject) {
this.left++;
};
bob.prototype.myright = function (myobject) {
this.right++;
};
bob.prototype.mystartbat = function () {
this.battime = Math.round(200 / speed);
this.batx = this.x;
this.baty = this.y - 30;
this.jmax = this.jmax - 2;
};
bob.prototype.mycheckbat = function () {
mycurrentframe = getProperty(this.mc add "/move", _currentframe);
if (mycurrentframe < 3) {
this.batx = this.x - (14 * this.dx);
this.baty = this.y - 18;
} else if (4 < mycurrentframe) {
this.batx = this.x + (16 * this.dx);
this.baty = this.y + 7;
} else {
this.batx = this.x + (7 * this.dx);
this.baty = this.y - 19;
}
this.battime--;
if (!this.battime) {
this.jmax = this.jmaxstart;
}
};
bob.prototype.mywin = function () {
bobsprite.x = 340;
bobsprite.y = 18;
bobsprite.sx = 0.1;
bobsprite.dx = 1;
bobsprite.sy = 0;
bobsprite.glock = false;
MovieClip.addFLEMListener(this);
this.win = 1;
};
bob.prototype.onEnterFrame = function () {
if (!this.die) {
this.myframe();
if (this.battime) {
this.mycheckbat();
}
if (!this.win) {
this.myctrl();
} else {
this.j = (((0 < this.j) && (0 >= this.sy)) ? (this.j - (1 * speed)) : 0);
if ((55 / speed) < this.win) {
this.win = 1;
} else if ((30 / speed) < this.win) {
this.sy = this.sy - (this.j / this.jincr);
}
this.win++;
}
this.mycoll();
if ((50 < this.falling) && (this.j == this.jmax)) {
this.mydie();
}
if ((this.j != this.jmax) && (0 < this.sy)) {
this.falling = this.falling + this.sy;
} else {
this.falling = 0;
}
if (this.x < 0) {
this.x = 0;
}
if ((mapwidth * elx) < (this.x + this.w)) {
this.x = (mapwidth * elx) - this.w;
}
if ((mapheight * ely) < (this.y + this.h)) {
this.y = ((mapheight * ely) - this.h) - 1;
this.sy = (-mysy) * this.bnce;
this.j = this.jmax;
}
if ((this.left && (this.right)) && (this.left == this.right)) {
if (1 < this.left) {
this.scorenumber = this.scorenumber + (this.left - 1);
}
this.scorex = Math.round(this.x + (this.w / 2));
this.scorey = Math.round((this.y + (this.h / 2)) + 10);
this.ball = 0;
while (eval ("spr" add this.ball) != undefined) {
this.ball++;
}
Set("spr" add this.ball, new _root.spriteObj(1, 1, this.ball, this.scorex, this.scorey, 0, 0, 0, 0, 0, 0, 1, 0, 0));
MovieClip.addFLEMListener(eval ("spr" add this.ball));
this.sendFLEMEvent("doaction", "addscore");
this.left = 0;
this.right = 0;
this.scorenumber = 0;
}
if (this.j == this.jmax) {
this.left = 0;
this.right = 0;
this.scorenumber = 0;
}
setProperty(this.mc, _x , this.x);
setProperty(this.mc, _y , this.y);
this.sx = ((0.6 < Math.abs(this.sx)) ? (this.sx * this.drag) : 0);
this.sy = ((0.6 < Math.abs(this.sy)) ? (this.sy * this.drag) : 0);
} else {
this.die++;
if ((mapheight * ely) < getProperty(this.mc, _y)) {
if (gamectrl.dead) {
gamectrl.pause(500, "end");
} else {
gamectrl.pause(500, "start");
}
this.mydelete();
} else if (this.end < this.die) {
this.sy = this.sy + this.gravity;
setProperty(this.mc, _y , getProperty(this.mc, _y) + this.sy);
this.sy = this.sy * this.drag;
}
}
};
ball = function () {
this.left = 0;
this.right = 0;
this.jumpheight = 30;
};
ball.prototype.myctrl = function () {
if ((((this.ladder == 1) || (this.glock)) && (this.j == this.jmax)) && (random(Math.round(5 / speed)) == 0)) {
this.glock = true;
}
if (this.glock) {
this.dy = 1;
this.sy = this.incry;
this.sx = 0;
}
if (0 < this.sx) {
this.dx = 1;
} else {
this.dx = -1;
}
this.j = ((0 < this.j) ? (this.j - 1) : 0);
};
ball.prototype.mycoll = function () {
if (!this.glock) {
this.sy = this.sy + this.gravity;
}
myx = ((Math.abs(this.sx) < elx) ? ((this.x = this.x + ((mysx = this.sx)))) : ((this.x = this.x + ((elx * Math.abs(this.sx)) / ((mysx = this.sx))))));
myy = ((Math.abs(this.sy) < ely) ? ((this.y = this.y + ((mysy = this.sy)))) : ((this.y = this.y + ((ely * Math.abs(this.sy)) / ((mysy = this.sy))))));
myj = this.j;
if (true) {
myfloorx = Math.floor(myx / elx);
myfloory = Math.floor(myy / ely);
myfloorw = Math.floor(((myx + this.w) - 1) / elx);
myfloorh = Math.floor(((myy + this.h) - 1) / ely);
myfloorcx = Math.floor((myx + (this.w / 2)) / elx);
myfloorcy = Math.floor((myy + (this.h / 2)) / ely);
mycollx = ((mapcoll[myfloorh][myfloorx] == 3) ? (mapcoll[(myxh = myfloorh - 1)][myfloorx]) : (mapcoll[(myxh = myfloorh)][myfloorx]));
mycollc = ((mapcoll[myfloorh][myfloorcx] == 3) ? (mapcoll[(mych = myfloorh - 1)][myfloorcx]) : (mapcoll[(mych = myfloorh)][myfloorcx]));
mycollw = ((mapcoll[myfloorh][myfloorw] == 3) ? (mapcoll[(mywh = myfloorh - 1)][myfloorw]) : (mapcoll[(mywh = myfloorh)][myfloorw]));
mygridx = Math.floor(mapgrid[myxh][myfloorx] / 3);
mygridc = Math.floor(mapgrid[mych][myfloorcx] / 3);
mygridw = Math.floor(mapgrid[mywh][myfloorw] / 3);
myslope = 0;
myblock = false;
myconveyor = false;
if ((3 < mycollx) || (3 < mycollw)) {
myslope = (((((2 * Math.round(mycollx / 2)) / mycollx) == 1) || (((2 * Math.round(mycollw / 2)) / mycollw) == 1)) ? -1 : 1);
ptopx = ((24 < mygridx) ? (myxh * ely) : ((((myxh * ely) + mygridx) - (myslope * 6)) - 7));
ptopw = ((24 < mygridw) ? (mywh * ely) : ((((mywh * ely) + mygridw) - (myslope * 6)) - 7));
ptop = ((((((((ptopx < ptopw) && ((((myy + this.h) - 3) - ptopx) < mysy)) && (mapcoll[myfloorh - 1][myfloorx] < 6)) && (2 < mycollx)) || ((((myy + this.h) - 3) - ptopw) >= mysy)) || (5 < mapcoll[myfloorh - 1][myfloorw])) || (mycollw < 3)) ? (ptopx) : (ptopw));
if ((5 < mycollx) || (5 < mycollw)) {
myblock = true;
}
} else if ((5 < mapcoll[myfloory][myfloorx]) || (5 < mapcoll[myfloory][myfloorw])) {
myblock = true;
}
if (((((mycollc == 4) || (mycollc == 5)) && (mygridc < 33)) || (mycollc == 6)) || (mycollc == 7)) {
this.ladder = mapgrid[mych][myfloorcx] - (mygridc * 3);
} else {
this.ladder = 0;
}
if ((!this.die) && ((mycollx == 1) || (mycollw == 1))) {
this.mydie();
} else if (((!this.glock) || (this.ladder == 2)) && (myblock)) {
mygrady = ((0 < mysy) ? (((myy + this.h) - ((((myxtray = ((myexacty = myfloorh)) - 1)) + 1) * ely)) * mysx) : ((myy - (((myxtray = ((myexacty = myfloory)) + 1)) * ely)) * mysx));
mygradx = ((0 < mysx) ? (((myx + this.w) - ((((myxtrax = ((myexactx = myfloorw)) - 1)) + 1) * elx)) * mysy) : ((myx - (((myxtrax = ((myexactx = myfloorx)) + 1)) * elx)) * mysy));
if ((((0 < mysy) && ((((myy + this.h) - 3) - ptop) < mysy)) && (ptop < (myy + this.h))) && ((((mygradx * mysx) >= (mygrady * mysx)) && (mapgrid[myxtray][myexactx] < 3)) || (2 < mapgrid[myexacty][myxtrax]))) {
if (this.glock) {
this.glock = false;
this.ladder = 0;
}
this.dy = 0;
mysin = 0.083 * myslope;
rotvx = (this.sy * mysin) + (this.sx * 0.997);
rotvy = this.bnce * ((this.sx * mysin) - (this.sy * 0.997));
this.sx = ((-rotvy) * mysin) + (rotvx * 0.997);
this.sy = (rotvx * mysin) + (rotvy * 0.997);
this.y = ptop - this.h;
this.j = this.jmax;
} else if ((mysy < 0) && ((((mygrady * mysx) >= (mygradx * mysx)) && (mapgrid[myxtray][myexactx] < 3)) || (5 < mapcoll[myexacty][myxtrax]))) {
this.y = (myfloory + 1) * ely;
this.sy = (-mysy) * this.bnce;
}
if ((0 < mysx) && ((((mygrady * mysy) >= (mygradx * mysy)) && (mapgrid[myexacty][myxtrax] < 3)) || (5 < mapcoll[myxtray][myexactx]))) {
this.x = (myfloorw * elx) - this.w;
this.sx = (-mysx) * this.bnce;
} else if ((mysx < 0) && ((((mygradx * mysy) >= (mygrady * mysy)) && (mapgrid[myexacty][myxtrax] < 3)) || (5 < mapcoll[myxtray][myexactx]))) {
this.x = (myfloorx + 1) * elx;
this.sx = (-mysx) * this.bnce;
}
} else if ((((myslope != 0) && ((((myy + this.h) - 3) - ptop) < mysy)) && (ptop < (myy + this.h))) && ((!this.glock) || (this.ladder == 2))) {
if (this.glock) {
this.glock = false;
this.ladder = 0;
}
this.dy = 0;
mysin = 0.083 * myslope;
rotvx = (this.sy * mysin) + (this.sx * 0.997);
rotvy = this.bnce * ((this.sx * mysin) - (this.sy * 0.997));
this.sx = ((-rotvy) * mysin) + (rotvx * 0.997);
this.sy = (rotvx * mysin) + (rotvy * 0.997);
this.y = ptop - this.h;
this.j = this.jmax;
} else {
}
}
if (this.glock) {
this.x = ((myfloorcx + 0.5) * elx) - (this.w / 2);
}
};
ball.prototype.myframe = function () {
tellTarget (this.mc) {
gotoAndStop((this.dx * 2) + 3);
};
};
ball.prototype.mydie = function () {
_root.game.map.sound.ballExplode.startAud(1);
eval (this.mc).gotoAndStop((this.dx * 2) + 11);
this.end = getProperty(this.mc add "/move", _totalframes);
this.die = 1;
};
ball.prototype.mydelete = mydelete;
ball.prototype.mybobcoll = mybobcoll;
ball.prototype.onEnterFrame = function () {
if (!this.die) {
this.myframe();
this.myctrl();
this.mycoll();
setProperty(this.mc, _x , this.x);
setProperty(this.mc, _y , this.y);
this.sx = this.sx * this.drag;
this.sy = this.sy * this.drag;
if ((this.x < 0) || ((mapheight * ely) < this.y)) {
this.mydelete();
}
this.mybobcoll();
} else {
this.die++;
if (this.end < this.die) {
this.mydelete();
}
}
};
WGgrace = function () {
this.timetotal = Math.round(75 / Math.pow(game.speed, 2));
this.timereset = Math.round(60 / Math.pow(game.speed, 2));
this.timeget = Math.round(20 / Math.pow(game.speed, 2));
this.timehold = Math.round(10 / Math.pow(game.speed, 2));
this.timing = Math.round(21 / game.speed);
tellTarget ("game/" add this.mc) {
gotoAndStop(3 + (this.dx * 2));
};
};
WGgrace.prototype.mydelete = mydelete;
WGgrace.prototype.onEnterFrame = function () {
this.timing--;
if (this.timing == this.timereset) {
tellTarget (this.mc) {
gotoAndStop(3 + (this.dx * 2));
};
} else if (this.timing == this.timeget) {
tellTarget (this.mc) {
gotoAndStop(11 + (this.dx * 2));
};
} else if (this.timing == this.timehold) {
tellTarget (this.mc) {
gotoAndStop(19 + (this.dx * 2));
};
} else if (this.timing < 1) {
tellTarget (this.mc) {
gotoAndStop(27 + (this.dx * 2));
};
gamectrl.createspr(2);
this.timing = this.timetotal;
}
if ((((this.x < (bobsprite.x + bobsprite.w)) && (bobsprite.x < (this.x + this.w))) && (this.y < (bobsprite.y + bobsprite.h))) && (bobsprite.y < (this.y + this.h))) {
bobsprite.mydie();
}
};
barrel = function () {
tellTarget (("game/" add this.mc) add "/move") {
gotoAndStop (1);
};
this.end = getProperty(("game/" add this.mc) add "/move", _totalframes);
this.fireball = 0;
};
barrel.prototype.myctrl = function () {
};
barrel.prototype.mydelete = mydelete;
barrel.prototype.onEnterFrame = function () {
if (this.fireball) {
if (this.fireball == 1) {
_root.game.map.sound.splash.startAud(1);
tellTarget (this.mc add "/move") {
gotoAndPlay (1);
};
} else if (this.fireball >= this.end) {
gamectrl.createspr(4);
this.fireball = -1;
}
this.fireball++;
}
if ((((this.x < (bobsprite.x + bobsprite.w)) && (bobsprite.x < (this.x + this.w))) && (this.y < (bobsprite.y + bobsprite.h))) && (bobsprite.y < (this.y + this.h))) {
bobsprite.mydie();
}
};
fireball = function () {
tellTarget ("game/" add this.mc) {
gotoAndStop (1);
};
this.dx = 0;
this.left = 0;
this.right = 0;
this.jumpheight = 30;
};
fireball.prototype.myctrl = function () {
if (!this.glock) {
if (this.dx == 0) {
this.dx = (((this.x - bobsprite.x) < 0) ? 1 : -1);
}
this.sx = this.sx + (this.incrx * this.dx);
if ((this.ladder == 1) && (random(Math.round(5 / speed)) == 0)) {
this.glock = true;
this.dy = 1;
this.dx = 0;
this.sx = 0;
this.sconx = 0;
} else if ((this.ladder == 2) && (random(Math.round(5 / speed)) == 0)) {
this.glock = true;
this.dy = -1;
this.dx = 0;
this.sx = 0;
this.sconx = 0;
}
}
if (this.dy != 0) {
this.sy = this.incry * this.dy;
}
};
fireball.prototype.mycoll = mycoll;
fireball.prototype.mydie = function () {
_root.game.map.sound.ballExplode.startAud(1);
eval (this.mc).gotoAndStop(2);
this.end = getProperty(this.mc add "/move", _totalframes);
this.die = 1;
};
fireball.prototype.mydelete = mydelete;
fireball.prototype.mybobcoll = mybobcoll;
fireball.prototype.onEnterFrame = function () {
if (!this.die) {
this.myctrl();
this.mycoll();
setProperty(this.mc, _x , this.x);
setProperty(this.mc, _y , this.y);
this.sx = this.sx * this.drag;
this.sy = this.sy * this.drag;
if ((this.x < 0) || ((mapwidth * elx) < (this.x + this.w))) {
this.dx = 0;
}
if ((mapheight * ely) < this.y) {
this.mydelete();
}
this.mybobcoll();
} else {
this.die++;
if (this.end < this.die) {
this.mydelete();
}
}
};
WGnoball = function () {
tellTarget ("game/" add this.mc) {
gotoAndStop (1);
};
tellTarget (("game/" add this.mc) add "/move") {
gotoAndStop (1);
};
this.end = getProperty(("game/" add this.mc) add "/move", _totalframes);
this.mycount = 0;
};
WGnoball.prototype.mydelete = mydelete;
WGnoball.prototype.myfall = function () {
tellTarget (this.mc add "/move") {
play();
};
this.die = 1;
};
WGnoball.prototype.onEnterFrame = function () {
if (this.die) {
this.die++;
this.sy = this.sy + this.gravity;
this.y = this.y + this.sy;
if (((ely * (numely - 5)) + 3) < (this.y + this.h)) {
if (this.mycount < 3) {
_root.game.map.sound.graceFall.startAud(1);
}
this.sy = (-this.bnce) * this.sy;
this.y = ((ely * (numely - 5)) - this.h) + 3;
this.mycount++;
}
setProperty(this.mc, _y , this.y);
this.sy = this.sy * this.drag;
if (this.end < this.die) {
this.sendFLEMEvent("onHit", this);
this.die = 0;
}
}
if ((((this.x < (bobsprite.x + bobsprite.w)) && (bobsprite.x < (this.x + this.w))) && (this.y < (bobsprite.y + bobsprite.h))) && (bobsprite.y < (this.y + this.h))) {
bobsprite.mydie();
}
};
portal = function () {
};
portal.prototype.mydelete = mydelete;
portal.prototype.onEnterFrame = function () {
if (!this.die) {
mybobcx = (2 * ((bobsprite.x + (bobsprite.w / 2)) - this.x)) / this.w;
mybobcy = (2 * ((bobsprite.y + (bobsprite.h / 2)) - this.y)) / this.h;
if (((mybobcx * mybobcx) + (mybobcy * mybobcy)) < 1) {
this.sendFLEMEvent("onHit", this);
this.die = 1;
}
}
};
shane = function () {
this.dmatrix = new Array();
this.dmatrix[0] = [8, 1, 2];
this.dmatrix[1] = [7, 0, 3];
this.dmatrix[2] = [6, 5, 4];
this.mframe = this.dmatrix[this.dx + 1][this.dy + 1];
tellTarget ("game/" add this.mc) {
gotoAndStop(this.mframe);
};
tellTarget (("game/" add this.mc) add "/move") {
gotoAndStop (1);
};
this.left = 0;
this.right = 0;
this.jumpheight = 30;
};
shane.prototype.myctrl = function () {
if (!this.glock) {
if (this.dx == 0) {
this.dx = (((this.x - bobsprite.x) < 0) ? 1 : -1);
}
this.sx = this.sx + (this.incrx * this.dx);
if ((this.ladder == 1) && (random(Math.round(8 / speed)) == 0)) {
this.glock = true;
this.dy = 1;
this.dx = 0;
this.sx = 0;
this.sconx = 0;
} else if ((this.ladder == 2) && (random(Math.round(8 / speed)) == 0)) {
this.glock = true;
this.dy = -1;
this.dx = 0;
this.sx = 0;
this.sconx = 0;
}
}
if (this.dy != 0) {
this.sy = this.incry * this.dy;
}
};
shane.prototype.mycoll = mycoll;
shane.prototype.mydie = function () {
eval (this.mc).gotoAndStop((this.dx * 2) + 11);
this.end = getProperty(this.mc add "/move", _totalframes);
this.die = 1;
};
shane.prototype.reincarnate = function () {
r = this.depth;
this.x = eval ("x" add sprites[r]);
this.y = eval ("y" add sprites[r]);
this.sx = eval ("sx" add sprites[r]);
this.sy = eval ("sy" add sprites[r]);
setProperty(this.mc, _x , this.x);
setProperty(this.mc, _y , this.y);
this.ladder = false;
this.glock = false;
this.dx = ((this.sx == 0) ? -1 : (Math.abs(this.sx) / this.sx));
this.dy = ((this.sy == 0) ? 0 : (Math.abs(this.sy) / this.sy));
this.mframe = this.dmatrix[this.dx + 1][this.dy + 1];
tellTarget (this.mc) {
gotoAndStop(this.mframe);
};
tellTarget (this.mc add "/move") {
gotoAndStop (1);
};
this.left = 0;
this.right = 0;
};
shane.prototype.myframe = myframe;
shane.prototype.mydelete = mydelete;
shane.prototype.mybobcoll = mybobcoll;
shane.prototype.onEnterFrame = function () {
if (!this.die) {
this.myframe();
this.myctrl();
this.mycoll();
setProperty(this.mc, _x , this.x);
setProperty(this.mc, _y , this.y);
this.sx = this.sx * this.drag;
this.sy = this.sy * this.drag;
if ((this.x < 0) || ((mapwidth * elx) < (this.x + this.w))) {
this.dx = 0;
}
if ((mapheight * ely) < this.y) {
this.mydelete();
}
this.mybobcoll();
} else {
this.die++;
if ((this.end + 120) < this.die) {
setProperty(this.mc, _visible , true);
this.die = 0;
} else if (this.die == (this.end + 100)) {
this.reincarnate();
} else if ((this.end + 100) < this.die) {
setProperty(this.mc, _visible , !getProperty(this.mc, _visible));
}
}
};
scorespr = function () {
this.die = 0;
this.life = 20;
tellTarget ("game/" add this.mc) {
gotoAndStop(_root.game.bobsprite.scorenumber);
};
};
scorespr.prototype.mydelete = mydelete;
scorespr.prototype.onEnterFrame = function () {
this.die++;
if (this.life < this.die) {
this.mydelete();
}
};
cupspr = function () {
};
cupspr.prototype.mydelete = mydelete;
cupspr.prototype.onEnterFrame = function () {
};
batspr = function () {
};
batspr.prototype.mydelete = mydelete;
batspr.prototype.onEnterFrame = function () {
if ((((this.x < (bobsprite.x + bobsprite.w)) && (bobsprite.x < (this.x + this.w))) && (this.y < (bobsprite.y + bobsprite.h))) && (bobsprite.y < (this.y + this.h))) {
bobsprite.mystartbat();
this.mydelete();
}
};
_root.cookCrickWCScore;
dataArr = new Array(["data/newlevel02.txt", "data01", "level data 1", "level 1", 400000], ["data/roblevel01.txt", "data02", "level data 2", "level 2", 400000], ["data/oldlevel01.txt", "data03", "level data 3", "level 3", 600000], ["data/roblevel04.txt", "data04", "level data 4", "boss level", 2000000], ["data/newlevel01.txt", "data05", "level data 5", "level 5", 400000], ["data/roblevel02.txt", "data06", "level data 6", "level 6", 400000], ["data/newlevel03.txt", "data07", "level data 7", "level 7", 400000], ["data/roblevel03.txt", "data08", "level data 8", "level 8", 600000], ["data/newlevel04.txt", "data09", "level data 9", "boss level", 2000000]);
gfxArr = new Array(["swf/bad.swf", "bad", "shane sprite"], ["swf/grace.swf", "grace", "grace sprite"], ["swf/ball.swf", "ball", "ball sprite"], ["swf/bob.swf", "bob", "bob sprite"], ["swf/level01.swf", "level01", "tileset 1 gfx"], ["swf/level02.swf", "level02", "tileset 2 gfx"], ["swf/level03.swf", "level03", "tileset 3 gfx"], ["swf/level04.swf", "level04", "tileset 4 gfx"], ["swf/sound01.swf", "sound", "sound"]);
GameObj = function () {
this.loadClip = loadClip;
this.curScore = 0;
this.playerName = "AAA";
this.gameLevel = 1;
this.gameSpeed = 1;
this.extraLife = 0;
this.life = 3;
this.cumScore;
this.highScore = highScore;
this.passLevel = 0;
this.allScores = new Array();
this.highScore = highScore;
trace(_root.cookCrickWCScore);
if (_root.cookCrickWCScore != undefined) {
trace("diss one");
this.cookNames = _root.cookCrickWCPlayer.split("@");
this.cookScores = _root.cookCrickWCScore.split("@");
this.addCookieScores();
} else {
this.cookNames = new Array("ADM", "ROB", "BOV", "LOZ", "SUE", "JOI", "LUI", "FIO", "TYU", "PLO");
this.cookScores = new Array(4000, 3500, 3000, 2500, 2000, 1500, 1000, 800, 500, 100);
this.addCookieScores();
}
};
GameObj.prototype = new Object.FLEM();
GameObj.prototype.addCookieScores = function () {
var lenCook = this.cookScores.length;
var i = 0;
while (i < lenCook) {
trace("this.cookScores[i] " + typeof(this.cookScores[i]));
if (this.cookScores[i] != NaN) {
this.addScore(Number(this.cookScores[i]), this.cookNames[i]);
} else {
trace("NO SCORE");
this.addScore(0, "xxx");
}
this.allScores[i].current = 0;
i++;
}
this.highScore = this.cookScores[0];
if (this.highScore == undefined) {
this.highScore = 0;
}
_root.hS_Disp = this.highScore;
};
GameObj.prototype.startTimer = function () {
trace("start timer");
MovieClip.addFLEMListener(this);
};
GameObj.prototype.stopTimer = function () {
trace("stop timer");
MovieClip.removeFLEMListener(this);
};
GameObj.prototype.setSpeed = function () {
return(this.gameSpeed);
};
GameObj.prototype.onEnterFrame = function () {
this.levTime++;
};
GameObj.prototype.doaction = function (arg) {
this.sendFLEMEvent("doaction", value);
};
GameObj.prototype.setPlayerName = function (newName) {
this.playerName = newName;
};
GameObj.prototype.init = function () {
trace("this.gameLevel " + this.gameLevel);
this.dataSet = "/" add _root.dataArr[this.gameLevel - 1][1];
this.levelTitle = _root.dataArr[this.gameLevel - 1][3];
this.levBonus = _root.dataArr[this.gameLevel - 1][4];
this.passLevel = 0;
this.levTime = 0;
this.deadGrace = 0;
_root.hS_Disp = this.highScore;
};
GameObj.prototype.initFLEM = function (gameControl) {
trace("gameControl " + gameControl);
this.gameControl = gameControl;
this.gameControl.addFLEMListener(this);
};
GameObj.prototype.gameWin = function () {
_root.game.map.sound.mainTune.stopAud();
_root.gotoAndPlay("bonus");
if (this.gameLevel == _root.dataArr.length) {
this.gameSpeed = this.gameSpeed + 0.2;
_root.bonusWack._visible = false;
_root.howsThat._visible = true;
_root.howsThat.play;
} else {
_root.bonusWack._visible = true;
_root.howsThat._visible = false;
_root.howsThat.stop();
}
this.passLevel = 1;
this.evaluateLev();
};
GameObj.prototype.addBonus = function () {
this.gameScore(Math.round(this.levBonus / this.levTime));
this.cumScore = this.curScore;
};
GameObj.prototype.continueGame = function () {
this.clearScreen();
_root.gotoAndPlay("winLoose");
};
GameObj.prototype.gameDead = function () {
this.cumScore = this.curScore;
this.passLevel = 0;
this.gameControl.dead = this.evaluateLev();
};
GameObj.prototype.gameScore = function (value) {
_root.game.map.sound.score.startAud(1);
this.curScore = this.curScore + Number(value);
_root.S_Disp = this.curScore;
this.lifeBonus();
};
GameObj.prototype.lifeBonus = function () {
var extL = Math.floor(this.curScore / 5000);
if (this.extraLife != extL) {
_root.game.map.sound.newLife.startAud();
trace((("extL " + extL) + "this.extraLife ") + this.extraLife);
if (this.life < 3) {
this.life++;
_root.lifeMov.gotoAndStop((10 * (3 - this.life)) + 1);
}
this.extraLife++;
}
};
GameObj.prototype.gameOver = function () {
eval (("/game/map/" add _root.game.swfs[0]) add "/background").removeMovieClip();
this.gameSpeed = 1;
this.addScore(this.cumScore, this.playerName);
this.cumScore = 0;
this.curScore = 0;
this.extraLife = 0;
this.life = 3;
this.gameLevel = 1;
_root.game._visible = 0;
_root.S_Disp = this.curScore;
};
GameObj.prototype.reset = function () {
_root.game._visible = 1;
this.clearScreen();
_root.gotoAndPlay("menu");
};
GameObj.prototype.gameOverAni = function () {
_root.gotoAndPlay("gameOver");
};
GameObj.prototype.clearScreen = function () {
mytile = _root.game.swfs[0];
eval (("/game/map/" add mytile) add "/background").removeMovieClip();
trace("clear all");
s = _root.game.sprlist.length;
while (s--) {
_root.game.sprlist[s].mydelete();
}
MovieClip.removeFLEMListener(_root.game.gamectrl);
MovieClip.removeFLEMListener(_root.game.gamectrl.timer);
if (_root.game.gamectrl != undefined) {
delete _root.game.gamectrl;
}
a = _root.game.numelx + 1;
while (a--) {
b = _root.game.numely + 1;
while (b--) {
mystring = String((a * (_root.game.numely + 1)) + b);
mypath = (("/game/map/" add mytile) add "/") add mystring;
eval (mypath).removeMovieClip();
}
}
};
GameObj.prototype.getReady = function () {
_root.gotoAndStop("getReady");
};
GameObj.prototype.killBoss = function () {
_root.howsThat.play();
};
GameObj.prototype.evaluateLev = function () {
if (this.passLevel) {
trace("gameLevel " add _root.dataArr);
trace("gameLevel " + this.gameLevel);
if (this.gameLevel < _root.dataArr.length) {
this.gameLevel++;
} else {
this.gameLevel = 1;
}
} else {
this.life--;
_root.lifeMov.gotoAndStop((10 * (3 - this.life)) + 1);
}
if (this.life == 0) {
return(true);
}
return(false);
};
GameObj.prototype.setBG = function () {
_root.backGround.gotoAndStop(this.bg);
};
GameObj.prototype.writeCookie = function (players, scores) {
trace("strPlayers " + strPlayers);
trace("strScore " + strScore);
var strPlayers = players.join("@");
var strScore = scores.join("@");
trace("strPlayers " + strPlayers);
trace("strScore " + strScore);
getURL (((("javascript:cookit('cookCrickWCPlayer','" add strPlayers) add "','cookCrickWCScore','") add strScore) add "')");
};
GameObj.prototype.addScore = function (player, score) {
this.allScores.push(new scoreItem(player, score));
};
GameObj.prototype.makeScoreBoard = function () {
var sAL = this.allScores.length;
this.allScores.sort(sortScores);
nameStore = new Array();
scoreStore = new Array();
var ps = 0;
while (ps < 10) {
var sPos = (ps + 1);
var fieldName = ((nameStore[ps] = this.allScores[ps].pName));
var fieldNumb = ((scoreStore[ps] = this.allScores[ps].pScore));
if (fieldNumb == null) {
var fieldName = "XXX";
var fieldNumb = 0;
}
_root.scoreBoard["sB0" + sPos].sText = ((sPos + " ") + fieldName) + " ....................";
_root.scoreBoard["sB0" + sPos].sNumb = " " + fieldNumb;
if (this.allScores[ps].current) {
var barColour = new Color(_root.scoreBoard["sB0" + sPos]);
barColour.setRGB(16711680);
this.allScores[ps].current = 0;
}
ps++;
}
this.highScore = this.allScores[0].pScore;
_root.hS_Disp = this.highScore;
this.writeCookie(nameStore, scoreStore);
};
ScoreItem = function (pScore, pName) {
this.current = 1;
this.pScore = pScore;
this.pName = pName;
};
GameObj.prototype.onMakeScreen = function () {
var levPath = this.dataSet;
tellTarget ("/game") {
numelx = Number(eval (this.dataSet + ":numelx"));
numely = Number(eval (this.dataSet + ":numely"));
i = 0;
while (eval ((levPath + ":sprite") add i) != undefined) {
Set("sprite" add i, Number(eval ((this.dataSet + ":sprite") add i)));
Set("swf" add i, Number(eval ((this.dataSet + ":swf") add i)));
Set("x" add i, Number(eval ((this.dataSet + ":x") add i)));
Set("y" add i, Number(eval ((this.dataSet + ":y") add i)));
Set("sx" add i, Number(eval ((this.dataSet + ":sx") add i)));
Set("sy" add i, Number(eval ((this.dataSet + ":sy") add i)));
Set("gravity" add i, Number(eval ((this.dataSet + ":gravity") add i)));
Set("drag" add i, Number(eval ((this.dataSet + ":drag") add i)));
Set("incrx" add i, Number(eval ((this.dataSet + ":incrx") add i)));
Set("incry" add i, Number(eval ((this.dataSet + ":incry") add i)));
Set("jmax" add i, Number(eval ((this.dataSet + ":jmax") add i)));
Set("jincr" add i, Number(eval ((this.dataSet + ":jincr") add i)));
Set("bnce" add i, Number(eval ((this.dataSet + ":bnce") add i)));
i++;
}
numsprites = i;
mapgrid = _root.arrayconvert(eval (this.dataSet + ":mapgrid"));
mapwidth = mapgrid[0].length;
mapheight = mapgrid.length;
swfs = _root.arrayconvert(eval (this.dataSet + ":swfs"));
sprites = _root.arrayconvert(eval (this.dataSet + ":sprites"));
mapcoll = _root.arrayconvert(eval (this.dataSet + ":mapcoll"));
x = 0;
sx = 0;
posx = 0;
orderx = new Array();
i = 0;
while (numelx >= i) {
orderx[i] = i;
i++;
}
y = 0;
sy = 0;
posy = 0;
ordery = new Array();
i = 0;
while (numely >= i) {
ordery[i] = i;
i++;
}
};
};
loadAllData = new Preloader(dataArr.concat(gfxArr), "titleScreen");
theGame = new GameObj();
Instance of Symbol 58 MovieClip "game" in Frame 55
onClipEvent (enterFrame) {
MovieClip.sendFLEMEvent("onEnterFrame");
}
Instance of Symbol 65 MovieClip "soundLoadBtn" in Frame 55
onClipEvent (load) {
this._visible = 0;
}
Frame 62
stop();
Frame 72
stop();
Frame 80
stop();
Instance of Symbol 111 MovieClip in Frame 80
onClipEvent (keyDown) {
if (Key.getCode() == 32) {
_root.game.map.sound.hitSpace.startAud(1);
_root.gotoAndPlay("menu");
}
}
Frame 90
stop();
Instance of Symbol 122 MovieClip in Frame 90
onClipEvent (load) {
this.gotoAndStop(_root.soundToggle);
}
onClipEvent (keyDown) {
var keyK = Key.getCode();
if ((keyK == 39) || (keyK == 80)) {
this.gotoAndStop("sOn");
} else if ((keyK == 37) || (keyK == 79)) {
this.gotoAndStop("sOff");
}
}
Instance of Symbol 111 MovieClip in Frame 90
onClipEvent (keyDown) {
if (Key.getCode() == 32) {
_root.game.map.sound.hitSpace.startAud(1);
_root.gotoAndPlay("menu");
}
}
Frame 99
stop();
Selection.setFocus("inpName");
Instance of Symbol 111 MovieClip in Frame 99
onClipEvent (load) {
_root.inpName = _root.theGame.playerName;
}
onClipEvent (keyDown) {
if (Key.getCode() == 32) {
_root.game.map.sound.button01.startAud(1);
while (_root.inpName.length < 3) {
_root.inpName = _root.inpName + "A";
}
_root.theGame.setPlayerName(_root.inpName);
_root.gotoAndPlay("winloose");
}
}
Frame 110
theGame.init();
levelTitle = theGame.levelTitle;
Frame 126
theGame.onMakeScreen();
game.elx = eval (("game.map." add game.swfs[0]) add ".myw")[0];
game.ely = eval (("game.map." add game.swfs[0]) add ".myh")[0];
game.mapx = game.elx * game.numelx;
game.mapy = game.ely * game.numely;
game.maxx = (game.mapwidth * game.elx) - game.mapx;
game.maxy = (game.mapheight * game.ely) - game.mapy;
game.crumble = 0;
mytile = game.swfs[0];
trace("mytile " + mytile);
a = game.numelx + 1;
while (a--) {
b = game.numely + 1;
while (b--) {
mystring = String((a * (game.numely + 1)) + b);
eval ("game.map." add mytile).attachMovie(mytile, mystring, ((a * (game.numely + 1)) + b) + 10);
mypath = (("game/map/" add mytile) add "/") add mystring;
tellTarget (mypath) {
gotoAndStop(/game:mapgrid[/:b][/:a] + 1);
};
Set(mypath add ":a", a);
Set(mypath add ":b", b);
Set(mypath add ":c", true);
setProperty(mypath, _x , a * game.elx);
setProperty(mypath, _y , b * game.ely);
}
}
eval ("game.map." add mytile).attachMovie("background", "background", 0);
game.speed = theGame.setSpeed();
game.gamectrl = new gamectrl();
Frame 127
stop();
game.map.sound.bobDie.stopAud();
game.map.sound.getReady.startAud(1);
Frame 137
stop();
testScore = theGame.curScore;
theGame.gameControl.doaction("go");
game.map.sound.mainTune.startAud(800);
Frame 149
stop();
Instance of Symbol 111 MovieClip in Frame 150
onClipEvent (keyDown) {
if (Key.getCode() == 32) {
_root.game.map.sound.button01.startAud(1);
_root.theGame.continueGame();
}
}
Frame 154
game.map.sound.gameOver.startAud(1);
Frame 177
stop();
theGame.gameOver();
theGame.makeScoreBoard();
Instance of Symbol 111 MovieClip in Frame 177
onClipEvent (keyDown) {
if (Key.getCode() == 32) {
_root.game.map.sound.hitSpace.startAud(1);
_root.theGame.reset();
}
}
Instance of Symbol 2 MovieClip in Symbol 3 MovieClip [flemEngine] Frame 1
onClipEvent (load) {
MovieClip.sendFLEMEvent("onLoad");
}
onClipEvent (enterFrame) {
MovieClip.sendFLEMEvent("onEnterFrame");
}
onClipEvent (mouseDown) {
Mouse.sendFLEMEvent("onMouseDown");
}
onClipEvent (mouseUp) {
Mouse.sendFLEMEvent("onMouseUp");
}
onClipEvent (keyDown) {
Key.sendFLEMEvent("onKeyDown");
}
onClipEvent (keyUp) {
Key.sendFLEMEvent("onKeyUp");
}
Symbol 12 MovieClip Frame 1
if (../:mynumber < 93) {
gotoAndStop((../:mynumber - (Math.floor(../:mynumber / 3) * 3)) + 1);
} else {
stop();
}
Symbol 35 MovieClip Frame 1
stop();
Symbol 35 MovieClip Frame 10
stop();
Symbol 35 MovieClip Frame 20
stop();
Symbol 45 MovieClip [playDisplay] Frame 1
timeDisp = 0;
timeDispShad = 0;
scoreDisp = 0;
scoreDispShad = 0;
totalScoreDisp = _root.theGame.cumScore;
totalscoreDispShad = totalScoreDisp;
Instance of Symbol 35 MovieClip "lifeHolder" in Symbol 45 MovieClip [playDisplay] Frame 1
onClipEvent (load) {
var lifeFrame = ("life_0" + _root.theGame.life);
this.gotoAndStop(lifeFrame);
}
Symbol 64 Button
on (release) {
_root.loadAllData.endLoad();
_root.loadAudio = false;
}
Symbol 72 MovieClip Frame 41
stop();
Symbol 91 Button
on (release) {
_root.game.map.sound.button01.startAud(1);
_root.gotoAndStop("menu");
}
Symbol 95 Button
on (release, keyPress "1") {
gotoAndStop (99);
_root.game.map.sound.button02.startAud(1);
}
Symbol 99 Button
on (release, keyPress "2") {
gotoAndStop (80);
_root.game.map.sound.button02.startAud(1);
}
Symbol 103 Button
on (release, keyPress "3") {
gotoAndStop (90);
_root.game.map.sound.button02.startAud(1);
}
Symbol 116 Button
on (release) {
gotoAndStop (12);
}
Symbol 121 Button
on (release) {
gotoAndStop (1);
}
Symbol 122 MovieClip Frame 1
stop();
_root.soundToggle = "sOn";
_root.game.map.sound.soundControl.enableEvents();
Symbol 122 MovieClip Frame 12
stop();
_root.soundToggle = "sOff";
_root.game.map.sound.soundControl.disableEvents();
Symbol 130 MovieClip Frame 1
stop();
Symbol 130 MovieClip Frame 11
stop();
Symbol 130 MovieClip Frame 21
stop();
Symbol 134 MovieClip Frame 53
_root.gotoAndStop("playGame");
Symbol 138 MovieClip Frame 60
stop();
Symbol 138 MovieClip Frame 82
_root.nextFrame();
stop();
Symbol 142 MovieClip Frame 1
stop();
Symbol 142 MovieClip Frame 14
gotoAndPlay (2);
Symbol 145 MovieClip Frame 2
dispBonus = 0;
sTarget = Math.round(_root.thegame.levBonus / _root.thegame.levTime);
Symbol 145 MovieClip Frame 3
if (dispBonus >= sTarget) {
stop();
gotoAndPlay (10);
} else {
dispBonus = dispBonus + 12;
}
Symbol 145 MovieClip Frame 4
_root.game.map.sound.click.startAud(1);
gotoAndPlay (3);
Symbol 145 MovieClip Frame 10
bonText.play();
Symbol 145 MovieClip Frame 20
_root.theGame.gameScore(sTarget);
_root.bonusWack.play();
_root.howsThat.play();
stop();
Symbol 147 MovieClip Frame 1
stop();
Symbol 147 MovieClip Frame 26
stop();
_root.nextFrame();
Symbol 150 MovieClip Frame 60
stop();