Frame 1
Stage.scaleMode = "noScale";
Stage.showMenu = false;
Frame 2
stop();
Frame 5
stop();
Frame 7
stop();
Instance of Symbol 199 MovieClip in Frame 7
//component parameters
onClipEvent (initialize) {
scr = "_root.SCORE";
}
Frame 10
stop();
BoulderDash.newGame();
Symbol 20 MovieClip [mc-digg-chest-rip] Frame 22
this.swapDepths(3);
this.removeMovieClip();
Symbol 23 MovieClip [mc-digg-noob-rip] Frame 40
this.swapDepths(3);
this.removeMovieClip();
Symbol 28 MovieClip [mc-noob-rip] Frame 30
this.swapDepths(3);
this.removeMovieClip();
Symbol 35 MovieClip Frame 1
Stage.scaleMode = "noScale";
fscommand ("trapallkeys", true);
Stage.showMenu = false;
this.uu = _root._url;
var a = _root._url.split("/");
var i = 0;
while (i < a.length) {
if (a[i] == "files") {
_root.gid = a[i + 1];
}
i++;
}
if ((a[2] == "www.netstupidity.com") || (a[2] == "netstupidity.com")) {
_root.ligin = 1;
}
_root.__url = "http://www.netstupidity.com/games/hof/";
_root.loadVariables((_root.__url + "hof_bsc.php?id=") + _root.gid);
_root.prc = 0;
this.onEnterFrame = function () {
var ld = _root.getBytesLoaded();
var tt = _root.getBytesTotal();
var pr = ((100 * ld) / tt);
this.pasek._xscale = pr;
var b = Math.round(pr / 20);
if (pr >= 100) {
this.onEnterFrame = null;
this._parent.play();
}
};
Symbol 49 MovieClip Frame 140
stop();
Symbol 88 MovieClip Frame 1
this.t = getTimer();
this.tm = 0;
this.onEnterFrame = function () {
if (_root._framesloaded < 2) {
this.t = getTimer();
return(undefined);
}
this.tm = this.tm + (getTimer() - this.t);
var tt = Math.round(this.tm / 33);
if (tt < 1) {
this.stop();
} else {
this.t = getTimer();
if (tt >= 145) {
this.onEnterFrame = null;
this.gotoAndStop(145);
_root.play();
} else {
this.gotoAndStop(tt);
}
}
};
stop();
Symbol 91 MovieClip Frame 1
_root.stop();
stop();
Symbol 91 MovieClip Frame 2
stop();
Symbol 109 Button
on (press) {
_root.gotoAndStop(10);
}
Symbol 115 Button
on (press) {
_root.gotoAndStop(5);
}
Symbol 119 MovieClip Frame 1
this._visible = _root.ligin == undefined;
this.onPress = function () {
getURL ("http://www.netstupidity.com");
};
Symbol 140 Button
on (press) {
this.gotoAndStop("weekly");
}
Symbol 141 Button
on (press) {
this.gotoAndStop("daily");
}
Symbol 142 Button
on (press) {
this.gotoAndStop("hourly");
}
Symbol 145 Button
on (press) {
this.gotoAndStop("monthly");
}
Symbol 150 Button
on (press) {
this.gotoAndStop("daily");
}
Symbol 153 MovieClip Frame 1
this._parent.tp = 2592000 /* 0x278D00 */;
this._parent.tc = 0;
this._parent.reload();
stop();
Symbol 153 MovieClip Frame 2
this._parent.tp = 604800 /* 0x093A80 */;
this._parent.tc = 0;
this._parent.reload();
Symbol 153 MovieClip Frame 3
this._parent.tp = 86400 /* 0x015180 */;
this._parent.tc = 0;
this._parent.reload();
Symbol 153 MovieClip Frame 4
this._parent.tp = 3600;
this._parent.tc = 0;
this._parent.reload();
Symbol 160 Button
on (press) {
this.tc--;
this.reload();
}
Symbol 165 Button
on (press) {
this.tc = ((this.tc < 0) ? (this.tc + 1) : 0);
this.reload();
}
Symbol 168 Button
on (press) {
if (this.submitted == false) {
this.loadVariables((((this.__url + "hof_put.php?id=") + this.gid) + "&s=") + this.sc);
}
}
Symbol 172 Button
on (press) {
this._parent.l = 10;
this._parent.reload();
this.gotoAndStop(2);
}
Symbol 175 Button
on (press) {
this._parent.l = 100;
this._parent.reload();
this.gotoAndStop(1);
}
Symbol 176 MovieClip Frame 1
stop();
Symbol 189 MovieClip Frame 1
stop();
Symbol 189 MovieClip Frame 18
stop();
Symbol 193 MovieClip Frame 1
function reset() {
this.m._x = this.s._x;
this.m._y = this.s._y;
}
function scroll(p) {
this._parent.rolki.f1.scroll = (this._parent.rolki.f2.scroll = (this._parent.rolki.f3.scroll = (this._parent.rolki.f4.scroll = int((this.mx * p) / 100))));
}
this.onEnterFrame = function () {
this.s._y = ((this.m._y > 5) ? (((this.m._y < 202) ? (this.m._y) : 202)) : 5);
this.mx = this._parent.rolki.f1.maxscroll;
scroll((100 * (this.s._y - 5)) / 197);
};
Instance of Symbol 192 MovieClip "m" in Symbol 193 MovieClip Frame 1
on (press) {
this.startDrag();
}
on (release, releaseOutside) {
this.stopDrag();
this._parent.reset();
}
Symbol 198 MovieClip Frame 1
this._visible = _root.ligin == undefined;
this.onPress = function () {
getURL ("http://www.netstupidity.com");
};
Symbol 199 MovieClip Frame 1
this.submitted = false;
Symbol 199 MovieClip Frame 2
function reload() {
if (this.rolki._currentframe > 1) {
this.rolki.gotoAndPlay(18);
}
var te = ((-this.tc) * this.tp);
var tb = ((-(this.tc - 1)) * this.tp);
this.loadVariables((((((((((this.__url + "hof_get.php?id=") + this.gid) + "&n=") + this.l) + "&tb=") + tb) + "&te=") + te) + "&s=") + this.sc);
}
this.uu = _root._url;
this.gid = _root.gid;
this.__url = _root.__url;
this.l = 10;
this.sc = eval (this.scr);
if (int(this.sc) > int(_root.bsc)) {
_root.bsc = this.sc;
}
this.onData = function () {
if (this.r == 1) {
this.rolki.gotoAndPlay(2);
clearInterval(this._itr);
return(undefined);
}
if (this.r == "3") {
this.submitted = true;
reload();
}
if (this.r == "2") {
getURL ("javascript:if(confirm('To submit Your score You have to be logged into netstupidity.com site. Do You wish to log in now?')) window.open('http://www.netstupidity.com/login.php'); void(0);");
}
};
stop();
Symbol 205 MovieClip [mc-gems] Frame 1
this._rotation = random(30);
stop();
Symbol 212 MovieClip [mc-gold] Frame 1
stop();
Symbol 212 MovieClip [mc-gold] Frame 4
gotoAndStop (1);
Symbol 212 MovieClip [mc-gold] Frame 5
stop();
Symbol 212 MovieClip [mc-gold] Frame 35
gotoAndStop (10);
Symbol 212 MovieClip [mc-gold] Frame 50
stop();
Symbol 232 MovieClip [mc-wall] Frame 1
stop();
Symbol 232 MovieClip [mc-wall] Frame 5
stop();
Symbol 232 MovieClip [mc-wall] Frame 10
stop();
Symbol 232 MovieClip [mc-wall] Frame 15
stop();
Symbol 232 MovieClip [mc-wall] Frame 20
stop();
Symbol 232 MovieClip [mc-wall] Frame 25
stop();
Symbol 232 MovieClip [mc-wall] Frame 30
stop();
Symbol 232 MovieClip [mc-wall] Frame 35
stop();
Symbol 232 MovieClip [mc-wall] Frame 40
stop();
Symbol 232 MovieClip [mc-wall] Frame 45
stop();
Symbol 232 MovieClip [mc-wall] Frame 50
stop();
Symbol 232 MovieClip [mc-wall] Frame 55
stop();
Symbol 232 MovieClip [mc-wall] Frame 60
stop();
Symbol 232 MovieClip [mc-wall] Frame 65
stop();
Symbol 232 MovieClip [mc-wall] Frame 70
stop();
Symbol 232 MovieClip [mc-wall] Frame 75
stop();
Symbol 232 MovieClip [mc-wall] Frame 80
stop();
Symbol 232 MovieClip [mc-wall] Frame 85
stop();
Symbol 232 MovieClip [mc-wall] Frame 90
stop();
Symbol 232 MovieClip [mc-wall] Frame 95
stop();
Symbol 251 MovieClip [mc-digg] Frame 42
stop();
Symbol 251 MovieClip [mc-digg] Frame 51
stop();
Symbol 251 MovieClip [mc-digg] Frame 61
gotoAndStop (42);
Symbol 267 MovieClip [mc-noob-0] Frame 1
stop();
Symbol 267 MovieClip [mc-noob-0] Frame 10
stop();
Symbol 283 MovieClip [mc-noob-1] Frame 1
stop();
Symbol 283 MovieClip [mc-noob-1] Frame 20
stop();
Symbol 312 MovieClip [mc-noob-2] Frame 1
stop();
Symbol 312 MovieClip [mc-noob-2] Frame 15
stop();
Symbol 312 MovieClip [mc-noob-2] Frame 30
gotoAndStop (1);
Symbol 312 MovieClip [mc-noob-2] Frame 50
stop();
Symbol 312 MovieClip [mc-noob-2] Frame 65
stop();
Symbol 312 MovieClip [mc-noob-2] Frame 80
gotoAndStop (50);
Symbol 313 MovieClip Frame 1
_global.FPS = 36;
_global.STARTX = 0;
_global.STARTY = 0;
_global.CELLSIZE = 40;
_global.GEMSDEPTH = 250;
_global.BAGSDEPTH = 500;
_global.DIGGDEPTH = 666;
_global.NOOBDEPTH = 750;
_global.SPEED = 10;
_global.LEGEND = {};
_global.LEGEND.NULL = 0;
_global.LEGEND.WALL = 1;
_global.LEGEND.GEMS = 2;
_global.LEGEND.BAGS = 4;
_global.LEGEND.PILE = 8;
_global.LEVELS = new Array();
LEVELS[0] = new Object();
LEVELS[0].startX = 4;
LEVELS[0].startY = 9;
LEVELS[0].spawnX = 14;
LEVELS[0].spawnY = 0;
LEVELS[0].MAP = new Array();
LEVELS[0].MAP[0] = new Array(0, 1, 1, 1, 5, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0);
LEVELS[0].MAP[1] = new Array(0, 1, 1, 3, 3, 1, 1, 3, 1, 1, 0, 1, 5, 1, 1);
LEVELS[0].MAP[2] = new Array(0, 5, 1, 3, 3, 1, 1, 3, 1, 1, 0, 1, 1, 1, 1);
LEVELS[0].MAP[3] = new Array(0, 1, 1, 3, 3, 5, 1, 3, 5, 1, 0, 1, 3, 3, 3);
LEVELS[0].MAP[4] = new Array(0, 1, 1, 3, 3, 1, 1, 3, 1, 1, 0, 1, 3, 3, 3);
LEVELS[0].MAP[5] = new Array(0, 0, 1, 3, 3, 1, 1, 3, 1, 1, 0, 1, 3, 3, 3);
LEVELS[0].MAP[6] = new Array(1, 0, 1, 1, 1, 1, 5, 1, 5, 1, 0, 1, 1, 1, 1);
LEVELS[0].MAP[7] = new Array(1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1);
LEVELS[0].MAP[8] = new Array(3, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 3);
LEVELS[0].MAP[9] = new Array(3, 3, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 3);
LEVELS[1] = new Object();
LEVELS[1].startX = 0;
LEVELS[1].startY = 0;
LEVELS[1].spawnX = 14;
LEVELS[1].spawnY = 0;
LEVELS[1].MAP = new Array(0);
LEVELS[1].MAP[0] = new Array(0, 0, 0, 0, 0, 0, 1, 1, 5, 1, 5, 1, 1, 0, 0);
LEVELS[1].MAP[1] = new Array(1, 3, 3, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1);
LEVELS[1].MAP[2] = new Array(1, 3, 3, 1, 1, 0, 1, 3, 3, 3, 3, 3, 1, 0, 1);
LEVELS[1].MAP[3] = new Array(5, 3, 3, 5, 1, 0, 1, 3, 3, 3, 3, 3, 1, 0, 1);
LEVELS[1].MAP[4] = new Array(3, 3, 3, 3, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1);
LEVELS[1].MAP[5] = new Array(3, 3, 3, 3, 1, 0, 1, 5, 1, 1, 0, 0, 0, 0, 1);
LEVELS[1].MAP[6] = new Array(1, 3, 3, 1, 1, 0, 1, 3, 3, 1, 0, 1, 1, 1, 1);
LEVELS[1].MAP[7] = new Array(1, 5, 5, 1, 1, 0, 3, 3, 3, 3, 0, 1, 3, 3, 1);
LEVELS[1].MAP[8] = new Array(3, 1, 1, 1, 1, 0, 1, 3, 3, 1, 0, 1, 3, 3, 1);
LEVELS[1].MAP[9] = new Array(3, 3, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1);
LEVELS[2] = new Object();
LEVELS[2].startX = 0;
LEVELS[2].startY = 0;
LEVELS[2].spawnX = 14;
LEVELS[2].spawnY = 0;
LEVELS[2].MAP = new Array();
LEVELS[2].MAP[0] = new Array(0, 0, 0, 0, 0, 5, 1, 5, 1, 5, 0, 0, 0, 0, 0);
LEVELS[2].MAP[1] = new Array(3, 3, 1, 1, 0, 1, 3, 1, 3, 1, 0, 1, 5, 5, 1);
LEVELS[2].MAP[2] = new Array(3, 1, 1, 1, 0, 1, 3, 1, 3, 1, 0, 1, 3, 3, 1);
LEVELS[2].MAP[3] = new Array(1, 5, 5, 1, 0, 1, 3, 1, 3, 1, 0, 3, 3, 3, 3);
LEVELS[2].MAP[4] = new Array(3, 3, 3, 3, 0, 1, 3, 1, 3, 1, 0, 3, 3, 3, 3);
LEVELS[2].MAP[5] = new Array(3, 3, 3, 3, 0, 0, 0, 0, 0, 0, 0, 1, 3, 3, 1);
LEVELS[2].MAP[6] = new Array(1, 3, 3, 1, 1, 3, 1, 1, 1, 3, 1, 1, 3, 3, 1);
LEVELS[2].MAP[7] = new Array(1, 3, 3, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 1, 1);
LEVELS[2].MAP[8] = new Array(3, 1, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 1, 3);
LEVELS[2].MAP[9] = new Array(3, 3, 1, 1, 1, 3, 1, 3, 1, 3, 1, 1, 1, 3, 3);
LEVELS[3] = new Object();
LEVELS[3].startX = 0;
LEVELS[3].startY = 0;
LEVELS[3].spawnX = 14;
LEVELS[3].spawnY = 0;
LEVELS[3].MAP = new Array();
LEVELS[3].MAP[0] = new Array(0, 0, 5, 3, 3, 3, 3, 5, 3, 3, 3, 3, 5, 0, 0);
LEVELS[3].MAP[1] = new Array(3, 0, 1, 1, 3, 3, 3, 3, 3, 3, 3, 1, 1, 0, 3);
LEVELS[3].MAP[2] = new Array(3, 0, 0, 0, 1, 3, 3, 3, 3, 3, 1, 0, 0, 0, 3);
LEVELS[3].MAP[3] = new Array(3, 1, 1, 0, 1, 1, 3, 3, 3, 1, 1, 0, 1, 1, 3);
LEVELS[3].MAP[4] = new Array(1, 1, 1, 0, 0, 0, 1, 3, 1, 0, 0, 0, 1, 1, 1);
LEVELS[3].MAP[5] = new Array(1, 1, 5, 1, 1, 0, 1, 5, 1, 0, 1, 1, 5, 1, 1);
LEVELS[3].MAP[6] = new Array(1, 1, 3, 1, 1, 0, 3, 3, 3, 0, 1, 1, 3, 1, 1);
LEVELS[3].MAP[7] = new Array(1, 3, 3, 3, 1, 0, 0, 0, 0, 0, 1, 3, 3, 3, 1);
LEVELS[3].MAP[8] = new Array(3, 3, 3, 3, 3, 1, 3, 0, 3, 1, 3, 3, 3, 3, 3);
LEVELS[3].MAP[9] = new Array(3, 3, 3, 3, 3, 1, 3, 0, 3, 1, 3, 3, 3, 3, 3);
LEVELS[4] = new Object();
LEVELS[4].startX = 0;
LEVELS[4].startY = 0;
LEVELS[4].spawnX = 14;
LEVELS[4].spawnY = 0;
LEVELS[4].MAP = new Array();
LEVELS[4].MAP[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
LEVELS[4].MAP[1] = new Array(0, 5, 3, 3, 3, 3, 5, 0, 3, 3, 3, 3, 3, 3, 0);
LEVELS[4].MAP[2] = new Array(0, 3, 3, 3, 3, 3, 3, 0, 1, 3, 3, 5, 3, 1, 0);
LEVELS[4].MAP[3] = new Array(0, 1, 3, 3, 3, 3, 1, 0, 5, 3, 3, 3, 3, 3, 0);
LEVELS[4].MAP[4] = new Array(0, 3, 3, 3, 3, 3, 3, 0, 1, 3, 3, 3, 3, 1, 0);
LEVELS[4].MAP[5] = new Array(0, 1, 3, 3, 3, 3, 1, 0, 5, 3, 3, 3, 3, 3, 0);
LEVELS[4].MAP[6] = new Array(0, 3, 3, 5, 3, 3, 3, 0, 1, 3, 3, 3, 3, 1, 0);
LEVELS[4].MAP[7] = new Array(0, 1, 3, 3, 5, 3, 1, 0, 3, 3, 3, 3, 3, 3, 0);
LEVELS[4].MAP[8] = new Array(0, 3, 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3, 0);
LEVELS[4].MAP[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
LEVELS[5] = new Object();
LEVELS[5].startX = 0;
LEVELS[5].startY = 0;
LEVELS[5].spawnX = 14;
LEVELS[5].spawnY = 0;
LEVELS[5].MAP = new Array();
LEVELS[5].MAP[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
LEVELS[5].MAP[1] = new Array(0, 3, 5, 3, 3, 0, 1, 0, 1, 0, 3, 3, 5, 3, 0);
LEVELS[5].MAP[2] = new Array(0, 3, 3, 3, 1, 0, 5, 0, 5, 0, 1, 3, 3, 3, 0);
LEVELS[5].MAP[3] = new Array(0, 3, 3, 3, 0, 0, 1, 0, 1, 0, 0, 3, 3, 3, 0);
LEVELS[5].MAP[4] = new Array(0, 3, 3, 1, 0, 1, 3, 0, 3, 1, 0, 1, 3, 3, 0);
LEVELS[5].MAP[5] = new Array(0, 3, 3, 0, 0, 1, 3, 0, 3, 1, 0, 0, 3, 3, 0);
LEVELS[5].MAP[6] = new Array(0, 3, 1, 0, 1, 3, 3, 0, 3, 3, 1, 0, 1, 3, 0);
LEVELS[5].MAP[7] = new Array(0, 3, 0, 0, 5, 3, 3, 0, 3, 3, 5, 0, 0, 3, 0);
LEVELS[5].MAP[8] = new Array(0, 3, 0, 3, 3, 3, 3, 0, 3, 3, 3, 3, 0, 3, 0);
LEVELS[5].MAP[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
LEVELS[6] = new Object();
LEVELS[6].startX = 0;
LEVELS[6].startY = 0;
LEVELS[6].spawnX = 14;
LEVELS[6].spawnY = 0;
LEVELS[6].MAP = new Array();
LEVELS[6].MAP[0] = new Array(0, 0, 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 0, 0);
LEVELS[6].MAP[1] = new Array(1, 0, 3, 5, 3, 5, 3, 0, 3, 5, 3, 5, 3, 0, 1);
LEVELS[6].MAP[2] = new Array(5, 0, 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 0, 5);
LEVELS[6].MAP[3] = new Array(3, 0, 0, 3, 3, 3, 3, 0, 3, 3, 3, 3, 0, 0, 3);
LEVELS[6].MAP[4] = new Array(3, 3, 0, 1, 3, 3, 3, 0, 3, 3, 3, 1, 0, 3, 3);
LEVELS[6].MAP[5] = new Array(3, 3, 0, 0, 0, 3, 3, 0, 3, 3, 0, 0, 0, 3, 3);
LEVELS[6].MAP[6] = new Array(3, 3, 3, 3, 0, 1, 3, 0, 3, 1, 0, 3, 3, 3, 3);
LEVELS[6].MAP[7] = new Array(3, 3, 3, 3, 0, 0, 1, 0, 1, 0, 0, 3, 3, 3, 3);
LEVELS[6].MAP[8] = new Array(3, 3, 3, 3, 3, 0, 1, 0, 1, 0, 3, 3, 3, 3, 3);
LEVELS[6].MAP[9] = new Array(3, 3, 3, 3, 3, 0, 0, 0, 0, 0, 3, 3, 3, 3, 3);
LEVELS[7] = new Object();
LEVELS[7].startX = 0;
LEVELS[7].startY = 0;
LEVELS[7].spawnX = 14;
LEVELS[7].spawnY = 0;
LEVELS[7].MAP = new Array();
LEVELS[7].MAP[0] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
LEVELS[7].MAP[1] = new Array(0, 1, 3, 3, 5, 3, 3, 3, 3, 3, 5, 3, 3, 1, 0);
LEVELS[7].MAP[2] = new Array(0, 0, 0, 3, 3, 3, 3, 5, 3, 3, 3, 3, 0, 0, 0);
LEVELS[7].MAP[3] = new Array(0, 5, 0, 1, 3, 3, 3, 3, 3, 3, 3, 1, 0, 5, 0);
LEVELS[7].MAP[4] = new Array(0, 3, 0, 0, 0, 3, 3, 3, 3, 3, 0, 0, 0, 3, 0);
LEVELS[7].MAP[5] = new Array(0, 3, 3, 1, 0, 1, 3, 3, 3, 1, 0, 1, 3, 3, 0);
LEVELS[7].MAP[6] = new Array(0, 3, 3, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 3, 0);
LEVELS[7].MAP[7] = new Array(0, 3, 3, 3, 3, 1, 0, 1, 0, 1, 3, 3, 3, 3, 0);
LEVELS[7].MAP[8] = new Array(0, 3, 3, 3, 3, 3, 0, 1, 0, 3, 3, 3, 3, 3, 0);
LEVELS[7].MAP[9] = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
function buildMap() {
var counter = 0;
this.CONTAINER = this.createEmptyMovieClip("mcContainer", 9);
var cx = CONTAINER.createEmptyMovieClip("cx", 1);
mcForeground.setMask(cx);
var i = 0;
while (i < actLevel.MAP.length) {
var j = 0;
while (j < actLevel.MAP[i].length) {
var $mc = cx.attachMovie("mc-wall", ++counter, counter);
$mc._x = STARTX + (CELLSIZE * j);
$mc._y = STARTY + (CELLSIZE * i);
actLevel.MCs[i][j] = $mc;
shapeShift(j, i);
if (actLevel.MAP[i][j] & LEGEND.GEMS) {
var $mc = this.CONTAINER.attachMovie("mc-gems", ++counter, GEMSDEPTH + counter);
$mc._x = (STARTX + (CELLSIZE * j)) + (CELLSIZE / 2);
$mc._y = (STARTX + (CELLSIZE * i)) + (CELLSIZE / 2);
createItem(j, i, $mc, LEGEND.GEMS);
}
if (actLevel.MAP[i][j] & LEGEND.BAGS) {
var $mc = this.CONTAINER.attachMovie("mc-gold", ++counter, BAGSDEPTH + counter);
$mc._x = (STARTX + (CELLSIZE * j)) + (CELLSIZE / 2);
$mc._y = (STARTX + (CELLSIZE * i)) + (CELLSIZE / 2);
createItem(j, i, $mc, LEGEND.BAGS);
}
j++;
}
i++;
}
}
function shapeShift(x, y) {
var o = 0;
var $mc = actLevel.MCs[y][x];
if (actLevel.MAP[y][x] & LEGEND.WALL) {
if (actLevel.MAP[y - 1][x] == 0) {
o = o + 1;
}
if (actLevel.MAP[y + 1][x] == 0) {
o = o + 2;
}
if (actLevel.MAP[y][x - 1] == 0) {
o = o + 4;
}
if (actLevel.MAP[y][x + 1] == 0) {
o = o + 8;
}
if ((((o & 8) && (o & 4)) && (o & 2)) && (o & 1)) {
$mc.gotoAndStop(5);
} else if (((o & 8) && (o & 4)) && (o & 1)) {
$mc.gotoAndStop(20);
} else if (((o & 8) && (o & 4)) && (o & 2)) {
$mc.gotoAndStop(10);
} else if (((o & 8) && (o & 2)) && (o & 1)) {
$mc.gotoAndStop(25);
} else if (((o & 4) && (o & 2)) && (o & 1)) {
$mc.gotoAndStop(15);
} else if ((o & 8) && (o & 1)) {
$mc.gotoAndStop(35);
} else if ((o & 8) && (o & 2)) {
$mc.gotoAndStop(40);
} else if ((o & 8) && (o & 4)) {
$mc.gotoAndStop(0);
} else if ((o & 4) && (o & 1)) {
$mc.gotoAndStop(30);
} else if ((o & 4) && (o & 2)) {
$mc.gotoAndStop(45);
} else if ((o & 2) && (o & 1)) {
$mc.gotoAndStop(0);
} else {
$mc.gotoAndStop(0);
}
} else {
if ((actLevel.MAP[y - 1][x] & LEGEND.WALL) || (actLevel.MAP[y - 1][x] == undefined)) {
o = o + 1;
}
if ((actLevel.MAP[y + 1][x] & LEGEND.WALL) || (actLevel.MAP[y + 1][x] == undefined)) {
o = o + 2;
}
if ((actLevel.MAP[y][x - 1] & LEGEND.WALL) || (actLevel.MAP[y][x - 1] == undefined)) {
o = o + 4;
}
if ((actLevel.MAP[y][x + 1] & LEGEND.WALL) || (actLevel.MAP[y][x + 1] == undefined)) {
o = o + 8;
}
if ((((o & 8) && (o & 4)) && (o & 2)) && (o & 1)) {
$mc.gotoAndStop(55);
} else if (((o & 8) && (o & 4)) && (o & 1)) {
$mc.gotoAndStop(70);
} else if (((o & 8) && (o & 4)) && (o & 2)) {
$mc.gotoAndStop(60);
} else if (((o & 8) && (o & 2)) && (o & 1)) {
$mc.gotoAndStop(75);
} else if (((o & 4) && (o & 2)) && (o & 1)) {
$mc.gotoAndStop(65);
} else if ((o & 8) && (o & 1)) {
$mc.gotoAndStop(85);
} else if ((o & 8) && (o & 2)) {
$mc.gotoAndStop(90);
} else if ((o & 8) && (o & 4)) {
$mc.gotoAndStop(50);
} else if ((o & 4) && (o & 1)) {
$mc.gotoAndStop(80);
} else if ((o & 4) && (o & 2)) {
$mc.gotoAndStop(95);
} else if ((o & 2) && (o & 1)) {
$mc.gotoAndStop(50);
} else {
$mc.gotoAndStop(50);
}
}
}
function createItem(x, y, o, type) {
if (type == LEGEND.BAGS) {
actLevel.BAGS.push(o);
o.baseX = (o.x = x);
o.baseY = (o.y = y);
o.updateMap = updateMap;
o.checkBound = checkBound;
o.baseMove = moveObject;
o.logic = chestLogic;
o.move = moveItem;
}
if (type == LEGEND.GEMS) {
actLevel.GEMS.push(o);
o.baseX = x;
o.baseY = y;
}
}
function updateMap() {
if ((this.x != this.baseX) || ((this.y != this.baseY) && (this.falling == false))) {
if (actLevel.MAP[this.baseY][this.baseX] & LEGEND.BAGS) {
actLevel.MAP[this.baseY][this.baseX] = actLevel.MAP[this.baseY][this.baseX] ^ LEGEND.BAGS;
}
if (!this.falling) {
this.baseX = this.x;
this.baseY = this.y;
if ((actLevel.MAP[this.baseY][this.baseX] & LEGEND.BAGS) == 0) {
actLevel.MAP[this.baseY][this.baseX] = actLevel.MAP[this.baseY][this.baseX] ^ LEGEND.BAGS;
}
}
}
}
function chestLogic() {
if (this.checkBound(0, 1, true) == true) {
if (!this.falling) {
actLevel.MAP[this.baseY][this.baseX] = actLevel.MAP[this.baseY][this.baseX] ^ LEGEND.BAGS;
this.falling = getTimer();
this.gotoAndPlay(6);
} else if (this.falling < (getTimer() - 1000)) {
this.baseMove(0, 1);
if (checkCollision(this, DIGGER) && (this._y < DIGGER._y)) {
DIGGER.kill("chest");
var i = 0;
while (i < actLevel.BAGS.length) {
if (actLevel.BAGS[i] == this) {
actLevel.BAGS.splice(i, 1);
this.removeMovieClip();
break;
}
i++;
}
}
var i = 0;
while (i < noobArray.length) {
if (checkCollision(this, noobArray[i]) && (this._y < noobArray[i]._y)) {
noobArray[i].kill();
}
i++;
}
}
} else if (this.falling) {
if (this.y > (this.baseY + 1)) {
chestHardFallSound.start();
this.gotoAndStop(50);
delete this.onEnterFrame;
var i = 0;
while (i < actLevel.BAGS.length) {
if (actLevel.BAGS[i] == this) {
actLevel.GOLD.push(actLevel.BAGS[i]);
actLevel.BAGS.splice(i, 1);
break;
}
i++;
}
} else {
chestSoftFallSound.start();
this.falling = false;
this.updateMap();
}
}
}
function moveItem(vx, vy) {
if (this.checkBound(0, 1, true) == true) {
this.falling = getTimer() - 1000;
this.baseMove(0, 1);
return(false);
}
var checkMove = this.baseMove(vx, vy);
moveChestSound.start();
this.updateMap();
return(!checkMove);
}
function moveObject(vx, vy) {
var objectMoved = false;
this.x = (this._x / CELLSIZE) | 0;
this.y = (this._y / CELLSIZE) | 0;
var x = ((this._x + ((vx * this._width) / 2)) / CELLSIZE);
var y = ((this._y + ((vy * this._height) / 2)) / CELLSIZE);
if (vx) {
this.lastVX = vx;
this._xscale = ((vx > 0) ? 100 : -100);
if ((x > 0) && (actLevel.MAP[y | 0][x | 0] != undefined)) {
var xBag = false;
var yBag = true;
var i = 0;
while (i < actLevel.BAGS.length) {
var bag = actLevel.BAGS[i];
if (bag != this) {
if ((bag._x == (this._x + ((CELLSIZE / 1) * vx))) && (bag._y == this._y)) {
xBag = bag.move(vx, vy);
break;
}
}
i++;
}
if ((((this._y + (CELLSIZE / 2)) % CELLSIZE) != 0) && (xBag == false)) {
if (this.lastVY) {
if ((this._y % CELLSIZE) < (CELLSIZE / 2)) {
this._y = this._y + SPEED;
} else if ((this._y % CELLSIZE) > (CELLSIZE / 2)) {
this._y = this._y - SPEED;
}
} else {
this._y = this._y + (this.lastVY * SPEED);
}
objectMoved = true;
} else if (xBag == false) {
this._x = this._x + (vx * SPEED);
objectMoved = true;
}
}
}
if (vy) {
this.lastVY = vy;
if ((y > 0) && (actLevel.MAP[y | 0][x | 0] != undefined)) {
var xBag = false;
var yBag = true;
var i = 0;
while (i < actLevel.BAGS.length) {
var bag = actLevel.BAGS[i];
if (((bag._x == this._x) && (bag._y == (this._y + ((CELLSIZE / 1) * vy)))) && (bag != this)) {
yBag = false;
break;
}
i++;
}
if ((((this._x + (CELLSIZE / 2)) % CELLSIZE) != 0) && (yBag == true)) {
if (this.lastVX) {
if ((this._x % CELLSIZE) < (CELLSIZE / 2)) {
this._x = this._x + SPEED;
} else if ((this._x % CELLSIZE) > (CELLSIZE / 2)) {
this._x = this._x - SPEED;
}
} else {
this._x = this._x + (this.lastVX * SPEED);
}
objectMoved = true;
} else if (yBag == true) {
this._y = this._y + (vy * SPEED);
objectMoved = true;
}
}
}
if (objectMoved == true) {
this.play();
}
return(objectMoved);
}
function digShaft(x, y, sqState, bruteShape) {
if ((actLevel.MAP[y][x] & sqState) || (bruteShape)) {
if (!bruteShape) {
digShaftSound.start();
}
actLevel.MAP[y][x] = actLevel.MAP[y][x] ^ sqState;
shapeShift(x - 1, y);
shapeShift(x + 1, y);
shapeShift(x, y);
shapeShift(x, y - 1);
shapeShift(x, y + 1);
}
}
function snap2Grid() {
if (((this._x + (CELLSIZE / 2)) % CELLSIZE) != 0) {
this.move(this.lastVX, 0);
}
if (((this._y + (CELLSIZE / 2)) % CELLSIZE) != 0) {
this.move(0, this.lastVY);
}
}
function checkBound(vx, vy, soft) {
if (soft == true) {
var x = ((this._x + ((vx * CELLSIZE) / 2)) / CELLSIZE);
var y = ((this._y + ((vy * CELLSIZE) / 2)) / CELLSIZE);
var isMap = (actLevel.MAP[y | 0][x | 0] != undefined);
var isWall = (actLevel.MAP[y | 0][x | 0] & LEGEND.WALL);
} else if (!soft) {
this.x = (this._x / _global.CELLSIZE) | 0;
this.y = (this._y / _global.CELLSIZE) | 0;
var isMap = (actLevel.MAP[this.y + vy][this.x + vx] != undefined);
var isWall = (actLevel.MAP[this.y + vy][this.x + vx] & LEGEND.WALL);
}
return((isMap == true) && (isWall == false));
}
function checkCollision(o1, o2, n) {
if (!n) {
n = 1;
}
return(Math.sqrt(Math.pow(o1._x - o2._x, 2) + Math.pow(o1._y - o2._y, 2)) < (CELLSIZE / n));
}
function spawnDigger(reborn) {
DIGGER = this.CONTAINER.attachMovie("mc-digg", "DIGGER", DIGGDEPTH);
DIGGER._x = (STARTX + (CELLSIZE * actLevel.startX)) + (CELLSIZE / 2);
DIGGER._y = (STARTY + (CELLSIZE * actLevel.startY)) + (CELLSIZE / 2);
if (!reborn) {
DIGGER.gotoAndStop("walk");
}
DIGGER.checkMap = checkMap;
DIGGER.baseMove = moveObject;
DIGGER.move = moveDigger;
DIGGER.kill = killDigger;
DIGGER.snap = snap2Grid;
DIGGER.logic = diggerLogic;
newDiggerSound.start();
}
function diggerLogic() {
if (Key.isDown(37)) {
diggerAction = DIGGER.move(-1, 0);
} else if (Key.isDown(38)) {
diggerAction = DIGGER.move(0, -1);
} else if (Key.isDown(39)) {
diggerAction = DIGGER.move(1, 0);
} else if (Key.isDown(40)) {
diggerAction = DIGGER.move(0, 1);
} else {
this.snap();
}
}
function moveDigger(vx, vy) {
var checkMove = this.baseMove(vx, vy);
digShaft(this.x, this.y, LEGEND.WALL);
if (checkMove) {
var i = 0;
while (i < actLevel.GEMS.length) {
var o = actLevel.GEMS[i];
if (checkCollision(o, this, 2) == true) {
actLevel.MAP[o.baseY][o.baseX] = actLevel.MAP[o.baseY][o.baseX] - LEGEND.GEMS;
getGemSound.start();
o.removeMovieClip();
actLevel.GEMS.splice(i, 1);
if (!actLevel.GEMS.length) {
nextLevel();
}
SCORE = SCORE + 25;
}
i++;
}
var i = 0;
while (i < actLevel.GOLD.length) {
var o = actLevel.GOLD[i];
if (checkCollision(o, this, 2) == true) {
getGoldSound.start();
o.removeMovieClip();
actLevel.GOLD.splice(i, 1);
SCORE = SCORE + 500;
}
i++;
}
}
}
function killDigger(how) {
if (how == "chest") {
deadDiggerSound.start();
var o = CONTAINER.attachMovie("mc-digg-chest-rip", "RIP", 9997);
} else if (how == "noob") {
deadDiggerSound.start();
var o = CONTAINER.attachMovie("mc-digg-noob-rip", "RIP", 9997);
}
o._x = this._x;
o._y = this._y;
this.removeMovieClip();
clearInterval($game);
if ((--LIVES) == 0) {
$game = setInterval(endGame, 1000);
} else {
$game = setInterval(loadLevel, 1000, true);
}
}
function spawnNoobin() {
if ((LEVEL * random(15)) > 100) {
var mc = CONTAINER.attachMovie("mc-noob-2", "NOOBIN", NOOBDEPTH + (d++));
mc.logic = mobbBrain;
} else if (((LEVEL * random(75)) > 100) || true) {
var mc = CONTAINER.attachMovie("mc-noob-1", "NOOBIN", NOOBDEPTH + (d++));
mc.logic = hobbBrain;
} else {
var mc = CONTAINER.attachMovie("mc-noob-0", "NOOBIN", NOOBDEPTH + (d++));
mc.logic = noobBrain;
}
mc._x = (STARTX + (CELLSIZE * actLevel.SpawnX)) + (CELLSIZE / 2);
mc._y = (STARTY + (CELLSIZE * actLevel.SpawnY)) + (CELLSIZE / 2);
mc.checkBound = checkBound;
mc.turnObject = turnObject;
mc.move = moveObject;
mc.kill = killNoob;
mc.birthDate = getTimer();
mc.lastTurn = getTimer();
mc.vx = -1;
mc.vy = 0;
spawnTime = getTimer();
noobArray.push(mc);
noobCount++;
mc.c = setInterval(mc, "logic", 35);
}
function mobbBrain() {
if ((Math.random() * 100) < 5) {
var dirX = (((DIGGER._x / CELLSIZE) | 0) - ((this._x / CELLSIZE) | 0));
var dirY = (((DIGGER._y / CELLSIZE) | 0) - ((this._y / CELLSIZE) | 0));
if (dirX == dirY) {
} else if (Math.max(Math.abs(dirX), Math.abs(dirY)) == Math.abs(dirX)) {
this.vx = ((dirX < 0) ? -1 : 1);
this.vy = 0;
} else if (Math.max(Math.abs(dirX), Math.abs(dirY)) == Math.abs(dirY)) {
this.vx = 0;
this.vy = ((dirY < 0) ? -1 : 1);
}
}
var checkMove = this.move(this.vx, this.vy);
if (!checkMove) {
this.vx = this.vx * -1;
this.vy = this.vy * -1;
} else {
digShaft(this.x, this.y, LEGEND.WALL);
}
if (checkCollision(this, DIGGER)) {
DIGGER.kill("noob");
}
}
function hobbBrain() {
if (((Math.random() * 100) < 5) && (this.lastTurn < (getTimer() - 1000))) {
var dirX = ((DIGGER._x > this._x) ? 1 : -1);
var dirY = ((DIGGER._y > this._y) ? 1 : -1);
}
if (dirX && (this.checkBound(dirX, 0, false) == true)) {
this.vx = dirX;
this.vy = 0;
} else if (dirY && (this.checkBound(0, dirY, false) == true)) {
this.vx = 0;
this.vy = dirY;
} else if (!this.checkBound(this.vx, this.vy, false)) {
this.turnObject();
}
this.move(this.vx, this.vy);
if (checkCollision(this, DIGGER)) {
DIGGER.kill("noob");
}
}
function noobBrain() {
var changeDir = (((Math.random() * 100) < 5) && (this.lastTurn < (getTimer() - 0)));
var checkMove = this.checkBound(this.vx, this.vy, false);
if ((!checkMove) || (changeDir)) {
this.turnObject(changeDir);
}
this.move(this.vx, this.vy);
if (checkCollision(this, DIGGER)) {
DIGGER.kill("noob");
}
}
function killNoob() {
spawnTimer = getTimer();
deadMonsterSound.start();
var o = CONTAINER.attachMovie("mc-noob-rip", "RIP", 9999);
o._x = this._x;
o._y = this._y;
var i = 0;
while (i < noobArray.length) {
if (noobArray[i] == this) {
noobArray.splice(i, 1);
break;
}
i++;
}
clearInterval(this.c);
this.removeMovieClip(this);
SCORE = SCORE + 250;
}
function turnObject(randomTurn) {
if (this.vx) {
var vy = ((random(2) * 2) - 1);
if (this.checkBound(0, vy, false)) {
this.vx = 0;
this.vy = vy;
if (randomTurn) {
this.lastTurn = getTimer();
}
} else if (this.checkBound(0, vy * -1, false)) {
this.vx = 0;
this.vy = vy * -1;
if (randomTurn) {
this.lastTurn = getTimer();
}
} else if (!randomTurn) {
this.vx = this.vx * -1;
}
} else if (this.vy) {
var vx = ((random(2) * 2) - 1);
if (this.checkBound(vx, 0, false)) {
this.vx = vx;
this.vy = 0;
if (randomTurn) {
this.lastTurn = getTimer();
}
} else if (this.checkBound(vx * -1, 0, false)) {
this.vx = vx * -1;
this.vy = 0;
if (randomTurn) {
this.lastTurn = getTimer();
}
} else if (!randomTurn) {
this.vy = this.vy * -1;
}
}
}
function newGame() {
SCORE = 0;
LIVES = 3;
LEVEL = 0;
actLevel = {};
loadLevel();
}
function loadLevel(reset) {
clearInterval($game);
while (noobArray.length) {
noobArray.pop().removeMovieClip();
}
while (actLevel.GEMS.length) {
actLevel.GEMS.pop().removeMovieClip();
}
while (actLevel.GOLD.length) {
actLevel.GOLD.pop().removeMovieClip();
}
while (actLevel.BAGS.length) {
actLevel.BAGS.pop().removeMovieClip();
}
if (!reset) {
noobArray = new Array();
noobCount = new Number();
actLevel.spawnX = LEVELS[LEVEL % LEVELS.length].spawnX;
actLevel.spawnY = LEVELS[LEVEL % LEVELS.length].spawnY;
actLevel.startX = LEVELS[LEVEL % LEVELS.length].startX;
actLevel.startY = LEVELS[LEVEL % LEVELS.length].startY;
actLevel.MAP = new Array();
actLevel.MCs = new Array();
actLevel.GEMS = new Array();
actLevel.GOLD = new Array();
actLevel.BAGS = new Array();
var i = 0;
while (i < LEVELS[LEVEL % LEVELS.length].MAP.length) {
actLevel.MAP[i] = new Array();
actLevel.MCs[i] = new Array();
var j = 0;
while (j < LEVELS[LEVEL % LEVELS.length].MAP[i].length) {
actLevel.MAP[i][j] = LEVELS[LEVEL % LEVELS.length].MAP[i][j];
actLevel.MCs[i][j] = 0;
j++;
}
i++;
}
}
buildMap();
spawnDigger(reset);
$game = setInterval(gameLogic, 35);
}
function nextLevel() {
LEVEL++;
loadLevel();
SCORE = SCORE + (LEVEL * 1000);
nextLevelSound.start();
}
function endGame() {
clearInterval($game);
gameOverSound.start();
_root.gotoAndStop(7);
}
function gameLogic() {
_root.LIVES = LIVES;
_root.SCORE = SCORE;
DIGGER.logic();
var i = 0;
while (i < actLevel.BAGS.length) {
actLevel.BAGS[i].logic();
i++;
}
if ((noobArray.length < (4 + ((LEVEL / 6) | 0))) && (spawnTime < (getTimer() - 2000))) {
spawnNoobin();
spawnTime = getTimer();
}
}
newGame();
nextLevelSound = new Sound();
nextLevelSound.attachSound("_level");
gameOverSound = new Sound();
gameOverSound.attachSound("_gameover");
deadMonsterSound = new Sound();
deadMonsterSound.attachSound("mK");
getGemSound = new Sound();
getGemSound.attachSound("_gems");
getGoldSound = new Sound();
getGoldSound.attachSound("_gold");
_clock = new Sound();
_clock.attachSound("_clock");
moveChestSound = new Sound();
moveChestSound.attachSound("_chest_move");
chestSoftFallSound = new Sound();
chestSoftFallSound.attachSound("cH1");
chestHardFallSound = new Sound();
chestHardFallSound.attachSound("cH2");
deadDiggerSound = new Sound();
deadDiggerSound.attachSound("_dead");
newDiggerSound = new Sound();
newDiggerSound.attachSound("_born");
moveDiggerSound = new Sound();
moveDiggerSound.attachSound("_move");
digShaftSound = new Sound();
digShaftSound.attachSound("_dig");