Frame 1
layout0 = "000222000000222000000222000222222222222212222222222222000222000000222000000222000";
layout1 = "002222200022222220222222222222222222222212222222222222222222222022222220002222200";
layout2 = "222222222222222222221222122222222222222212222222222222221222122222222222222222222";
layout3 = "111111111112212211122222221122222221112212211122222221122222221112212211111111111";
layout4 = "222000222222202222222222222022222220002212200022222220222222222222202222222000222";
done = "true";
Game_active = false;
Instance of Symbol 32 MovieClip in Frame 1
onClipEvent (enterFrame) {
if (-2100 < this._x) {
this._x--;
this._x--;
} else {
this._x = 555;
}
}
Frame 2
loadMovieNum ("3mS44lI.swf", 4);
stop();
Frame 3
prevFrame();
Frame 4
prevFrame();
Frame 6
Frame 7
play();
if (done == "true") {
gotoAndPlay (9);
}
Frame 8
prevFrame();
Frame 9
function set_board() {
Score = 0;
i = 0;
y = 0;
while (y < 9) {
x = 0;
while (x < 9) {
newname = ["SPRITE" + i];
duplicateMovieClip ("SPRITE", newname, 99 + i);
Board[x][y] = newname;
SpriteX[i] = x;
SpriteY[i] = y;
Type = Number(_level0["layout" + Level].substr(i, 1));
Sprites[x][y] = Type;
var _local1 = 1;
switch (Type) {
case _local1 :
_level0[newname].gotoAndStop(2);
break;
case 2 :
Score = Score + 1;
_level0[newname].gotoAndStop(3);
}
i++;
x++;
}
y++;
}
}
function draw_board() {
xoffset = 186;
yoffset = 38;
inc = 40;
i = 0;
y = 0;
while (y < 9) {
x = 0;
while (x < 9) {
clip = "SPRITE" + i;
_level0[clip]._x = (x * inc) + xoffset;
_level0[clip]._y = (y * inc) + yoffset;
i++;
x++;
}
y++;
}
}
Frame 12
Game_active = false;
Level = 0;
Clicked1 = null;
Clicked2 = null;
Clicked1_old = null;
Score = 0;
Board = new Array();
Board = [[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
Sprites = new Array();
Sprites = [[0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]];
SpriteX = new Array();
SpriteY = new Array();
Frame 18
removeMovieClip("MESSAGE");
set_board();
draw_board();
Frame 19
stop();
Instance of Symbol 65 MovieClip "MESSAGE" in Frame 19
onClipEvent (load) {
this.swapDepths(3000);
}
Frame 23
prevFrame();
Frame 24
removeMovieClip("MESSAGE");
Game_active = true;
Frame 26
Game_active = true;
Frame 30
stop();
Frame 31
prevFrame();
Frame 32
Marble = Clicked1.substr(6, 2);
Space = Clicked2.substr(6, 2);
sourceX = SpriteX[Marble];
sourceY = SpriteY[Marble];
destX = SpriteX[Space];
destY = SpriteY[Space];
diffX = sourceX - destX;
diffY = sourceY - destY;
if (((((diffX == 0) and (diffY == 2)) or ((diffX == 0) and (diffY == -2))) or ((diffY == 0) and (diffX == 2))) or ((diffY == 0) and (diffX == -2))) {
diffX = diffX / 2;
diffY = diffY / 2;
if (Sprites[destX + diffX][destY + diffY] == 2) {
gotoAndPlay (36);
}
}
Frame 34
gotoAndPlay (29);
Frame 36
clip = Board[sourceX][sourceY];
_level0[clip].gotoAndStop(2);
Clicked1_old = null;
Clicked1 = null;
Sprites[sourceX][sourceY] = 1;
clip = Board[destX][destY];
_level0[clip].gotoAndStop(3);
Sprites[destX][destY] = 2;
clip = Board[destX + diffX][destY + diffY];
_level0[clip].gotoAndStop(2);
Sprites[destX + diffX][destY + diffY] = 1;
Score = Score - 1;
i = 0;
y = 0;
while (y < 9) {
x = 0;
while (x < 9) {
if (Sprites[x][y] == 2) {
if (Sprites[x + 1][y] == 2) {
if (Sprites[x + 2][y] == 1) {
gotoAndPlay (29);
}
if (Sprites[x - 1][y] == 1) {
gotoAndPlay (29);
}
}
}
if (Sprites[x][y] == 2) {
if (Sprites[x][y + 1] == 2) {
if (Sprites[x][y + 2] == 1) {
gotoAndPlay (29);
}
if (Sprites[x][y - 1] == 1) {
gotoAndPlay (29);
}
}
}
i++;
x++;
}
y++;
}
Frame 38
Game_active = false;
if (score == 1) {
gotoAndPlay (41);
}
stop();
Instance of Symbol 82 MovieClip "MESSAGE" in Frame 38
onClipEvent (load) {
this.swapDepths(3000);
}
Frame 39
removeMovieClip("MESSAGE");
gotoAndPlay (18);
Frame 41
stop();
Instance of Symbol 86 MovieClip "MESSAGE" in Frame 41
onClipEvent (load) {
this.swapDepths(3002);
}
Frame 42
removeMovieClip("MESSAGE");
gotoAndPlay (18);
Frame 45
Game_active = false;
stop();
Instance of Symbol 94 MovieClip "MESSAGE" in Frame 45
onClipEvent (load) {
this.swapDepths(3000);
}
Frame 46
removeMovieClip("MESSAGE");
gotoAndPlay (26);
Symbol 20 Button
on (press) {
if (_parent.Game_active) {
_parent.clicked2 = this._name;
_parent.gotoAndPlay("Played");
}
}
Symbol 27 Button
on (press) {
if (_parent.Game_active) {
_parent.clicked1_old = _parent.clicked1;
_parent.clicked1 = this._name;
if (_parent.clicked1 != _parent.clicked1_old) {
clip = _parent.clicked1_old;
_level0[clip].gotoAndStop(3);
}
_parent.gotoAndPlay("Chosen");
this.gotoAndStop(4);
}
}
Symbol 29 MovieClip Frame 1
stop();
Symbol 29 MovieClip Frame 2
stop();
Symbol 29 MovieClip Frame 3
stop();
Symbol 29 MovieClip Frame 4
stop();
Symbol 34 Button
on (release) {
getURL ("http://www.lilgames.com/store.shtml", "_top");
}
Symbol 41 Button
on (release) {
if (Level < 4) {
Level = Level + 1;
set_board();
draw_board();
}
}
Symbol 47 Button
on (release) {
if (0 < Level) {
Level = Level - 1;
set_board();
draw_board();
}
}
Symbol 55 Button
on (release) {
if (Game_Active == true) {
gotoAndPlay (45);
} else {
gotoAndPlay (24);
}
}
Symbol 58 Button
on (release) {
getURL ("http://www.sporeproductions.com", "_blank");
}
Symbol 61 Button
on (release) {
getURL ("http://www.lilgames.com", "_self");
}
Symbol 65 MovieClip Frame 66
gotoAndPlay (6);
Symbol 66 Button
on (release) {
if (Game_Active == true) {
gotoAndPlay (45);
}
}
Symbol 67 Button
on (release) {
if (Game_Active == true) {
gotoAndPlay (45);
}
}
Symbol 73 Button
on (release) {
gotoAndPlay (45);
}
Symbol 74 Button
on (release) {
if (Game_Active == true) {
gotoAndPlay (45);
} else {
gotoAndPlay (5);
}
}
Symbol 77 Button
on (release) {
if (Game_Active == true) {
gotoAndPlay (45);
} else {
gotoAndPlay (18);
}
}
Symbol 86 MovieClip Frame 71
gotoAndPlay (3);
Symbol 91 Button
on (release) {
_parent.gotoAndPlay("Setup");
}
Symbol 93 Button
on (release) {
_parent.play();
}
Symbol 94 MovieClip Frame 25
stop();