Frame 1
this.onEnterFrame = function () {
var ld = this.getBytesLoaded();
var tt = this.getBytesTotal();
if (tt > 100) {
_root.perc = int((100 * ld) / tt) + "%";
_root.anim.gotoAndStop(int((100 * ld) / tt));
if (ld == tt) {
gotoAndStop (2);
delete this.onEnterFrame;
}
}
};
var cd = new LoadVars();
cd.onLoad = function (s) {
if (s) {
if (this.ob.a == undefined) {
this.ob.a = [];
} else {
this.ob.a.splice(0, this.ob.a.length);
}
this.ob.a = this.cod.split("\r\n");
this.ob._alt = this.ob.a[_root.level - 1];
} else {
this.ob._alt = "Code load error...";
}
};
cd.ob = this;
cd.load("./map/codes.mp?" + new Date().getTimer());
stop();
Frame 2
Stage.scaleMode = "noScale";
fscommand ("trapallkeys", true);
Stage.showMenu = false;
stop();
Frame 3
function _nl() {
gotoAndStop (5);
}
_root.level_code_._visible = false;
_root._scr = 0;
_root.back_but = 1;
_root.onMouseDown = null;
_root.level = 1;
_root.lives = 3;
_root.energy = 100;
_root.time = 0;
stop();
Frame 4
stop();
Frame 5
var map = new LoadVars();
map.onLoad = function (s) {
if (s) {
_root._loaded = this.toString();
gotoAndStop (6);
} else {
gotoAndStop (9);
}
};
map.load(("./map/" + _root.level) + "._mp");
stop();
Frame 6
function _ge() {
return(100 - _root.__en._xscale);
}
function _se(v) {
_root.__en._xscale = 100 - v;
}
function stopAll() {
_root.game.onEnterFrame = null;
clearInterval(_root.game.ex);
clearInterval(_root.game.mn);
var i = 10;
}
function nextlevel() {
stopAll();
gotoAndStop (8);
}
function killed() {
stopAll();
gotoAndStop (10);
}
function l1(ar) {
clearInterval(ar.itr);
var i = 10;
var x = 1;
while (x <= 18) {
var y = 1;
while (y <= 12) {
if (_root.table["k" + i] == undefined) {
_root.table["k" + i] = new Object();
}
var k = _root.table["k" + i];
var fr = parseInt(substring(_root.f[0], 0, 2), 16);
_root.f[0] = substring(_root.f[0], 3, -1);
k.cf = fr;
if (fr >= 12) {
_root.table["brzydal" + (fr - 11)] = k;
}
i++;
y++;
}
x++;
}
ar.itr = setInterval(l2, 100, ar);
}
function l2(ar) {
clearInterval(ar.itr);
var i = 1;
while (i < 7) {
_root.table[("brzydal" + i) + "_path"].splice(0, pt.length);
var pth = _root.f[i + 3];
if (_root.table[("brzydal" + i) + "_path"] == undefined) {
_root.table[("brzydal" + i) + "_path"] = [];
} else {
_root.table[("brzydal" + i) + "_path"].splice(0, _root.table[("brzydal" + i) + "_path"].length);
}
do {
if (pth.length <= 0) {
break;
}
var ob = new Object();
ob.x = parseInt(substring(pth, 0, 2), 16);
ob.y = parseInt(substring(pth, 3, 2), 16);
_root.table[("brzydal" + i) + "_path"].push(ob);
pth = substring(pth, 5, -1);
} while (pth.substr(2, 2) != "on");
i++;
}
_root.table.tm = parseInt(_root.f[1], 16);
ar.itr = setInterval(l3, 100, ar);
}
function l3(ar) {
clearInterval(ar.itr);
_root._time = getTimer();
_root.game.go();
}
_root.__liv.gotoAndStop(_root.lives);
_root.__lev.gotoAndStop(_root.level);
_root.addProperty("energy", _ge, _se);
if (_root.psr == undefined) {
_root.psr = new Sound(this);
_root.psr.attachSound("psr");
}
if (_root.psb == undefined) {
_root.psb = new Sound(this);
_root.psb.attachSound("psb");
}
if (_root.psd == undefined) {
_root.psd = new Sound(this);
_root.psd.attachSound("psd");
}
if (_root.fsd == undefined) {
_root.fsd = new Sound(this);
_root.fsd.attachSound("fsd");
}
if (_root.fdd == undefined) {
_root.fdd = new Sound(this);
_root.fdd.attachSound("fdd");
}
if (_root.fcd == undefined) {
_root.fcd = new Sound(this);
_root.fcd.attachSound("fcd");
}
if (_root.table == undefined) {
_root.table = new Object();
}
if (_root.f == undefined) {
_root.f = [];
} else {
_root.f.splice(0, _root.f.length);
}
_root.f = _root._loaded.split("X");
var i = 1;
while (i < 7) {
_root.table["brzydal" + i] = undefined;
i++;
}
this.itr = setInterval(l1, 100, this);
stop();
Frame 7
function _scf(a) {
var tb = int(_root._tmb);
if (tb > 0) {
_root._scr = int(_root._scr) + 1;
_root._tmb = int(_root._tmb) - 1;
} else {
clearInterval(a.sc_it);
a._cont_._visible = true;
}
}
_root.time = _root.time + (getTimer() - _root._time);
var t = (1 - ((getTimer() - _root._start_time) / _root.table.tm));
_root._tmb = int(t * _root._score_);
_root._scr = _root._scr + int(_root._score_);
this.sc_it = setInterval(_scf, 50, this);
stop();
Frame 8
var cd = new LoadVars();
cd.onLoad = function (s) {
if (s) {
if (this.ob.a == undefined) {
this.ob.a = [];
} else {
this.ob.a.splice(0, this.ob.a.length);
}
this.ob.a = this.cod.split("\r\n");
this.ob._alt = this.ob.a[_root.level - 1];
} else {
this.ob._alt = "Code load error...";
}
};
cd.ob = this;
cd.load("./map/codes.mp?" + new Date().getTimer());
function _scf(a) {
var tb = int(_root._tmb);
if (tb > 0) {
_root._scr = int(_root._scr) + 1;
_root._tmb = int(_root._tmb) - 1;
} else {
clearInterval(a.sc_it);
a._cont_._visible = true;
}
}
this._cont_._visible = false;
_root.back_but = 2;
_root.time = _root.time + (getTimer() - _root._time);
_root.level++;
if (_root.level == 31) {
gotoAndStop (7);
}
var t = (1 - ((getTimer() - _root._start_time) / _root.table.tm));
_root._tmb = int(t * _root._score_);
_root._scr = _root._scr + int(_root._score_);
this.sc_it = setInterval(_scf, 50, this);
stop();
Frame 9
stop();
Frame 10
_root.back_but = 3;
_root.time = _root.time + (getTimer() - _root._time);
_root.lives--;
if (_root.lives == 0) {
gotoAndStop (11);
}
stop();
var cd = new LoadVars();
cd.onLoad = function (s) {
if (s) {
if (this.ob.a == undefined) {
this.ob.a = [];
} else {
this.ob.a.splice(0, this.ob.a.length);
}
this.ob.a = this.cod.split("\r\n");
this.ob.cod = this.ob.a[_root.level - 1];
} else {
this.ob._alt = "Code load error...";
}
};
cd.ob = this;
cd.load("./map/codes.mp?" + new Date().getTimer());
_root.back_but = 2;
_root.time = _root.time + (getTimer() - _root._time);
stop();
Frame 11
_root.time = _root.time + (getTimer() - _root._time);
stop();
Symbol 10 MovieClip Frame 1
stop();
Symbol 15 MovieClip Frame 1
this._x = this._x + (random(30) - 15);
this._y = this._y + (random(30) - 15);
Symbol 15 MovieClip Frame 9
stop();
Symbol 17 MovieClip Frame 1
this._parent.an._visible = true;
this._parent.swapDepths(this._parent._ii);
Symbol 17 MovieClip Frame 20
stop();
Symbol 17 MovieClip Frame 21
this._parent.an.onEnterFrame = function () {
if (this._alpha <= 10) {
this._visible = false;
this.onEnterFrame = null;
} else {
this._alpha = this._alpha - 10;
}
};
this._parent.swapDepths(_root.game.wybi++);
this._parent.det = false;
this._parent.spadacz = false;
if (this._parent._currentframe == 10) {
_root.stopAll();
_root.game.onEnterFrame = null;
}
Symbol 17 MovieClip Frame 43
_root._score_ = _root._score_ + this._parent._pkt_;
if (this._parent._currentframe == 10) {
_root.killed();
stop();
} else {
this._parent.gotoAndStop("nico");
}
Symbol 19 MovieClip Frame 1
stop();
Symbol 27 MovieClip Frame 1
stop();
Symbol 30 MovieClip Frame 1
stop();
Symbol 31 MovieClip Frame 1
stop();
Symbol 69 MovieClip Frame 40
_root.game._spadnij(_root.game.tab[this._parent._parent.x][this._parent._parent.y - 1]);
this._parent._parent.gotoAndStop("nico");
stop();
Symbol 70 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 1
function go() {
this.play();
clearInterval(s);
}
stop();
s = setInterval(go, 2000);
Symbol 83 MovieClip Frame 1
i = 0;
Symbol 83 MovieClip Frame 10
if (i >= 5) {
stop();
} else {
i++;
gotoAndPlay (2);
}
Symbol 85 MovieClip Frame 15
stop();
Symbol 93 MovieClip Frame 15
_root.game.allow = true;
stop();
Symbol 109 MovieClip Frame 58
stop();
Symbol 110 MovieClip Frame 16
stop();
Symbol 111 MovieClip Frame 1
if (_root.game.gems <= 0) {
this.gotoAndStop("full");
}
stop();
Symbol 111 MovieClip Frame 30
if (_root.game.gems <= 0) {
this.gotoAndStop("full");
} else {
this.gotoAndStop(1);
}
Symbol 111 MovieClip Frame 107
_root.stopAll();
_root.nextlevel();
stop();
Symbol 124 MovieClip Frame 5
this._parent._parent.an1._visible = false;
stop();
Symbol 130 MovieClip Frame 5
this._parent._parent.an1._visible = false;
stop();
Symbol 144 MovieClip Frame 5
this._parent._parent.an1._visible = false;
stop();
Symbol 145 MovieClip Frame 5
this._parent._parent.an1._visible = false;
stop();
Symbol 151 MovieClip Frame 1
stop();
Symbol 152 MovieClip Frame 1
stop();
Symbol 166 MovieClip Frame 1
_root.stopAll();
Symbol 166 MovieClip Frame 40
_root.killed();
stop();
Symbol 171 MovieClip Frame 1
stop();
Symbol 191 MovieClip Frame 5
stop();
Symbol 192 MovieClip Frame 5
stop();
Symbol 201 MovieClip Frame 10
stop();
Symbol 202 MovieClip Frame 10
stop();
Symbol 203 MovieClip Frame 1
stop();
Symbol 203 MovieClip Frame 2
stop();
Symbol 203 MovieClip Frame 3
stop();
Symbol 203 MovieClip Frame 4
stop();
Symbol 204 MovieClip Frame 1
stop();
Symbol 204 MovieClip Frame 2
stop();
Symbol 204 MovieClip Frame 3
stop();
Symbol 204 MovieClip Frame 4
stop();
Symbol 218 MovieClip Frame 14
stop();
Symbol 221 MovieClip Frame 14
stop();
Symbol 233 MovieClip Frame 14
stop();
Symbol 234 MovieClip Frame 14
stop();
Symbol 235 MovieClip Frame 1
stop();
Symbol 236 MovieClip Frame 1
stop();
Symbol 239 MovieClip Frame 1
i = 0;
Symbol 239 MovieClip Frame 9
if (i >= 10) {
gotoAndPlay (10);
} else {
i++;
gotoAndPlay (2);
}
Symbol 247 MovieClip Frame 7
stop();
Symbol 250 MovieClip Frame 1
i = 0;
Symbol 250 MovieClip Frame 9
if (i >= 10) {
gotoAndPlay (10);
} else {
i++;
gotoAndPlay (2);
}
Symbol 254 MovieClip Frame 1
i = 0;
Symbol 254 MovieClip Frame 9
if (i >= 10) {
gotoAndPlay (10);
} else {
i++;
gotoAndPlay (2);
}
Symbol 261 MovieClip Frame 7
stop();
Symbol 262 MovieClip Frame 7
stop();
Symbol 265 MovieClip Frame 1
i = 0;
Symbol 265 MovieClip Frame 9
if (i >= 10) {
gotoAndPlay (10);
} else {
i++;
gotoAndPlay (2);
}
Symbol 268 MovieClip Frame 7
stop();
Symbol 271 MovieClip [klocek] Frame 1
this._pkt_ = 0;
Symbol 271 MovieClip [klocek] Frame 2
this._pkt_ = 0;
Symbol 271 MovieClip [klocek] Frame 4
this._pkt_ = 1;
Symbol 271 MovieClip [klocek] Frame 5
this._pkt_ = 2;
Symbol 271 MovieClip [klocek] Frame 6
this._pkt_ = 0;
Symbol 271 MovieClip [klocek] Frame 8
this._pkt_ = 0;
Symbol 271 MovieClip [klocek] Frame 10
this._pkt_ = 0;
an1._visible = false;
Symbol 271 MovieClip [klocek] Frame 11
this._pkt_ = 0;
Symbol 271 MovieClip [klocek] Frame 12
this.st = 2;
this.rn = 30;
Symbol 271 MovieClip [klocek] Frame 13
this.st = 2;
this.rn = 30;
Symbol 271 MovieClip [klocek] Frame 14
this.st = 3;
this.rn = 10;
this._pkt_ = 10;
Symbol 271 MovieClip [klocek] Frame 15
this.st = 3;
this.rn = 10;
this._pkt_ = 10;
Symbol 271 MovieClip [klocek] Frame 16
this.st = 0;
this.rn = 50;
this._pkt_ = 5;
Symbol 271 MovieClip [klocek] Frame 17
this.st = 0;
this.rn = 50;
this._pkt_ = 5;
Symbol 300 MovieClip Frame 140
stop();
Symbol 340 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 355 Button
on (press) {
gotoAndStop (5);
}
Symbol 359 Button
on (press) {
_root.level_code_._visible = true;
}
Symbol 363 Button
on (press) {
gotoAndStop (4);
}
Symbol 367 MovieClip Frame 1
this.t = getTimer();
this.tm = 0;
this.onEnterFrame = function () {
this.tm = this.tm + (getTimer() - this.t);
var tt = Math.round(this.tm / 33);
this.t = getTimer();
if (tt >= 10) {
this.onEnterFrame = null;
this.gotoAndStop(10);
} else {
this.gotoAndStop(tt);
}
};
stop();
Symbol 367 MovieClip Frame 10
stop();
Symbol 367 MovieClip Frame 11
this.t = getTimer();
this.tm = 0;
this.onEnterFrame = function () {
this.tm = this.tm + (getTimer() - this.t);
var tt = (Math.round(this.tm / 33) + 10);
this.t = getTimer();
if (tt >= 15) {
this.onEnterFrame = null;
this.gotoAndStop(15);
} else {
this.gotoAndStop(tt);
}
};
stop();
Symbol 367 MovieClip Frame 15
stop();
Symbol 368 Button
on (rollOver) {
tellTarget ("logo") {
gotoAndPlay (11);
};
}
on (rollOut) {
tellTarget ("logo") {
gotoAndPlay (10);
};
}
on (release) {
getURL ("http://www.netstupidity.com");
}
Symbol 380 MovieClip Frame 1
this.t = getTimer();
this.tm = 0;
this.onEnterFrame = function () {
this.tm = this.tm + (getTimer() - this.t);
var tt = Math.round(this.tm / 33);
this.t = getTimer();
if (tt >= 5) {
this.onEnterFrame = null;
this.gotoAndStop(5);
} else {
this.gotoAndStop(tt);
}
};
stop();
Symbol 380 MovieClip Frame 5
stop();
Symbol 380 MovieClip Frame 6
this.t = getTimer();
this.tm = 0;
this.onEnterFrame = function () {
this.tm = this.tm + (getTimer() - this.t);
var tt = (Math.round(this.tm / 33) + 5);
this.t = getTimer();
if (tt >= 10) {
this.onEnterFrame = null;
this.gotoAndStop(10);
} else {
this.gotoAndStop(tt);
}
};
stop();
Symbol 380 MovieClip Frame 10
stop();
Symbol 380 MovieClip Frame 11
this.t = getTimer();
this.tm = 0;
this.onEnterFrame = function () {
this.tm = this.tm + (getTimer() - this.t);
var tt = (Math.round(this.tm / 33) + 10);
this.t = getTimer();
if (tt >= 15) {
this.onEnterFrame = null;
this.gotoAndStop(15);
} else {
this.gotoAndStop(tt);
}
};
stop();
Symbol 380 MovieClip Frame 15
stop();
Symbol 380 MovieClip Frame 16
this.t = getTimer();
this.tm = 0;
this.onEnterFrame = function () {
this.tm = this.tm + (getTimer() - this.t);
var tt = (Math.round(this.tm / 33) + 15);
this.t = getTimer();
if (tt >= 20) {
this.onEnterFrame = null;
this.gotoAndStop(20);
} else {
this.gotoAndStop(tt);
}
};
stop();
Symbol 380 MovieClip Frame 20
stop();
Symbol 383 Button
on (rollOver) {
tellTarget ("icons") {
gotoAndPlay (6);
};
}
on (rollOut) {
tellTarget ("icons") {
gotoAndPlay (5);
};
}
on (release) {
getURL ("http://www.netstupidity.com/game/Space_Explorer/57/download/", "_blank");
}
Symbol 384 Button
on (rollOver) {
tellTarget ("icons") {
gotoAndPlay (11);
};
}
on (rollOut) {
tellTarget ("icons") {
gotoAndPlay (5);
};
}
on (release) {
getURL ("http://www.netstupidity.com/game/Space_Explorer/57/discuss/", "_blank");
}
Symbol 385 Button
on (rollOver) {
tellTarget ("icons") {
gotoAndPlay (16);
};
}
on (rollOut) {
tellTarget ("icons") {
gotoAndPlay (5);
};
}
on (release) {
getURL ("http://www.netstupidity.com/game/Space_Explorer/57/rate/", "_blank");
}
Symbol 392 Button
on (press) {
var i = 0;
while (i < this._parent.a.length) {
if (this._parent.a[i] == this._alt) {
_root.level = i + 1;
_root._nl();
return(undefined);
}
i++;
}
this._alt = "WRONG CODE - ACCESS DENIED";
}
Symbol 395 Button
on (press) {
this._visible = false;
}
Symbol 396 MovieClip Frame 1
_alt = _root._alt;
Symbol 398 Button
on (press) {
gotoAndStop (3);
}
Symbol 432 MovieClip Frame 1
function timeout(a) {
a.onEnterFrame = null;
a.tab[a.x][a.y].an.gotoAndStop("umiera");
clearInterval(a.ex);
}
function isKey() {
if (!(((Key.isDown(40) || (Key.isDown(38))) || (Key.isDown(37))) || (Key.isDown(39)))) {
this.tmr = 0;
this.tmx = getTimer();
if (this.tab[this.x][this.y].an._currentframe != 8) {
this.tab[this.x][this.y].an.gotoAndStop("stoi");
}
return(undefined);
}
if ((getTimer() - this.tmr) < 100) {
return(undefined);
}
this.tmr = getTimer();
if (Key.isDown(40)) {
porusz_ludzika(0, 1);
} else if (Key.isDown(38)) {
porusz_ludzika(0, -1);
} else if (Key.isDown(37)) {
porusz_ludzika(-1, 0);
} else if (Key.isDown(39)) {
porusz_ludzika(1, 0);
}
}
function main(m) {
m.onEnterFrame = null;
clearInterval(m.mn);
var val = (m.to_ti - (getTimer() - m.st_ti));
if (val < 0) {
val = 0;
}
_root.energy = int((100 * val) / _root.table.tm);
var stw = [];
while (m.stwory.length > 0) {
var st = m.stwory.shift();
if ((st.m._currentframe <= 20) && (st._currentframe >= 12)) {
stwor(st);
stw.push(st);
_spadnij(_root.game.tab[st.x][st.y - 2]);
_spadnij(_root.game.tab[st.x][st.y - 1]);
}
}
m.stwory = m.stwory.concat(stw);
var spd = [];
spd = spd.concat(spd, m.spadacze);
m.spadacze.splice(0, m.spadacze.length);
var spd1 = [];
var i = 0;
while (i < spd.length) {
spadnij(spd[i]);
if (spd[i].spadacz) {
spd1.push(spd[i]);
}
i++;
}
m.spadacze = spd1.concat(m.spadacze);
eksploduj_wszystko();
m.mn = setInterval(main, 150, m);
m.onEnterFrame = isKey;
}
function porusz_ludzika(dx, dy) {
var g = _root.game;
if (_spadnij(g.tab[g.x][g.y - 1])) {
clearInterval(g.mn);
g.mn = setInterval(main, 150, g);
}
if (g.tab[g.x + dx][g.y + dy]._currentframe == 8) {
g.tab[g.x + dx][g.y + dy].gotoAndStop("nico");
g.drzwi.an.gotoAndStop(2);
_spadnij(g.tab[g.drzwi.x][g.drzwi.y - 1]);
}
if (g.tab[g.x + dx][g.y + dy]._currentframe >= 12) {
g.tab[g.x + dx][g.y + dy].gotoAndStop("nico");
g.dets.push(g.tab[g.x][g.y]);
}
if (dx != 0) {
var el = g.tab[g.x][g.y];
if (przesun(g.tab[g.x + dx][g.y], dx)) {
var t = g.tab[g.x + dx][g.y];
var tcf = t._currentframe;
t.gotoAndStop("nico");
if (tcf == 2) {
t.an.gotoAndPlay(2);
}
_root.game.tab[g.x + dx][g.y] = el;
_root.game.tab[g.x][g.y] = t;
el.x = el.x + dx;
el._x = el._x + (dx * 30);
t.x = t.x - dx;
t._x = t._x - (dx * 30);
g.x = g.x + dx;
}
if ((g.tab[g.x + dx][g.y]._currentframe == 1) || (g.tab[g.x + dx][g.y]._currentframe == 2)) {
if (dx >= 0) {
(el.an.gotoAndStop("prawo"));// not popped
} else {
(el.an.gotoAndStop("lewo"));// not popped
}
} else if (g.tab[g.x + dx][g.y + dy].m._currentframe > 20) {
g.tab[g.x][g.y].an.gotoAndStop("umiera");
} else {
if (dx >= 0) {
(el.an.gotoAndStop("pchaprawo"));// not popped
} else {
(el.an.gotoAndStop("pchalewo"));// not popped
}
}
if (tcf == 2) {
el.an.an.an1._visible = true;
} else {
el.an.an.an1._visible = false;
}
} else {
var t = g.tab[g.x][g.y + dy];
var el = g.tab[g.x][g.y];
if ((t._currentframe == 9) && (_root.game.allow == true)) {
el.gotoAndStop("nico");
t.mm.gotoAndPlay("go");
return(undefined);
}
if (((t._currentframe <= 2) && (t != undefined)) || (t.m._currentframe > 20)) {
if (g.tab[g.x + dx][g.y + dy].m._currentframe > 20) {
g.tab[g.x][g.y].an.gotoAndStop("umiera");
} else {
if (dy >= 0) {
(el.an.gotoAndStop("dol"));// not popped
} else {
(el.an.gotoAndStop("gora"));// not popped
}
}
var tcf = t._currentframe;
if (tcf == 2) {
el.an.an.an1._visible = true;
} else {
el.an.an.an1._visible = false;
}
t.gotoAndStop("nico");
if (tcf == 2) {
t.an.gotoAndPlay(2);
}
_root.game.tab[g.x][g.y + dy] = el;
_root.game.tab[g.x][g.y] = t;
el.y = el.y + dy;
el._y = el._y + (dy * 30);
t.y = t.y - dy;
t._y = t._y - (dy * 30);
g.y = g.y + dy;
} else {
el.an.gotoAndStop("stoi");
}
if (dy == 0) {
el.an.gotoAndStop("stoi");
}
}
el.an.an.gotoAndPlay(1);
}
function przesun(el, xx) {
if ((el._currentframe == 1) || (el.m._currentframe > 20)) {
el.spadacz = false;
}
if (el.spadacz) {
return(false);
}
if (_root.game.tab[el.x][el.y] == undefined) {
return(false);
}
if (_root.game.tab[el.x][el.y]._currentframe <= 2) {
return(true);
}
if (((el._currentframe == 5) || (el._currentframe == 6)) || (el._currentframe == 11)) {
var t = _root.game.tab[el.x + xx][el.y];
if (t._currentframe != 1) {
return(false);
}
_root.game.tab[el.x + xx][el.y] = el;
_root.game.tab[el.x][el.y] = t;
if (el._currentframe == 5) {
el._rotation = el._rotation - (90 * xx);
_root.psr.start(0, 1);
}
if (el._currentframe == 11) {
_root.psb.start(0, 1);
}
if (el._currentframe == 6) {
_root.psd.start(0, 1);
}
el._x = el._x + (xx * 30);
el.x = el.x + xx;
t._x = t._x - (xx * 30);
t.x = t.x - xx;
_spadnij(el);
return(true);
}
return(false);
}
function _spadnij(el) {
if ((el == undefined) || (el.spadacz == true)) {
return(false);
}
if ((((el._currentframe == 5) || (el._currentframe == 6)) || (el._currentframe == 11)) || (el._currentframe == 8)) {
el.spadacz = true;
_root.game.spadacze.push(el);
el.spadal = false;
return(true);
}
return(false);
}
function spadnij(el) {
if ((((el._currentframe == 5) || (el._currentframe == 6)) || (el._currentframe == 11)) || (el._currentframe == 8)) {
t = _root.game.tab[el.x][el.y + 1];
if ((t._currentframe != 1) && (t.m._currentframe <= 20)) {
el.spadacz = false;
var scf = t._currentframe;
var ecf = el._currentframe;
if ((scf >= 10) && (el.spadal == true)) {
_root.game.dets.push(t);
}
if ((el._currentframe == 11) && (el.blow == true)) {
_root.game.dets.push(el);
}
if ((el._currentframe == 5) && (el.spadal == true)) {
_root.fsd.start(0, 1);
}
if ((el._currentframe == 6) && (el.spadal == true)) {
_root.fdd.start(0, 1);
}
if ((el._currentframe == 8) && (el.spadal == true)) {
_root.fcd.start(0, 1);
}
if ((t._currentframe == 9) && (el._currentframe == 6)) {
_spadnij(_root.game.tab[el.x][el.y - 1]);
_root.game.gems--;
_root._score_ = _root._score_ + 15;
_root.__gems._xscale = 100 - (_root.game.gems * _root.game._gems_);
_root.game.tab[el.x][el.y + 1].mm.gotoAndPlay("gem");
_root.game.tab[el.x][el.y].gotoAndStop("nico");
}
return(t);
}
if (el._currentframe == 11) {
el.blow = true;
}
_spadnij(_root.game.tab[el.x][el.y - 1]);
_root.game.tab[el.x][el.y + 1] = el;
_root.game.tab[el.x][el.y] = t;
var f = _root.game.tab[el.x][el.y + 2]._currentframe;
if (f >= 10) {
_root.game.dets.push(_root.game.tab[el.x][el.y + 2]);
}
el._y = el._y + 30;
el.y++;
t._y = t._y - 30;
t.y--;
el.spadal = true;
return(t);
}
return(null);
}
function eksploduj(el) {
if ((el._currentframe >= 10) && (el.m._currentframe <= 20)) {
var dx = -1;
while (dx <= 1) {
var dy = -1;
while (dy <= 1) {
var t = _root.game.tab[el.x + dx][el.y + dy];
if (t.m._currentframe <= 20) {
if (dy == -1) {
_spadnij(_root.game.tab[el.x + dx][el.y - 2]);
}
if ((t._currentframe < 10) || (t == el)) {
t.m.gotoAndPlay("wybuch");
} else {
_root.game.dets.push(t);
}
}
dy++;
}
dx++;
}
return(true);
}
return(false);
}
function eksploduj_wszystko() {
var dt = [];
dt = dt.concat(_root.game.dets);
_root.game.dets.splice(0, _root.game.dets.length);
while (dt.length > 0) {
eksploduj(dt.shift());
}
}
function luzak(a, b) {
var aa = (Math.abs(_root.x0 - a.x) + Math.abs(_root.y0 - a.y));
var bb = (Math.abs(_root.x0 - b.x) + Math.abs(_root.y0 - b.y));
var cc = (Math.abs(_root.game.x - a.x) + Math.abs(_root.game.y - a.y));
var dd = (Math.abs(_root.game.x - b.x) + Math.abs(_root.game.y - b.y));
aa = Math.min(aa, cc);
bb = Math.min(bb, dd);
if (random(100) < 20) {
return(random(3) - 1);
}
if (aa == bb) {
return(0);
}
if ((aa < bb) || (b == undefined)) {
return(-1);
}
return(1);
}
function sciezkowiec(a, b) {
var aa = (Math.abs(_root.x0 - a.x) + Math.abs(_root.y0 - a.y));
var bb = (Math.abs(_root.x0 - b.x) + Math.abs(_root.y0 - b.y));
if (aa == bb) {
return(0);
}
if ((aa < bb) || (b == undefined)) {
return(-1);
}
return(1);
}
function tropiciel(a, b) {
var cc = Math.sqrt((Math.abs(_root.game.x - a.x) * Math.abs(_root.game.x - a.x)) + (Math.abs(_root.game.y - a.y) * Math.abs(_root.game.y - a.y)));
var dd = Math.sqrt((Math.abs(_root.game.x - b.x) * Math.abs(_root.game.x - b.x)) + (Math.abs(_root.game.y - b.y) * Math.abs(_root.game.y - b.y)));
if (cc == dd) {
return(0);
}
if ((cc < dd) || (b == undefined)) {
return(-1);
}
return(1);
}
function stwor(st) {
if (st.sti <= 0) {
st.sti = st.st;
var gtt = _root.game.tab;
this.poss.splice(0, this.poss.length);
this.poss = [gtt[st.x - 1][st.y], gtt[st.x + 1][st.y], gtt[st.x][st.y - 1], gtt[st.x][st.y + 1]];
_root.x0 = st.path[st.step].x;
_root.y0 = st.path[st.step].y;
_root.rn = st.rn;
var f = st._currentframe;
if ((f == 12) || (f == 13)) {
this.poss.sort(luzak);
}
if ((f == 14) || (f == 15)) {
this.poss.sort(tropiciel);
}
if ((f == 16) || (f == 17)) {
this.poss.sort(sciezkowiec);
}
var i = 0;
while (i < this.poss.length) {
var t = this.poss[i];
if (t._currentframe == 10) {
t.an.gotoAndStop("umiera");
return(true);
}
if (t._currentframe == 1) {
_root.game.tab[this.poss[i].x][this.poss[i].y] = st;
_root.game.tab[st.x][st.y] = t;
var dx = (t.x - st.x);
var dy = (t.y - st.y);
st.x = st.x + dx;
st.y = st.y + dy;
if (dx < 0) {
st.an.gotoAndStop("lewo");
}
if (dx > 0) {
st.an.gotoAndStop("prawo");
}
if (dy < 0) {
st.an.gotoAndStop("gora");
}
if (dy > 0) {
st.an.gotoAndStop("dol");
}
st.an.an.gotoAndPlay(1);
st._x = st._x + (30 * dx);
st._y = st._y + (30 * dy);
t.x = t.x - dx;
t.y = t.y - dy;
t._x = t._x - (30 * dx);
t._y = t._y - (30 * dy);
var _ln = (Math.abs(_root.x0 - st.x) + Math.abs(_root.y0 - st.y));
if ((_ln == 0) || ((_ln < 2) && (_root.game.tab[_root.x0][_root.y0]._currentframe != 1))) {
st.fail = 0;
st.step = st.step + st.step_dir;
if (st.step < 0) {
st.step = 1;
st.step_dir = 1;
}
if (st.step == st.path.length) {
st.step = st.path.length - 2;
st.step_dir = -1;
}
} else {
st.fail++;
}
return(true);
}
i++;
}
} else {
st.sti--;
}
}
function _redraw() {
_root.path_pane.clear();
var i = 0;
while (i < this.stwory.length) {
var st = this.stwory[i];
_root.path_pane.lineStyle(3, this.cols[st._currentframe], 50);
_root.path_pane.moveTo((st.path[0].x * 30) - 15, (st.path[0].y * 30) - 15);
var j = 0;
while (j < st.path.length) {
_root.path_pane.lineTo((st.path[j].x * 30) - 15, (st.path[j].y * 30) - 15);
j++;
}
i++;
}
}
function hex(n) {
var s = Number(n).toString(16);
if (s.length == 1) {
return("0" + s);
}
return(s);
}
this.tou = 90;
this.tab = [];
this.dets = [];
this.stwory = [];
this.spadacze = [];
this.tab.splice(0, this.tab.length);
this.dets.splice(0, this.dets.length);
this.stwory.splice(0, this.stwory.length);
this.gems = 0;
this.go = function () {
_root.game.allow = false;
this.wybi = 200000 /* 0x030D40 */;
var i = 10;
var x = 1;
while (x <= 18) {
this.tab[x] = [];
var y = 1;
while (y <= 12) {
if (this["k" + i] == undefined) {
this.attachMovie("klocek", "k" + i, i);
}
var k = this["k" + i];
k._ii = i;
k._x = (x * 30) - 15;
k._y = (y * 30) - 15;
k.x = x;
k.y = y;
k.expl = false;
if (_root.table["k" + i].cf == 10) {
this.x = x;
this.y = y;
k.swapDepths(1000);
k._ii = 1000;
}
if (_root.table["k" + i].cf == 7) {
this.drzwi = k;
}
this.tab[x][y] = k;
k.gotoAndStop(_root.table["k" + i].cf);
if (_root.table["k" + i].cf >= 12) {
var pt = _root.table[("brzydal" + (_root.table["k" + i].cf - 11)) + "_path"];
k.swapDepths(100000 + i);
k._ii = 100000 + i;
if ((_root.table["k" + i].cf != 14) && (_root.table["k" + i].cf != 15)) {
k.path = [];
k.fail = 0;
var ob = new Object();
ob.x = x;
ob.y = y;
k.path.push(ob);
var ii = 0;
while (ii < pt.length) {
var ob = new Object();
ob.x = pt[ii].x;
ob.y = pt[ii].y;
k.path.push(ob);
ii++;
}
}
k.step = 1;
k.step_dir = 1;
k.sti = 0;
k.dd = random(2);
this.stwory.push(k);
}
var kcf = k._currentframe;
if ((((kcf == 5) || (kcf == 6)) || (kcf == 11)) || (kcf == 8)) {
_spadnij(k);
}
if (k._currentframe == 6) {
this.gems++;
}
spawn(k);
i++;
y++;
}
x++;
}
_root.game._gems_ = 100 / _root.game.gems;
_root._score_ = 0;
this.mn = setInterval(main, 2, this);
_root._start_time = getTimer();
this.ex = setInterval(timeout, _root.table.tm, this);
this.st_ti = getTimer();
this.to_ti = _root.table.tm;
this.xx = (this.yy = 0);
this.onEnterFrame = isKey;
this.tmr = 0;
this.tmx = getTimer();
};
this.edit = function () {
var i = 10;
var x = 1;
while (x <= 18) {
this.tab[x] = [];
var y = 1;
while (y <= 12) {
if (this["k" + i] == undefined) {
this.attachMovie("klocek", "k" + i, i);
}
var k = this["k" + i];
k._x = (x * 30) - 15;
k._y = (y * 30) - 15;
k.x = x;
k.y = y;
switch (_root.table["k" + i].cf) {
case 7 :
this.drzwi = k;
break;
case 8 :
this.klucz = k;
break;
case 9 :
this.exit = k;
break;
case 10 :
this.kolo = k;
}
this.tab[x][y] = k;
k.gotoAndStop(_root.table["k" + i].cf);
if (_root.table["k" + i].cf >= 12) {
var pt = _root.table[("brzydal" + (_root.table["k" + i].cf - 11)) + "_path"];
if ((_root.table["k" + i].cf != 14) && (_root.table["k" + i].cf != 15)) {
if (k.path == undefined) {
k.path = [];
} else {
k / path.splice(0, k.path.length);
}
var ob = new Object();
ob.x = x;
ob.y = y;
k.path.push(ob);
var ii = 0;
while (ii < pt.length) {
var ob = new Object();
ob.x = pt[ii].x;
ob.y = pt[ii].y;
k.path.push(ob);
ii++;
}
}
this.stwory.push(k);
this["brzydal" + (_root.table["k" + i].cf - 11)] = k;
}
k.onEnterFrame = function () {
if (ASNative(800, 2) /* [Key] isDown */(1) == false) {
return(undefined);
}
if (this.hitTest(_root._xmouse, _root._ymouse, true) == false) {
return(undefined);
}
if (Key.isDown(16) && (this._parent.cols[this._parent._fr] != undefined)) {
var v = this._parent["brzydal" + (this._parent._fr - 11)];
if ((v.path[v.path.length - 1].x == this.x) && (v.path[v.path.length - 1].y == this.y)) {
return(undefined);
}
var ob = new Object();
ob.x = this.x;
ob.y = this.y;
v.path.push(ob);
_redraw();
return(undefined);
}
if (Key.isDown(17) && (this._parent.cols[this._parent._fr] != undefined)) {
var v = this._parent["brzydal" + (this._parent._fr - 11)];
var i = (v.path.length - 1);
while (i >= 0) {
if ((v.path[i].x == this.x) && (v.path[i].y == this.y)) {
v.path.splice(i, 1);
_redraw();
return(undefined);
}
i--;
}
return(undefined);
}
if ((this._currentframe == this._parent._fr) && (this._parent._fr != 1)) {
return(undefined);
}
switch (this._parent._fr) {
case 7 :
var v = this._parent.drzwi;
if (v != undefined) {
v.gotoAndStop("nico");
}
this.gotoAndStop(this._parent._fr);
this._parent.drzwi = this;
break;
case 8 :
var v = this._parent.klucz;
if (v != undefined) {
v.gotoAndStop("nico");
}
this.gotoAndStop(this._parent._fr);
this._parent.klucz = this;
break;
case 9 :
var v = this._parent.exit;
if (v != undefined) {
v.gotoAndStop("nico");
}
this.gotoAndStop(this._parent._fr);
this._parent.exit = this;
break;
case 10 :
var v = this._parent.kolo;
if (v != undefined) {
v.gotoAndStop("nico");
}
this.gotoAndStop(this._parent._fr);
this._parent.kolo = this;
break;
case 12 :
case 13 :
case 14 :
case 15 :
case 16 :
case 17 :
var v = this._parent["brzydal" + (this._parent._fr - 11)];
this.gotoAndStop(this._parent._fr);
if (v != undefined) {
var t_a = [];
delete this.path;
this.path = t_a.concat(v.path);
delete v.path;
this._parent.stwory.del(v);
this.path[0].x = this.x;
this.path[0].y = this.y;
v.gotoAndStop("nico");
}
if (this.path == undefined) {
this.path = [];
var ob = new Object();
ob.x = this.x;
ob.y = this.y;
this.path.push(ob);
}
this._parent.stwory.push(this);
this._parent["brzydal" + (this._parent._fr - 11)] = this;
break;
case 1 :
switch (this._currentframe) {
case 7 :
this._parent.drzwi == undefined;
break;
case 8 :
this._parent.klucz == undefined;
break;
case 9 :
this._parent.exit == undefined;
break;
case 10 :
this._parent.kolo == undefined;
break;
case 12 :
case 13 :
case 14 :
case 15 :
case 16 :
case 17 :
delete this.path;
this._parent["brzydal" + (this._parent._fr - 11)] = undefined;
this._parent.stwory.del(this);
}
this.gotoAndStop(this._parent._fr);
break;
default :
this.gotoAndStop(this._parent._fr);
}
_redraw();
};
i++;
y++;
}
x++;
}
_redraw();
};
this.cols = [];
this.cols[16] = 52479;
this.cols[17] = 16776960 /* 0xFFFF00 */;
this.cols[12] = 16711680 /* 0xFF0000 */;
this.cols[13] = 65280;
Array.prototype.del = function (el) {
var i = 0;
while (i < this.length) {
if (this[i] == el) {
this.splice(i, 1);
return(el);
}
i++;
}
return(null);
};
this.export = function () {
var k = "";
var x = 1;
while (x <= 18) {
var y = 1;
while (y <= 12) {
k = k + hex(_root._game.tab[x][y]._currentframe);
y++;
}
x++;
}
var time = hex(_root._ttm * 1000);
var code = _level0.cdkey;
var tx = ((((((k + "X") + time) + "X") + code) + "X") + ((_root._readonly._currentframe <= 2) ? "01" : "02"));
var i = 1;
while (i < 7) {
var b = _root._game["brzydal" + i].path;
tx = tx + "X";
var j = 1;
while (j < b.length) {
tx = tx + (hex(b[j].x) + hex(b[j].y));
j++;
}
i++;
}
return(tx);
};
Symbol 437 Button
on (press) {
_root.game.tab[_root.game.x][_root.game.y].an.gotoAndStop("umiera");
}
Symbol 450 Button
on (press) {
gotoAndStop (3);
}
Symbol 457 Button
on (press) {
if (_root._alt.length == 10) {
_root._alt_ = _root._alt;
}
gotoAndStop (5);
}
Symbol 467 Button
on (press) {
gotoAndStop (5);
}