Frame 1
playing = 0;
level = 1;
snd1 = new Sound(_root.snd1);
snd1.attachSound("snd1");
snd2 = new Sound(_root.snd2);
snd2.attachSound("snd2");
stop();
Instance of Symbol 31 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 = 225;
}
}
Frame 2
function buildMap(map) {
var _local3 = this;
W = map[0].length;
H = map.length;
var _local2 = 0;
while (_local2 < H) {
var _local1 = 0;
while (_local1 < W) {
_local3.attachMovie("tile", (("t_" + _local2) + "_") + _local1, ++d);
t = _local3[(("t_" + _local2) + "_") + _local1];
t._x = (_local1 * size) + width[level];
t._y = (_local2 * size) + height[level];
t.gotoAndStop(map[_local2][_local1]);
t.state = 0;
t.col = null;
_local1++;
}
_local2++;
}
}
function moveTile(ob, pos) {
var _local1 = this;
var _local2 = pos;
if (_local2 == null) {
playGame = 1;
} else {
obj = ob;
_local1[(("t_" + obj.y) + "_") + obj.x].state = 0;
_local1[(("t_" + obj.y) + "_") + obj.x].col = null;
if (_local2 == "left") {
counter = 0;
move = setInterval(_local1, "moveTileLeft", speed);
}
if (_local2 == "right") {
counter = 0;
move = setInterval(_local1, "moveTileRight", speed);
}
if (_local2 == "up") {
counter = 0;
move = setInterval(_local1, "moveTileUp", speed);
}
if (_local2 == "down") {
counter = 0;
move = setInterval(_local1, "moveTileDown", speed);
}
}
}
function moveTileRight() {
var _local1 = this;
obj._x = obj._x + 3;
counter++;
if (counter == 10) {
counter = 0;
obj.x++;
if ((myMap[obj.y][obj.x + 1] == 2) or _local1[(("t_" + obj.y) + "_") + (obj.x + 1)].state) {
clearInterval(move);
_local1[(("t_" + obj.y) + "_") + obj.x].state = 1;
_local1[(("t_" + obj.y) + "_") + obj.x].col = obj.frame;
playGame = 1;
moves++;
checkWin();
}
}
}
function moveTileLeft() {
var _local1 = this;
obj._x = obj._x - 3;
counter++;
if (counter == 10) {
counter = 0;
obj.x--;
if ((myMap[obj.y][obj.x - 1] == 2) or _local1[(("t_" + obj.y) + "_") + (obj.x - 1)].state) {
clearInterval(move);
_local1[(("t_" + obj.y) + "_") + obj.x].state = 1;
_local1[(("t_" + obj.y) + "_") + obj.x].col = obj.frame;
playGame = 1;
moves++;
checkWin();
}
}
}
function moveTileUp() {
var _local1 = this;
obj._y = obj._y - 3;
counter++;
if (counter == 10) {
counter = 0;
obj.y--;
if ((myMap[obj.y - 1][obj.x] == 2) or _local1[(("t_" + (obj.y - 1)) + "_") + obj.x].state) {
clearInterval(move);
_local1[(("t_" + obj.y) + "_") + obj.x].state = 1;
_local1[(("t_" + obj.y) + "_") + obj.x].col = obj.frame;
playGame = 1;
moves++;
checkWin();
}
}
}
function moveTileDown() {
var _local1 = this;
obj._y = obj._y + 3;
counter++;
if (counter == 10) {
counter = 0;
obj.y++;
if ((myMap[obj.y + 1][obj.x] == 2) or _local1[(("t_" + (obj.y + 1)) + "_") + obj.x].state) {
clearInterval(move);
_local1[(("t_" + obj.y) + "_") + obj.x].state = 1;
_local1[(("t_" + obj.y) + "_") + obj.x].col = obj.frame;
playGame = 1;
moves++;
checkWin();
}
}
}
function clearTile(ob, pos) {
var _local1 = ob;
_local1.mark.gotoAndStop(1);
_local1.arrow.gotoAndStop(1);
_local1.click = 0;
moveTile(_local1, pos);
}
function cc(x, y, f) {
var _local1 = this;
var _local2 = y;
var _local3 = x;
_local1.attachMovie("char", "char" + c, ++c);
_local1["char" + c]._x = (_local3 * size) + width[level];
_local1["char" + c]._y = (_local2 * size) + height[level];
_local1["char" + c].frame = f;
_local1["char" + c].click = 0;
_local1["char" + c].gotoAndStop(f);
_local1["char" + c].x = _local3;
_local1["char" + c].y = _local2;
_local1[(("t_" + _local2) + "_") + _local3].state = 1;
}
function doTile(lv) {
switch (lv) {
case 1 :
cc(3, 3, 1);
cc(3, 4, 1);
cc(3, 5, 1);
cc(3, 6, 1);
return;
case 2 :
cc(1, 1, 1);
cc(2, 1, 4);
cc(3, 1, 2);
cc(4, 1, 3);
return;
case 3 :
cc(3, 1, 3);
cc(4, 1, 3);
return;
case 4 :
cc(1, 1, 4);
cc(2, 1, 4);
return;
case 5 :
cc(1, 1, 5);
cc(1, 2, 5);
cc(1, 3, 5);
cc(1, 4, 5);
return;
case 6 :
cc(1, 7, 1);
cc(2, 6, 1);
cc(3, 7, 1);
cc(4, 6, 1);
cc(5, 7, 1);
cc(6, 6, 1);
return;
case 7 :
cc(1, 1, 3);
cc(1, 3, 2);
return;
case 8 :
cc(1, 1, 1);
cc(1, 8, 1);
cc(9, 8, 1);
cc(5, 8, 2);
return;
case 9 :
cc(1, 1, 2);
cc(1, 6, 1);
cc(1, 7, 5);
return;
case 10 :
cc(4, 2, 1);
cc(6, 2, 2);
cc(7, 2, 2);
cc(8, 2, 2);
cc(10, 2, 4);
cc(11, 2, 4);
cc(12, 2, 4);
cc(4, 3, 1);
cc(6, 3, 2);
cc(8, 3, 2);
cc(10, 3, 4);
cc(4, 4, 1);
cc(6, 4, 2);
cc(8, 4, 2);
cc(10, 4, 4);
cc(11, 4, 4);
cc(2, 5, 1);
cc(4, 5, 1);
cc(6, 5, 2);
cc(8, 5, 2);
cc(10, 5, 4);
cc(2, 6, 1);
cc(3, 6, 1);
cc(4, 6, 1);
cc(6, 6, 2);
cc(7, 6, 2);
cc(8, 6, 2);
cc(10, 6, 4);
cc(11, 6, 4);
cc(12, 6, 4);
return;
case 11 :
cc(1, 1, 1);
cc(2, 1, 1);
cc(3, 1, 1);
cc(4, 1, 1);
return;
case 12 :
cc(1, 1, 2);
cc(3, 1, 4);
cc(5, 1, 1);
return;
case 13 :
cc(7, 2, 1);
cc(1, 4, 3);
cc(5, 6, 3);
return;
case 14 :
cc(1, 1, 3);
cc(4, 1, 1);
cc(1, 4, 2);
cc(4, 4, 4);
cc(6, 4, 3);
cc(3, 6, 1);
return;
case 15 :
cc(5, 1, 2);
cc(1, 4, 1);
cc(9, 5, 4);
return;
case 16 :
cc(5, 7, 2);
cc(6, 7, 2);
cc(4, 7, 2);
return;
case 17 :
cc(1, 1, 2);
cc(7, 1, 4);
cc(1, 6, 1);
cc(7, 6, 5);
return;
case 18 :
cc(1, 1, 1);
cc(10, 1, 2);
cc(1, 10, 3);
cc(10, 10, 4);
return;
case 19 :
cc(7, 1, 1);
cc(7, 2, 1);
cc(7, 3, 3);
cc(7, 4, 1);
return;
case 20 :
cc(3, 2, 2);
cc(5, 2, 3);
cc(7, 2, 3);
cc(2, 3, 1);
cc(4, 3, 2);
cc(6, 3, 3);
cc(3, 4, 1);
cc(5, 4, 2);
cc(7, 4, 3);
cc(2, 5, 4);
cc(4, 5, 1);
cc(6, 5, 2);
cc(3, 6, 4);
cc(5, 6, 1);
cc(7, 6, 2);
cc(2, 7, 4);
cc(4, 7, 4);
cc(6, 7, 1);
}
}
function checkWin() {
var counter = 0;
var _local2 = 0;
while (_local2 < H) {
var _local1 = 0;
while (_local1 < W) {
if ((myMap[_local2][_local1] > 2) and (this[(("t_" + _local2) + "_") + _local1].state == 1)) {
var _local3 = myMap[_local2][_local1];
if (this[(("t_" + _local2) + "_") + _local1].col == (_local3 - 2)) {
counter++;
}
}
_local1++;
}
_local2++;
}
if (counter == win[level]) {
level++;
snd2.start(0, 1);
playGame = 0;
nextFrame();
}
}
myMap1 = [[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2], [2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2], [2, 1, 2, 1, 1, 1, 1, 1, 3, 2, 1, 2], [2, 1, 2, 1, 1, 1, 1, 1, 3, 2, 1, 2], [2, 1, 2, 1, 1, 1, 1, 1, 3, 2, 1, 2], [2, 1, 2, 1, 1, 1, 1, 1, 3, 2, 1, 2], [2, 1, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2], [2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2], [2, 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 100, 0, 60, 100, 80, 110, 60, 60, 100, 50, 100, 80];
height = [0, 50, 70, 0, 90, 50, 60, 70, 50, 60, 0, 40, 60, 50, 90, 60, 60, 90, 30, 80, 50];
win = [0, 4, 4, 2, 2, 4, 6, 2, 4, 3, 30, 4, 3, 3, 6, 3, 3, 4, 4, 4, 18];
size = 30;
d = 0;
c = 399;
playGame = 1;
speed = 10;
moves = 0;
myMap = _root["myMap" + level];
buildMap(myMap);
doTile(level);
numOfTiles = win[level];
levelText = (level + " / ") + 20;
stop();
Frame 3
var i = 0;
while (i < H) {
var j = 0;
while (j < W) {
removeMovieClip(this[(("t_" + i) + "_") + j]);
j++;
}
i++;
}
var a = 399;
while (a <= (numOfTiles + 399)) {
removeMovieClip(this["char" + a]);
a++;
}
if (level > 20) {
level = 1;
}
if (level < 1) {
level = 20;
}
prevFrame();
Symbol 15 MovieClip Frame 1
stop();
Symbol 20 MovieClip Frame 1
stop();
Symbol 21 Button
on (press) {
if (_root.playGame) {
_root.playGame = 0;
this.mark.gotoAndStop(2);
this.click = 1;
_root.snd1.start(0, 1);
}
}
Instance of Symbol 20 MovieClip "arrow" in Symbol 27 MovieClip [char] Frame 1
onClipEvent (mouseMove) {
if (_parent.click) {
adjside = _root._xmouse - (_parent._x + 15);
oppside = -1 * (_root._ymouse - (_parent._y + 15));
angle = Math.atan2(oppside, adjside);
angle = Math.round((angle / Math.PI) * 180);
d = Math.abs(-1 * angle);
if ((d <= 90) and (_root._xmouse > (_parent._x + 30))) {
if ((_root.myMap[_parent.y][_parent.x + 1] != 2) and (!_root[(("t_" + _parent.y) + "_") + (_parent.x + 1)].state)) {
_parent.arrow.gotoAndStop(2);
position = "right";
} else {
_parent.arrow.gotoAndStop(1);
position = null;
}
}
if ((d > 90) and (_root._xmouse < _parent._x)) {
if ((_root.myMap[_parent.y][_parent.x - 1] != 2) and (!_root[(("t_" + _parent.y) + "_") + (_parent.x - 1)].state)) {
_parent.arrow.gotoAndStop(3);
position = "left";
} else {
_parent.arrow.gotoAndStop(1);
position = null;
}
}
if (_root._ymouse < _parent._y) {
if ((_root.myMap[_parent.y - 1][_parent.x] != 2) and (!_root[(("t_" + (_parent.y - 1)) + "_") + _parent.x].state)) {
_parent.arrow.gotoAndStop(4);
position = "up";
} else {
_parent.arrow.gotoAndStop(1);
position = null;
}
}
if (_root._ymouse > (_parent._y + 30)) {
if ((_root.myMap[_parent.y + 1][_parent.x] != 2) and (!_root[(("t_" + (_parent.y + 1)) + "_") + _parent.x].state)) {
_parent.arrow.gotoAndStop(5);
position = "down";
} else {
_parent.arrow.gotoAndStop(1);
position = null;
}
}
}
}
onClipEvent (mouseUp) {
if (_parent.click) {
_root.clearTile(_parent, position);
position = null;
}
}
Symbol 35 Button
on (press) {
nextFrame();
}
Symbol 38 Button
on (press) {
getURL ("http://www.freestuff.gr/lightforce", "_blank");
}
Symbol 44 Button
on (release) {
if (playing == 1) {
stopAllSounds();
loop.gotoAndStop("Stop");
playing = 0;
} else {
loop.gotoAndStop("Play");
playing = 1;
}
}
Symbol 46 MovieClip Frame 1
stop();
Symbol 51 Button
on (press) {
if (playGame) {
level--;
nextFrame();
}
}
Symbol 52 Button
on (press) {
if (playGame) {
level++;
nextFrame();
}
}
Symbol 53 Button
on (press) {
playGame = 0;
nextFrame();
}