Frame 1
fscommand ("allowscale", false);
klik = new Sound(_root.mySound);
klik.attachSound("klik");
level = 1;
pX = 40;
pY = 45;
stop();
Instance of Symbol 13 MovieClip in Frame 1
onClipEvent (enterFrame) {
text = ((int(_parent.getBytesLoaded() / 1000) add " OF ") add int(_parent.getBytesTotal() / 1000)) add " LOADED ...";
if (_parent.getBytesTotal() == _parent.getBytesLoaded()) {
_root.goButton._x = 145;
text = "Full Board by LightForce Original idea Erich Friedman";
}
}
Frame 2
function buildMap(map) {
var _local3 = this;
mapWidth = map[0].length;
mapHeight = map.length;
var _local2 = 0;
while (_local2 < mapHeight) {
var _local1 = 0;
while (_local1 < mapWidth) {
_local3.attachMovie("tile", (("t_" + _local2) + "_") + _local1, ++d);
t = _local3[(("t_" + _local2) + "_") + _local1];
if ((level >= 1) and (level <= 3)) {
t._height = 41;
t._width = 41;
tileW = 40;
tileH = 40;
}
if ((level >= 4) and (level <= 6)) {
t._height = 34.2;
t._width = 34.2;
tileW = 33.2;
tileH = 33.2;
}
if (level >= 7) {
t._height = 29.5;
t._width = 29.5;
tileW = 28.5;
tileH = 28.5;
}
t._x = (_local1 * tileW) + pX;
t._y = (_local2 * tileH) + pY;
t.x = _local1;
t.y = _local2;
t.gotoAndStop(map[_local2][_local1]);
_local1++;
}
_local2++;
}
}
function placeBlue(tx, ty) {
var _local1 = ty;
var _local2 = tx;
_root[(("t_" + _local1) + "_") + _local2].gotoAndStop(3);
myMap[_local1][_local2] = 3;
currentX = _local2;
currentY = _local1;
klik.start(0, 1);
}
function selectPos(dx, dy) {
if (dx < currentX) {
pos = "left";
moveLeft(currentX, currentY);
} else if (dy < currentY) {
pos = "up";
moveUp(currentX, currentY);
} else if (dx > currentX) {
pos = "right";
moveRight(currentX, currentY);
} else if (dy > currentY) {
pos = "down";
moveDown(currentX, currentY);
}
}
function moveLeft(cx, cy) {
var _local1 = cy;
var _local2 = cx;
if (myMap[_local1][_local2 - 1] == 1) {
_root[(("t_" + _local1) + "_") + _local2].gotoAndStop(4);
myMap[_local1][_local2] = 4;
moveLeft(_local2 - 1, _local1);
} else {
placeBlue(_local2, _local1);
checkWin(_local2, _local1);
}
}
function moveUp(cx, cy) {
var _local1 = cy;
var _local2 = cx;
if (myMap[_local1 - 1][_local2] == 1) {
_root[(("t_" + _local1) + "_") + _local2].gotoAndStop(4);
myMap[_local1][_local2] = 4;
moveUp(_local2, _local1 - 1);
} else {
placeBlue(_local2, _local1);
checkWin(_local2, _local1);
}
}
function moveRight(cx, cy) {
var _local1 = cy;
var _local2 = cx;
if (myMap[_local1][_local2 + 1] == 1) {
_root[(("t_" + _local1) + "_") + _local2].gotoAndStop(4);
myMap[_local1][_local2] = 4;
moveRight(_local2 + 1, _local1);
} else {
placeBlue(_local2, _local1);
checkWin(_local2, _local1);
}
}
function moveDown(cx, cy) {
var _local1 = cy;
var _local2 = cx;
if (myMap[_local1 + 1][_local2] == 1) {
_root[(("t_" + _local1) + "_") + _local2].gotoAndStop(4);
myMap[_local1][_local2] = 4;
moveDown(_local2, _local1 + 1);
} else {
placeBlue(_local2, _local1);
checkWin(_local2, _local1);
}
}
function checkWin(wx, wy) {
var _local3 = 0;
var _local2 = 0;
while (_local2 < mapHeight) {
var _local1 = 0;
while (_local1 < mapWidth) {
if (myMap[_local2][_local1] == 1) {
_local3++;
}
_local1++;
}
_local2++;
}
if (_local3 < 1) {
nextLevel.swapDepths(2000 + d);
nextLevel.play();
playGame = false;
} else if ((((myMap[wy][wx + 1] != 1) and (myMap[wy][wx - 1] != 1)) and (myMap[wy - 1][wx] != 1)) and (myMap[wy + 1][wx] != 1)) {
resetArrow.gotoAndPlay(2);
currentX = null;
currentY = null;
}
}
myMap1 = [[2, 2, 1, 1, 1], [1, 1, 1, 1, 1], [1, 1, 1, 1, 2], [1, 1, 2, 1, 1], [1, 1, 1, 1, 1]];
myMap2 = [[2, 1, 1, 1, 1], [1, 1, 2, 1, 1], [1, 1, 1, 1, 2], [1, 1, 1, 1, 1], [1, 1, 1, 2, 1]];
myMap3 = [[2, 1, 1, 1, 1], [2, 1, 1, 1, 1], [2, 1, 1, 1, 1], [1, 1, 1, 1, 2], [1, 1, 1, 1, 2]];
myMap4 = [[2, 1, 1, 1, 1, 1], [1, 1, 2, 1, 1, 1], [1, 1, 1, 1, 1, 1], [1, 1, 1, 2, 1, 1], [1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1]];
myMap5 = [[2, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1], [1, 2, 1, 1, 1, 2], [1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 2, 1], [2, 1, 1, 1, 1, 1]];
myMap6 = [[1, 1, 1, 1, 1, 1], [1, 2, 2, 1, 1, 1], [1, 1, 1, 1, 2, 1], [1, 1, 1, 1, 2, 1], [1, 1, 1, 1, 1, 1], [1, 1, 2, 1, 1, 2]];
myMap7 = [[1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 2, 1], [1, 1, 2, 2, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 2, 1, 1, 1, 1], [1, 1, 1, 1, 2, 1, 1], [1, 1, 1, 1, 1, 1, 1]];
myMap8 = [[2, 1, 1, 1, 1, 1, 1], [2, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 2, 1, 2, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 2, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1]];
myMap9 = [[1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 2, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 2, 2, 1], [1, 1, 1, 1, 2, 1, 1], [1, 1, 1, 1, 1, 1, 2]];
playGame = true;
levelUp = true;
firstMove = true;
myMap = _root["myMap" + level];
buildMap(myMap);
this.createEmptyMovieClip("bl", ++d);
stop();
Frame 3
var i = 0;
while (i < mapHeight) {
var j = 0;
while (j < mapWidth) {
removeMovieClip(_root[(("t_" + i) + "_") + j]);
j++;
}
i++;
}
removeMovieClip(_root.bl);
if (levelUp == true) {
level++;
} else {
level--;
}
if (level < 1) {
level = 9;
}
if (level > 9) {
level = 1;
}
prevFrame();
Symbol 5 Button
on (press) {
if (_root.playGame) {
if (_root.firstMove) {
if (_root.myMap[this.y][this.x] == 1) {
_root.firstMove = false;
_root.startX = this.x;
_root.startY = this.y;
_root.placeBlue(this.x, this.y);
_root.smallCircle = true;
}
} else if ((_root.myMap[this.y][this.x] == 1) and ((this.x == _root.currentX) or (this.y == _root.currentY))) {
_root.selectPos(this.x, this.y);
if (_root.smallCircle) {
_root.smallCircle = false;
_root[(("t_" + _root.startY) + "_") + _root.startX].gotoAndStop(5);
}
}
}
}
Symbol 10 MovieClip [tile] Frame 4
with (_root.bl) {
lineStyle(1, 3368703, 100);
switch (_root.pos) {
case "left" :
lineX = this._x + (this._width / 2);
lineY = this._y + (this._height / 2);
moveTo(lineX, lineY);
lineTo(lineX - _root.tileW, lineY);
break;
case "up" :
lineX = this._x + (this._width / 2);
lineY = this._y + (this._height / 2);
moveTo(lineX, lineY);
lineTo(lineX, lineY - _root.tileH);
break;
case "right" :
lineX = this._x + (this._width / 2);
lineY = this._y + (this._height / 2);
moveTo(lineX, lineY);
lineTo(lineX + _root.tileW, lineY);
break;
case "down" :
lineX = this._x + (this._width / 2);
lineY = this._y + (this._height / 2);
moveTo(lineX, lineY);
lineTo(lineX, lineY + _root.tileH);
}
}
stop();
Symbol 17 Button
on (press) {
nextFrame();
}
Symbol 23 Button
on (press) {
if (playGame) {
levelUp = false;
nextFrame();
}
}
Symbol 24 Button
on (press) {
if (playGame) {
levelUp = true;
nextFrame();
}
}
Symbol 30 Button
on (press) {
if (playGame == true) {
level--;
nextFrame();
}
}
Symbol 33 Button
on (press) {
getURL ("http://www.freestuff.gr/lightforce", "_blank");
}
Symbol 41 MovieClip Frame 1
stop();
Symbol 41 MovieClip Frame 110
_root.nextFrame();
Symbol 45 MovieClip Frame 1
stop();
Symbol 45 MovieClip Frame 21
gotoAndPlay (3);
Symbol 49 Button
on (release) {
if (_root.playing == 1) {
stopAllSounds();
loopSound.gotoAndStop("Stop");
playing = 0;
} else {
loopSound.gotoAndStop("Play");
playing = 1;
}
}
Symbol 50 MovieClip Frame 1
stop();