Instance of Symbol 5 MovieClip in Frame 1
onClipEvent (enterFrame) {
text = (int(_parent.getBytesLoaded() / 1000) add " OF ") add int(_parent.getBytesTotal() / 1000);
if (_parent.getBytesTotal() == _parent.getBytesLoaded()) {
_parent.gotoAndStop(2);
}
}
Frame 2
function resetTiles() {
var _local1 = this;
x = 0;
y = 0;
while (x < 10) {
while (y < 10) {
duplicateMovieClip ("tiles", (("t" + x) + "_") + y, ++d);
t = _local1[(("t" + x) + "_") + y];
t._x = (x * 28) + 20;
t._y = y * 28;
if (y > 5) {
c = int(random(4)) + 1;
t.col = c;
t.state = true;
t.gotoAndStop(c);
t.x = x;
t.y = y;
} else {
c = 0;
t.col = c;
t.gotoAndStop(5);
t.x = x;
t.y = y;
}
y++;
}
y = 0;
x++;
}
timerID = setInterval(goTime, tc);
}
function findTile(x, y) {
var _local1 = y;
var _local2 = x;
var _local3 = _root;
col = _local3[(("t" + _local2) + "_") + _local1].col;
if ((((_local3[(("t" + (_local2 - 1)) + "_") + _local1].col == col) or (_local3[(("t" + (_local2 + 1)) + "_") + _local1].col == col)) or (_local3[(("t" + _local2) + "_") + (_local1 - 1)].col == col)) or (_local3[(("t" + _local2) + "_") + (_local1 + 1)].col == col)) {
_local3[(("t" + _local2) + "_") + _local1].state = false;
_local3[(("t" + _local2) + "_") + _local1].gotoAndStop(5);
sc++;
tile++;
if (tile == 20) {
setLevel();
tile = 0;
}
if ((_local3[(("t" + (_local2 - 1)) + "_") + _local1].col == col) and (_local3[(("t" + (_local2 - 1)) + "_") + _local1].state == true)) {
findTile(_local2 - 1, _local1);
}
if ((_local3[(("t" + (_local2 + 1)) + "_") + _local1].col == col) and (_local3[(("t" + (_local2 + 1)) + "_") + _local1].state == true)) {
findTile(_local2 + 1, _local1);
}
if ((_local3[(("t" + _local2) + "_") + (_local1 - 1)].col == col) and (_local3[(("t" + _local2) + "_") + (_local1 - 1)].state == true)) {
findTile(_local2, _local1 - 1);
}
if ((_local3[(("t" + _local2) + "_") + (_local1 + 1)].col == col) and (_local3[(("t" + _local2) + "_") + (_local1 + 1)].state == true)) {
findTile(_local2, _local1 + 1);
}
_local3[(("t" + _local2) + "_") + _local1].col = 0;
}
}
function checkTile() {
var _local1 = _root;
x = 0;
y = 0;
while (x < 10) {
while (y < 9) {
if ((_local1[(("t" + x) + "_") + (y + 1)].col == 0) and (_local1[(("t" + x) + "_") + y].col != 0)) {
replaceColors(x, y);
checkTile();
}
y++;
}
y = 0;
x++;
}
}
function replaceColors(px, py) {
var _local1 = py;
var _local2 = px;
var _local3 = _root;
c = _local3[(("t" + _local2) + "_") + _local1].col;
_local3[(("t" + _local2) + "_") + (_local1 + 1)].col = c;
_local3[(("t" + _local2) + "_") + (_local1 + 1)].state = true;
_local3[(("t" + _local2) + "_") + (_local1 + 1)].gotoAndStop(c);
_local3[(("t" + _local2) + "_") + _local1].state = false;
_local3[(("t" + _local2) + "_") + _local1].col = 0;
_local3[(("t" + _local2) + "_") + _local1].gotoAndStop(5);
}
function addScore(x, y) {
if (sc > 1) {
textClip.swapDepths(++d);
textClip._x = x;
textClip._y = y;
if (sc < 10) {
score = score + (sc * 100);
pos = sc * 35;
textClip.gotoAndPlay(pos);
clickSound.gotoAndPlay(2);
} else {
score = score + 2000;
textClip.gotoAndPlay(350);
clickSound.gotoAndPlay(5);
}
}
}
function setLevel() {
level++;
tc = 30 - level;
levelUp.gotoAndPlay(2);
}
fscommand ("allowscale", false);
goTime = function () {
var _local1 = _root;
timer--;
timerBar._height = timer;
if (timer < 1) {
x = 0;
while (x < 10) {
y = 1;
while (y < 10) {
c = _local1[(("t" + x) + "_") + y].col;
_local1[(("t" + x) + "_") + (y - 1)].col = c;
_local1[(("t" + x) + "_") + (y - 1)].state = true;
_local1[(("t" + x) + "_") + (y - 1)].gotoAndStop(c);
_local1[(("t" + x) + "_") + y].state = false;
_local1[(("t" + x) + "_") + y].col = 0;
_local1[(("t" + x) + "_") + y].gotoAndStop(5);
lineSound.gotoAndPlay(2);
y++;
}
if (_local1[(("t" + x) + "_") + 0].col != 0) {
gameOver = true;
}
x++;
}
y = 9;
x = 0;
while (x < 10) {
c = int(random(4)) + 1;
_local1[(("t" + x) + "_") + y].col = c;
_local1[(("t" + x) + "_") + y].state = true;
_local1[(("t" + x) + "_") + y].gotoAndStop(c);
x++;
}
if (gameOver == true) {
clearInterval(timerID);
x = 0;
while (x < 10) {
y = 0;
while (y < 10) {
removeMovieClip(_local1[(("t" + x) + "_") + y]);
gameOverClip.gotoAndPlay(2);
y++;
}
x++;
}
} else {
clearInterval(timerID);
timerBar._height = tm;
timer = tm;
timerID = setInterval(goTime, tc);
}
}
};
playing = 1;
level = 1;
tile = 0;
tc = 30;
d = 0;
sc = 0;
score = 0;
timer = (tm = 204);
gameOver = false;
resetTiles();
stop();
Instance of Symbol 21 MovieClip "tiles" in Frame 2
onClipEvent (load) {
if (this._name == "tiles") {
this.gotoAndStop(1);
}
}
Symbol 16 Button
on (press) {
_root.sc = 0;
_root.findTile(this.x, this.y);
_root.checkTile();
_root.addScore(this._x, this._y);
}
Symbol 27 MovieClip Frame 1
stop();
Symbol 27 MovieClip Frame 3
gotoAndStop (1);
Symbol 31 Button
on (release) {
if (_root.playing == 1) {
stopAllSounds();
loopSound.gotoAndStop("Stop");
playing = 0;
} else {
loopSound.gotoAndStop("Play");
playing = 1;
}
}
Symbol 51 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 99
stop();
Symbol 51 MovieClip Frame 136
stop();
Symbol 51 MovieClip Frame 170
stop();
Symbol 51 MovieClip Frame 205
stop();
Symbol 51 MovieClip Frame 240
stop();
Symbol 51 MovieClip Frame 275
stop();
Symbol 51 MovieClip Frame 310
stop();
Symbol 51 MovieClip Frame 345
stop();
Symbol 51 MovieClip Frame 380
stop();
Symbol 59 MovieClip Frame 1
stop();
Symbol 61 MovieClip Frame 1
Symbol 62 MovieClip Frame 1
stop();
Symbol 66 Button
on (press) {
getURL ("http://www.freestuff.gr/lightforce", "_blank");
}
Symbol 74 Button
on (press) {
_root.gotoAndPlay(1);
}
Symbol 75 MovieClip Frame 1
stop();
Symbol 75 MovieClip Frame 60
stop();