Instance of Symbol 3 MovieClip in Frame 1
onClipEvent (enterFrame) {
text = ((int(_parent.getBytesLoaded() / 1000) add " KBYTES OF ") add int(_parent.getBytesTotal() / 1000)) add " LOADED ...";
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;
t._y = y * 28;
c = int(random(4)) + 1;
t.col = c;
t.state = true;
t.gotoAndStop(c);
t.x = x;
t.y = y;
y++;
}
y = 0;
x++;
}
}
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);
tiles--;
sc++;
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);
}
}
if (tiles == 0) {
wellDone.gotoAndPlay(2);
}
}
playing = 1;
d = 0;
sc = 0;
score = 0;
tiles = 100;
resetTiles();
stop();
Instance of Symbol 11 MovieClip "tiles" in Frame 2
onClipEvent (load) {
if (this._name == "tiles") {
this.gotoAndStop(1);
}
}
Symbol 7 Button
on (press) {
_root.sc = 0;
_root.findTile(this.x, this.y);
_root.checkTile();
_root.addScore(this._x, this._y);
}
Symbol 18 Button
on (press) {
getURL ("http://www.freestuff.gr/lightforce", "_blank");
}
Symbol 24 MovieClip Frame 1
stop();
Symbol 24 MovieClip Frame 3
gotoAndStop (1);
Symbol 26 MovieClip Frame 1
Symbol 29 Button
on (release) {
if (_root.playing == 1) {
stopAllSounds();
loopSound.gotoAndStop("Stop");
playing = 0;
} else {
loopSound.gotoAndStop("Play");
playing = 1;
}
}
Symbol 34 Button
on (press) {
gotoAndPlay (1);
}
Symbol 53 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 99
stop();
Symbol 53 MovieClip Frame 136
stop();
Symbol 53 MovieClip Frame 170
stop();
Symbol 53 MovieClip Frame 205
stop();
Symbol 53 MovieClip Frame 240
stop();
Symbol 53 MovieClip Frame 275
stop();
Symbol 53 MovieClip Frame 310
stop();
Symbol 53 MovieClip Frame 345
stop();
Symbol 53 MovieClip Frame 380
stop();
Symbol 57 MovieClip Frame 1
stop();
Symbol 57 MovieClip Frame 16
stop();