Frame 1
level = 1;
size = 30;
snd1 = new Sound(_root.mySound);
snd1.attachSound("snd1");
loop = new Sound(_root.loopSound);
loop.attachSound("loop");
playing = 0;
stop();
Instance of Symbol 16 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 = 210;
}
}
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];
t._x = _local1 * size;
t._y = _local2 * size;
t.gotoAndStop(map[_local2][_local1]);
t.state = 1;
_local1++;
}
_local2++;
}
}
function createBall(py, px, col) {
var _local1 = this;
var _local2 = py;
var _local3 = px;
_local1.attachMovie("ball", (("ball_" + _local2) + "_") + _local3, ++d);
ball = _local1[(("ball_" + _local2) + "_") + _local3];
ball.step = 0;
ball.color = col;
ball.px = _local3;
ball.py = _local2;
ball._x = ball.px * size;
ball._y = ball.py * size;
ball.gotoAndStop(col);
myBall[_local2][_local3] = col;
ball.onEnterFrame = function () {
var _local1 = this;
if (playGame) {
move = 0;
if (Key.isDown(38)) {
chardir = "up";
playGame = 0;
} else if (Key.isDown(40)) {
chardir = "down";
playGame = 0;
} else if (Key.isDown(37)) {
chardir = "left";
playGame = 0;
} else if (Key.isDown(39)) {
chardir = "right";
playGame = 0;
}
}
if (chardir == "right") {
if (myBall[_local1.py][_local1.px + 1] != 2) {
_local1.go = 0;
}
if (myBall[_local1.py][_local1.px + 1] == 2) {
_local1.go = 1;
_local1._x = _local1._x + 10;
_local1.step++;
if (_local1.step == 3) {
move++;
_local1.px++;
_local1._name = [(("ball_" + _local1.py) + "_") + _local1.px];
myBall[_local1.py][_local1.px] = _local1.color;
myBall[_local1.py][_local1.px - 1] = 2;
_local1.step = 0;
}
}
}
if (chardir == "left") {
if (myBall[_local1.py][_local1.px - 1] != 2) {
_local1.go = 0;
}
if (myBall[_local1.py][_local1.px - 1] == 2) {
_local1.go = 1;
_local1._x = _local1._x - 10;
_local1.step++;
if (_local1.step == 3) {
move++;
_local1.px--;
_local1._name = [(("ball_" + _local1.py) + "_") + _local1.px];
myBall[_local1.py][_local1.px] = _local1.color;
myBall[_local1.py][_local1.px + 1] = 2;
_local1.step = 0;
}
}
}
if (chardir == "up") {
if (myBall[_local1.py - 1][_local1.px] != 2) {
_local1.go = 0;
}
if (myBall[_local1.py - 1][_local1.px] == 2) {
_local1.go = 1;
_local1._y = _local1._y - 10;
_local1.step++;
if (_local1.step == 3) {
move++;
_local1.py--;
_local1._name = [(("ball_" + _local1.py) + "_") + _local1.px];
myBall[_local1.py][_local1.px] = _local1.color;
myBall[_local1.py + 1][_local1.px] = 2;
_local1.step = 0;
}
}
}
if (chardir == "down") {
if (myBall[_local1.py + 1][_local1.px] != 2) {
_local1.go = 0;
}
if (myBall[_local1.py + 1][_local1.px] == 2) {
_local1.go = 1;
_local1._y = _local1._y + 10;
_local1.step++;
if (_local1.step == 3) {
move++;
_local1.py++;
_local1._name = [(("ball_" + _local1.py) + "_") + _local1.px];
myBall[_local1.py][_local1.px] = _local1.color;
myBall[_local1.py - 1][_local1.px] = 2;
_local1.step = 0;
}
}
}
};
}
function checkWin() {
var counter = 0;
var _local3 = 0;
while (_local3 < _root.mapHeight) {
var _local2 = 0;
while (_local2 < _root.mapWidth) {
var _local1 = myBall[_local3][_local2];
if ((((_local1 == 3) or (_local1 == 4)) or (_local1 == 5)) or (_local1 == 6)) {
counter++;
}
_local2++;
}
_local3++;
}
return(counter);
}
function findTile(y, x) {
var _local1 = y;
var _local2 = x;
var _local3 = myBall[_local1][_local2];
if ((((myBall[_local1 - 1][_local2] == _local3) or (myBall[_local1 + 1][_local2] == _local3)) or (myBall[_local1][_local2 - 1] == _local3)) or (myBall[_local1][_local2 + 1] == _local3)) {
_root[(("t_" + _local1) + "_") + _local2].state = 0;
_root[(("ball_" + _local1) + "_") + _local2].gotoAndPlay(8);
if ((myBall[_local1 - 1][_local2] == _local3) and _root[(("t_" + (_local1 - 1)) + "_") + _local2].state) {
findTile(_local1 - 1, _local2);
}
if ((myBall[_local1 + 1][_local2] == _local3) and _root[(("t_" + (_local1 + 1)) + "_") + _local2].state) {
findTile(_local1 + 1, _local2);
}
if ((myBall[_local1][_local2 - 1] == _local3) and _root[(("t_" + _local1) + "_") + (_local2 - 1)].state) {
findTile(_local1, _local2 - 1);
}
if ((myBall[_local1][_local2 + 1] == _local3) and _root[(("t_" + _local1) + "_") + (_local2 + 1)].state) {
findTile(_local1, _local2 + 1);
}
}
}
function pickLevelBalls(level) {
switch (level) {
case 1 :
createBall(3, 4, 3);
createBall(3, 5, 6);
createBall(3, 6, 3);
createBall(3, 7, 6);
createBall(3, 8, 3);
createBall(3, 9, 6);
return;
case 2 :
createBall(3, 5, 3);
createBall(3, 6, 7);
createBall(5, 5, 3);
createBall(6, 7, 3);
return;
case 3 :
createBall(3, 7, 4);
createBall(5, 7, 5);
createBall(5, 5, 4);
createBall(7, 7, 4);
createBall(8, 6, 5);
return;
case 4 :
createBall(3, 7, 3);
createBall(5, 8, 3);
createBall(6, 5, 3);
return;
case 5 :
createBall(4, 5, 6);
createBall(5, 6, 6);
createBall(6, 8, 6);
createBall(5, 4, 7);
createBall(6, 6, 7);
return;
case 6 :
createBall(3, 3, 6);
createBall(3, 8, 6);
createBall(5, 5, 5);
createBall(6, 4, 5);
createBall(6, 6, 5);
createBall(7, 5, 6);
createBall(7, 7, 5);
return;
case 7 :
createBall(3, 5, 3);
createBall(3, 7, 7);
createBall(4, 8, 3);
createBall(6, 3, 3);
createBall(8, 5, 7);
return;
case 8 :
createBall(3, 8, 3);
createBall(4, 4, 3);
createBall(5, 6, 7);
createBall(7, 6, 3);
return;
case 9 :
createBall(3, 8, 7);
createBall(3, 4, 4);
createBall(4, 5, 7);
createBall(4, 6, 4);
createBall(5, 4, 7);
createBall(5, 5, 4);
createBall(5, 7, 7);
createBall(6, 3, 4);
createBall(6, 8, 4);
return;
case 10 :
createBall(3, 6, 3);
createBall(5, 8, 3);
createBall(6, 8, 7);
createBall(5, 3, 3);
return;
case 11 :
createBall(3, 7, 3);
createBall(5, 7, 7);
createBall(8, 7, 3);
createBall(4, 3, 3);
return;
case 12 :
createBall(4, 7, 7);
createBall(4, 6, 3);
createBall(5, 4, 3);
createBall(6, 4, 7);
createBall(6, 8, 3);
createBall(7, 7, 7);
return;
case 13 :
createBall(3, 6, 3);
createBall(4, 6, 7);
createBall(5, 6, 3);
createBall(7, 6, 7);
createBall(8, 6, 3);
return;
case 14 :
createBall(3, 4, 5);
createBall(3, 7, 6);
createBall(4, 8, 6);
createBall(6, 8, 5);
createBall(6, 4, 7);
createBall(7, 4, 5);
createBall(7, 5, 6);
return;
case 15 :
createBall(3, 5, 3);
createBall(4, 8, 3);
createBall(5, 6, 7);
createBall(7, 8, 3);
return;
case 16 :
createBall(6, 8, 6);
createBall(7, 8, 5);
createBall(6, 7, 5);
createBall(6, 5, 6);
createBall(6, 4, 5);
createBall(7, 4, 6);
return;
case 17 :
createBall(3, 6, 3);
createBall(4, 5, 5);
createBall(4, 4, 6);
createBall(5, 6, 6);
createBall(5, 7, 5);
createBall(6, 8, 3);
createBall(6, 9, 7);
createBall(7, 8, 6);
createBall(8, 4, 3);
return;
case 18 :
createBall(4, 5, 5);
createBall(5, 7, 6);
createBall(6, 6, 5);
createBall(7, 7, 5);
createBall(7, 5, 6);
createBall(8, 6, 6);
return;
case 19 :
createBall(3, 6, 6);
createBall(4, 8, 5);
createBall(4, 3, 6);
createBall(5, 3, 5);
createBall(6, 5, 5);
createBall(5, 7, 7);
return;
case 20 :
createBall(3, 4, 5);
createBall(5, 5, 6);
createBall(6, 6, 5);
createBall(5, 7, 6);
createBall(5, 8, 5);
return;
case 21 :
createBall(3, 7, 3);
createBall(5, 4, 5);
createBall(5, 5, 3);
createBall(6, 6, 6);
createBall(7, 8, 5);
createBall(8, 6, 6);
createBall(8, 4, 3);
return;
case 22 :
createBall(4, 3, 5);
createBall(4, 7, 3);
createBall(5, 8, 5);
createBall(6, 6, 6);
createBall(6, 5, 3);
createBall(7, 4, 6);
createBall(8, 6, 5);
createBall(8, 8, 6);
createBall(9, 3, 3);
return;
case 23 :
createBall(4, 6, 6);
createBall(5, 7, 6);
createBall(6, 8, 6);
createBall(8, 8, 3);
createBall(6, 6, 3);
createBall(5, 5, 5);
createBall(5, 4, 7);
createBall(8, 4, 5);
createBall(9, 4, 3);
return;
case 24 :
createBall(3, 4, 3);
createBall(3, 5, 6);
createBall(3, 6, 5);
createBall(3, 7, 6);
createBall(3, 8, 3);
createBall(4, 6, 6);
createBall(5, 6, 3);
createBall(6, 6, 6);
createBall(7, 6, 5);
createBall(7, 4, 6);
createBall(7, 8, 3);
return;
case 25 :
createBall(4, 4, 3);
createBall(5, 6, 3);
createBall(7, 5, 7);
createBall(7, 8, 3);
return;
case 26 :
createBall(4, 3, 3);
createBall(4, 4, 7);
createBall(4, 5, 6);
createBall(4, 6, 3);
createBall(4, 7, 7);
createBall(4, 8, 3);
createBall(8, 3, 6);
return;
case 27 :
createBall(6, 7, 3);
createBall(8, 6, 3);
createBall(7, 4, 3);
return;
case 28 :
createBall(5, 5, 3);
createBall(4, 6, 3);
createBall(5, 7, 7);
createBall(6, 8, 3);
return;
case 29 :
createBall(5, 5, 3);
createBall(4, 6, 3);
createBall(5, 7, 3);
createBall(7, 6, 6);
createBall(8, 7, 6);
createBall(7, 8, 6);
return;
case 30 :
createBall(3, 6, 3);
createBall(3, 5, 6);
createBall(4, 4, 3);
createBall(4, 7, 6);
createBall(5, 4, 7);
createBall(6, 3, 6);
createBall(7, 7, 3);
}
}
function removeStage() {
var _local3 = _root;
var _local2 = 0;
while (_local2 < mapHeight) {
var _local1 = 0;
while (_local1 < mapWidth) {
removeMovieClip(_local3[(("t_" + _local2) + "_") + _local1]);
removeMovieClip(_local3[(("ball_" + _local2) + "_") + _local1]);
_local1++;
}
_local2++;
}
}
myMap1 = [[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2], [2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2], [2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2], [2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2], [2, 2, 2, 1, 2, 1, 2, 2, 2, 2, 1, 2], [2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 1, 2], [2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 2, 2]];
myMap2 = [[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 2, 2], [2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2], [2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2], [2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2], [2, 2, 2, 2, 1, 2, 2, 2, 1, 1, 2, 2], [2, 2, 2, 2, 1, 1, 1, 1, 1, 2, 2, 2]];
myMap3 = [[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2], [2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2], [2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2], [2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2], [2, 2, 2, 2, 1, 2, 2, 1, 2, 1, 2, 2], [2, 2, 2, 2, 1, 2, 2, 2, 2, 1, 2, 2], [2, 2, 2, 2, 1, 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2], [2, 2, 1, 1, 2, 2, 1, 2, 1, 1, 2, 2], [2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 2], [2, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2], [2, 2, 2, 1, 1, 2, 2, 2, 2, 1, 2, 2], [2, 2, 2, 2, 1, 1, 2, 2, 2, 1, 2, 2], [2, 2, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2], [2, 2, 2, 2, 2, 2, 1, 1, 1, 2, 2, 2]];
myMap30 = [[2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2], [2, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2], [2, 2, 1, 2, 2, 2, 2, 1, 1, 2, 2, 2], [2, 2, 1, 2, 2, 2, 1, 2, 1, 1, 2, 2], [2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2], [2, 2, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2], [2, 2, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2], [2, 2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 2], [2, 2, 2, 2, 1, 1, 1, 1, 2, 2, 2, 2]];
levelBalls = [0, 6, 4, 5, 3, 5, 7, 5, 4, 9, 4, 4, 6, 5, 7, 4, 6, 9, 6, 6, 5, 7, 9, 9, 11, 4, 7, 3, 4, 6, 7];
stageMoves = [0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8];
d = 0;
klik = 1;
playGame = 1;
moves = 0;
flag = 1;
balls = levelBalls[level];
sm = stageMoves[level];
myMap = _root["myMap" + level];
myBall = myMap;
buildMap(myMap);
moveLabel = (moves + " / ") + sm;
pickLevelBalls(level);
chardir = null;
stop();
Instance of Symbol 26 MovieClip "empty" in Frame 2
onClipEvent (enterFrame) {
var win = _root.checkWin();
if ((win == 0) and (_root.moves <= _root.sm)) {
_root.level++;
if (_root.level == 31) {
_root.gotoAndStop(4);
} else {
_root.flag = 0;
_root.nextFrame();
}
}
if (_root.moves > _root.sm) {
if (win > 0) {
_root.flag = 1;
_root.snd1.start(0, 1);
_root.nextFrame();
}
}
if (!_root.playGame) {
this.play();
if ((_root.move != 0) and _root.klik) {
_root.klik = 0;
_root.moves++;
_root.moveLabel = (_root.moves + " / ") + _root.sm;
}
}
}
onClipEvent (keyDown) {
if (Key.isDown(17)) {
if (_root.playGame) {
_root.flag = 0;
_root.nextFrame();
}
}
}
Frame 3
_root.removeStage();
if (!flag) {
prevFrame();
} else {
stop();
}
Frame 4
_root.removeStage();
stop();
Symbol 11 MovieClip [ball] Frame 13
stop();
_root.balls--;
_root.myBall[this.py][this.px] = 2;
removeMovieClip(this);
Symbol 20 Button
on (press) {
getURL ("http://www.freestuff.gr/lightforce", "_blank");
}
Symbol 25 Button
on (press) {
play();
}
Symbol 26 MovieClip Frame 1
stop();
Symbol 26 MovieClip Frame 10
var stopCounter = 0;
var i = 0;
while (i < _root.mapHeight) {
var j = 0;
while (j < _root.mapWidth) {
var c = _root.myBall[i][j];
if (((((c == 3) or (c == 4)) or (c == 5)) or (c == 6)) or (c == 7)) {
if (_root[(("ball_" + i) + "_") + j].go == 0) {
stopCounter++;
}
}
j++;
}
i++;
}
if (stopCounter == _root.balls) {
_root.chardir = null;
var i = 0;
while (i < _root.mapHeight) {
var j = 0;
while (j < _root.mapWidth) {
var c = _root.myBall[i][j];
if ((c > 2) and (c < 7)) {
_root.findTile(i, j);
}
j++;
}
i++;
}
}
Symbol 26 MovieClip Frame 11
if (stopCounter == _root.balls) {
_root.playGame = 1;
_root.klik = 1;
}
Symbol 32 Button
on (release) {
if (_root.playing == 1) {
stopAllSounds();
playing = 0;
} else {
loop.start(0, 999);
playing = 1;
}
}
Symbol 40 Button
on (press, keyPress "<Space>") {
prevFrame();
}
Symbol 41 Button
on (press, keyPress "<Space>") {
gotoAndPlay (1);
}