Frame 1
stop();
Frame 2
_quality = "BEST";
stop();
Frame 3
function init() {
imovie_new.gotoAndStop(1);
}
function getX(a_mouseX) {
var stageX = (Math.floor(_root._xmouse) - _root.OFFSETX);
return(Math.floor((stageX * _root.SEGMENTSX) / _root.MAXX));
}
function getY(a_mouseY) {
var stageY = (Math.floor(_root._ymouse) - _root.OFFSETY);
return(Math.floor((stageY * _root.SEGMENTSY) / _root.MAXY));
}
function placePiece(a_piece, a_x, a_y, a_rotation) {
pieces[a_x + (8 * a_y)].state = 2;
pieces[a_x + (8 * a_y)].handler = a_piece;
a_piece._x = (((a_x * MAXX) / SEGMENTSX) + 25) + _root.OFFSETX;
a_piece._y = (((a_y * MAXY) / SEGMENTSY) + 25) + _root.OFFSETY;
a_piece._rotation = a_rotation;
}
function newGame() {
trace("nEW GAME ");
icrash.hide();
isuccess.hide();
initStack();
i = 0;
while (i < pieces.length) {
if (pieces[i].handler != null) {
pieces[i].handler.removeMovieClip();
}
pieces[i] = new object();
pieces[i].state = 0;
pieces[i].handler = null;
i++;
}
finishx = random(6) + 1;
finishy = random(6) + 1;
placePiece(finish, finishx, finishy, random(4) * 90);
startx = random(6) + 1;
starty = random(6) + 1;
while ((Math.abs(startx - finishx) + Math.abs(starty - finishy)) < 5) {
startx = random(6) + 1;
starty = random(6) + 1;
}
pieces[startx + (8 * starty)].state = 2;
pieces[startx + (8 * starty)].handler = start;
placePiece(start, startx, starty, random(4) * 90);
start.gotoAndStop(1);
finish.gotoAndStop(1);
itimer.start(60 - (5 * level));
gb_playing = true;
}
function test(a) {
trace("main root " + a);
}
function crash(a) {
gb_playing = false;
hideWrongPieces();
trace("CCcrash " + a);
icrash.swapDepths(6500000000000);
icrash.crash();
init();
}
function success(a) {
gb_playing = false;
hideWrongPieces();
trace("SUCCCCCCCCESSSSSSS " + a);
isuccess.swapDepths(6500000000000);
isuccess.success();
init();
changeLevel(1);
}
function hideWrongPieces() {
var i;
i = 0;
while (i < pieces.length) {
if (pieces[i].state != 2) {
pieces[i].handler.hide();
}
i++;
}
}
function changeLevel(arg) {
changeScore(20);
level++;
txtLevel = level;
}
function waterOut(aid, aout) {
trace((((("waterOut id " + aid) + " out ") + aout) + " recalculate[aout] ") + recalculate[aout]);
if (aout == 0) {
next = aid - 8;
} else if (aout == 1) {
next = aid + 1;
} else if (aout == 2) {
next = aid + 8;
} else if (aout == 3) {
next = aid - 1;
}
trace((("next " + next) + " pieces[next] ") + pieces[next]);
if ((pieces[next].state != 0) && ((next >= 0) && ((SEGMENTSX * SEGMENTSY) >= next))) {
pieces[next].handler.waterIn(recalculate[aout]);
pieces[next].state = 2;
changeScore(1);
} else {
crash();
}
}
function changeScore(arg) {
score = score + arg;
txtScore = score;
}
function loadPieces() {
}
function initStack() {
i = stack.length;
while (0 < i) {
stack[i - 1].removeMovieClip();
stack.pop();
i--;
}
i = 0;
while (i < 5) {
name = "uniqName" + depth;
n = eval (piecesName[random(piecesName.length)]);
n.duplicateMovieClip(name, depth);
depth++;
newpiece = eval ("_level0." + name);
newpiece._x = 450;
newpiece._y = (5 - i) * 55;
newpiece._rotation = random(4) * 90;
stack[stack.length] = newpiece;
i++;
}
stack[0]._y = stack[0]._y + 55;
}
function getNext() {
ret = stack[0];
i = 1;
while (i < stack.length) {
stack[i]._y = stack[i]._y + 55;
stack[i - 1] = stack[i];
i++;
}
name = "uniqName" + depth;
n = eval (piecesName[random(piecesName.length)]);
n.duplicateMovieClip(name, depth);
depth++;
newpiece = eval ("_level0." + name);
newpiece._x = 450;
newpiece._y = 55;
newpiece._rotation = random(4) * 90;
stack[stack.length - 1] = newpiece;
stack[0]._y = stack[0]._y + 55;
return(ret);
}
function rotateNext(arg) {
stack[0]._rotation = stack[0]._rotation + 90;
if (arg == "CW") {
}
}
function destroyCurrent() {
o = getNext();
o.removeMovieClip();
}
function startWater(arg) {
if (arg != -1) {
i = (parseInt(tfY) * 8) + parseInt(tfX);
trace("WSater " + i);
if (pieces[i].state == 1) {
pieces[i].handler.waterIn(arg);
trace((("QWERYTGHMGV " + i) + " pieces[i].handler ") + pieces[i].handler);
}
} else {
start.init(startx + (starty * 8), 10);
finish.init(finishx + (finishy * 8), 10);
start.startWater();
}
}
function changeLanguage() {
}
function changeSkins() {
trace(changeSkins + "skins/wall/");
loadSkins("skin/wall/");
}
function loadSkins(a_dir) {
zv.loadSkin(a_dir + "zv.swf");
zs.loadSkin(a_dir + "zs.swf");
}
if (!initialized) {
initialized = true;
var pieces = new Array(64);
var recalculate = new Array(2, 3, 0, 1);
var depth = 100;
var piecesName = new Array("zv", "zs", "zs", "zvjs");
var stack = new Array();
var level = 0;
var score = 0;
MAXX = 400;
MAXY = 400;
SEGMENTSX = 8;
SEGMENTSY = 8;
OFFSETX = 5;
OFFSETY = 5;
gb_playing = false;
itimer.gotoAndStop(1);
}
stop();
Instance of Symbol 34 MovieClip "iBoard" in Frame 3
onClipEvent (mouseUp) {
if (!_root.gb_playing) {
return(false);
}
OFFSETX = 0;
OFFSETY = 0;
if (!initialized) {
initialized = true;
}
trace((("stageX " + _root._xmouse) + " stageY ") + _root._ymouse);
var x = _root.getX(_root._xmouse);
var y = _root.getY(_root._ymouse);
trace((("X " + X) + " Y ") + Y);
if ((x >= _root.SEGMENTSX) || (x < 0)) {
trace("not my bussines");
return(false);
}
if (_parent.pieces[x + (y * 8)].state == 1) {
_parent.pieces[x + (y * 8)].handler.removeMovieClip();
_parent.pieces[x + (y * 8)].handler = null;
_parent.pieces[x + (y * 8)].state = 0;
}
if (_parent.pieces[x + (y * 8)].state == 0) {
newpiece = _parent.getNext();
_root.placePiece(newpiece, x, y, newpiece._rotation);
newpiece.init(x + (y * 8), 10);
_parent.pieces[x + (y * 8)].state = 1;
_parent.pieces[x + (y * 8)].handler = newpiece;
}
}
onClipEvent (load) {
}
Symbol 6 Button
on (release) {
getURL ("http://www.2dplay.com", "_blank");
}
Symbol 7 MovieClip Frame 60
_root.gotoAndStop(2);
Symbol 13 Button
on (release) {
gotoAndStop (3);
}
Symbol 16 Button
on (release) {
getURL ("http://www.FreeGamesForYourWebsite.com", "_blank");
}
Symbol 20 Button
on (release) {
getURL ("http://www.2dplay.com", "_blank");
}
Symbol 27 Button
on (release) {
trace("finish");
counter = time;
_parent.gotoAndPlay("while");
}
Symbol 32 MovieClip Frame 1
function start(arg) {
counter = 0;
if (0 < arg) {
time = arg * fps;
}
iover2._width = origWidth;
iover2._x = origX;
trace((("animationSteps " + animationSteps) + " time ") + time);
if (animationSteps < time) {
step = iprechod._width / animationSteps;
frameStep = time / animationSteps;
} else {
step = iprechod._width / time;
frameStep = 1;
}
nextAnimatedFrame = frameStep;
trace("step " + step);
trace("step " + step);
gotoAndPlay (2);
}
var counter = 0;
var time = 20;
var fps = 20;
var step;
var origWidth = iover2._width;
var origX = iover2._x;
var animationSteps = 300;
var nextAnimatedFrame = 0;
var frameStep = 0;
stop();
Symbol 32 MovieClip Frame 2
if (counter < time) {
counter++;
if (counter >= nextAnimatedFrame) {
nextAnimatedFrame = nextAnimatedFrame + frameStep;
iover2._width = iover2._width - step;
}
rest = (time / fps) - (counter / fps);
cas = Math.round(rest * 100) / 100;
} else {
counter = 0;
iover2._width = 0;
gotoAndStop (9);
}
Symbol 32 MovieClip Frame 3
gotoAndPlay (2);
Symbol 32 MovieClip Frame 9
_parent.startWater(-1);
Symbol 40 MovieClip Frame 1
function init(aid, atime) {
id = aid;
time = atime;
trace(" volani init" + _rotation);
if ((_rotation == 90) || (_rotation == -90)) {
resources[0] = 2;
resources[2] = 0;
} else {
resources[1] = 3;
resources[3] = 1;
}
}
function waterIn(afrom) {
trace(((((((" waterIn " + afrom) + " MY ID ") + id) + "my rotation ") + _rotation) + "yv") + zv);
from = afrom;
trace(((" waterIn " + afrom) + " resource[from] ") + resource[from]);
if (resources[from] != -1) {
to = resources[from];
if (((((_rotation == 0) && (from == 3)) || ((_rotation == 90) && (from == 0))) || ((_rotation == 180) && (from == 1))) || ((_rotation == -90) && (from == 2))) {
trace("ZV");
gotoAndPlay (11);
} else {
trace("VZ");
gotoAndPlay (21);
}
} else {
trace("CRASH");
_parent.crash();
}
}
function hide() {
gotoAndPlay (31);
}
function loadSkin(a_skin) {
trace("SKINS " + zvback);
zvback.attachMovie("skins/wall/zv", _level0.zv.zvback, 0);
}
if (!initialized) {
initialized = true;
var id;
var time;
var directions;
var resources = new Array();
var outflow = new Array();
var steps = 10;
var counter = 1;
var from;
var to;
resources[0] = -1;
resources[1] = -1;
resources[2] = -1;
resources[3] = -1;
}
stop();
Symbol 40 MovieClip Frame 20
_parent.waterOut(id, resources[from]);
stop();
Symbol 40 MovieClip Frame 30
_parent.waterOut(id, resources[from]);
stop();
Symbol 40 MovieClip Frame 35
removeMovieClip(this);
Symbol 51 MovieClip Frame 1
function init(aid, atime) {
id = aid;
time = atime;
trace(" volani init" + _rotation);
if (_rotation == 0) {
resources[3] = 0;
resources[0] = 3;
}
if (_rotation == 90) {
resources[0] = 1;
resources[1] = 0;
}
if (_rotation == 180) {
resources[1] = 2;
resources[2] = 1;
}
if (_rotation == -90) {
resources[3] = 2;
resources[2] = 3;
}
}
function waterIn(afrom) {
trace(((((((" waterIn " + afrom) + " MY ID ") + id) + "my rotation ") + _rotation) + "yv") + zv);
from = afrom;
trace(((" waterIn " + afrom) + " resource[from] ") + resource[from]);
if (resources[from] != -1) {
to = resources[from];
if (((((_rotation == 0) && (from == 3)) || ((_rotation == 90) && (from == 0))) || ((_rotation == 180) && (from == 1))) || ((_rotation == -90) && (from == 2))) {
trace("ZV");
gotoAndPlay (11);
} else {
trace("VZ");
gotoAndPlay (21);
}
} else {
trace("CRASH");
_parent.crash();
}
}
function hide() {
gotoAndPlay (31);
}
if (!initialized) {
initialized = true;
var id;
var time;
var directions;
var resources = new Array();
var outflow = new Array();
var steps = 10;
var counter = 1;
var from;
var to;
resources[0] = -1;
resources[1] = -1;
resources[2] = -1;
resources[3] = -1;
}
stop();
Symbol 51 MovieClip Frame 20
_parent.waterOut(id, resources[from]);
stop();
Symbol 51 MovieClip Frame 30
_parent.waterOut(id, resources[from]);
stop();
Symbol 51 MovieClip Frame 35
removeMovieClip(this);
Symbol 54 MovieClip Frame 1
function init(aid, atime) {
trace(" START volani init");
id = aid;
time = atime;
if (_rotation == 0) {
out = 1;
}
if (_rotation == 90) {
out = 2;
}
if (_rotation == 180) {
out = 3;
}
if (_rotation == -90) {
out = 0;
}
}
function startWater(afrom) {
gotoAndPlay (11);
}
if (!initialized) {
initialized = true;
var id;
var time;
var out;
}
stop();
Symbol 54 MovieClip Frame 20
_parent.waterOut(id, out);
trace((("out " + out) + " id ") + id);
stop();
Symbol 57 MovieClip Frame 1
function init(aid, atime) {
trace(" FINISH volani init");
id = aid;
time = atime;
if (_rotation == 0) {
wIn = 1;
}
if (_rotation == 90) {
wIn = 2;
}
if (_rotation == 180) {
wIn = 3;
}
if (_rotation == -90) {
wIn = 0;
}
}
function waterIn(afrom) {
trace(((" FINISH waterIn " + afrom) + " wIn ") + wIn);
if (afrom == wIn) {
gotoAndPlay (11);
} else {
_parent.crash();
}
}
if (!initialized) {
initialized = true;
var id;
var time;
var wIn;
}
stop();
Symbol 57 MovieClip Frame 20
_parent.success(id);
trace("SUCC ");
stop();
Symbol 62 MovieClip Frame 1
function success() {
gotoAndPlay (3);
}
function hide() {
gotoAndStop (2);
}
stop();
Symbol 62 MovieClip Frame 15
stop();
Symbol 67 Button
on (release) {
rotateNext("CW");
}
on (keyPress "<Space>") {
rotateNext("CW");
}
on (keyPress "<Enter>") {
destroyCurrent();
}
Symbol 78 MovieClip Frame 1
isides._visible = false;
function init(aid, atime) {
id = aid;
time = atime;
trace(" volani init" + _rotation);
resources[0] = 2;
resources[1] = 3;
resources[2] = 0;
resources[3] = 1;
_rotation = 0;
}
function waterIn(afrom) {
trace(((((((" waterIn " + afrom) + " MY ID ") + id) + "my rotation ") + _rotation) + "yv") + zv);
from = afrom;
trace(((" waterIn " + afrom) + " resource[from] ") + resource[from]);
if (oneTimes) {
isides._visible = true;
if ((from == 1) || (from == 3)) {
isides._rotation = 90;
} else {
isides._rotation = 0;
}
}
oneTimes = true;
if (resources[from] != -1) {
to = resources[from];
if (from == 1) {
trace("VZ");
gotoAndPlay (21);
} else if (from == 2) {
trace("JS");
gotoAndPlay (31);
} else if (from == 3) {
trace("ZV");
gotoAndPlay (11);
} else if (from == 0) {
trace("SJ");
gotoAndPlay (41);
}
} else {
trace("CRASH");
_parent.crash();
}
}
function hide() {
gotoAndPlay (51);
}
if (!initialized) {
initialized = true;
var id;
var time;
var directions;
var resources = new Array();
var outflow = new Array();
var steps = 10;
var counter = 1;
var from;
var to;
var oneTimes = false;
resources[0] = -1;
resources[1] = -1;
resources[2] = -1;
resources[3] = -1;
}
stop();
Symbol 78 MovieClip Frame 20
_parent.waterOut(id, resources[from]);
stop();
Symbol 78 MovieClip Frame 30
_parent.waterOut(id, resources[from]);
stop();
Symbol 78 MovieClip Frame 40
_parent.waterOut(id, resources[from]);
stop();
Symbol 78 MovieClip Frame 50
_parent.waterOut(id, resources[from]);
stop();
Symbol 78 MovieClip Frame 55
removeMovieClip(this);
Symbol 82 Button
on (release) {
_root.odesl = 0;
_parent.newGame();
gotoAndStop (2);
}
Symbol 84 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 2
stop();
Symbol 94 MovieClip Frame 1
function crash() {
gotoAndPlay (3);
}
function hide() {
gotoAndStop (2);
}
stop();
Symbol 94 MovieClip Frame 15
_root.txtScore = _root.txtScore - 30;
if (_root.txtScore < 0) {
_root.txtScore = 0;
}
stop();