Frame 1
System.useCodepage = true;
Frame 4
tb = getBytesTotal();
lb = getBytesLoaded();
v = int((lb / tb) * 100);
_root.preloader._xscale = v;
if (lb < tb) {
gotoAndPlay (2);
} else {
play();
}
Frame 6
stop();
Frame 12
function setLevelVars() {
if (level == 1) {
barSpeed = 0.4;
tileColors = 4;
}
if (level == 2) {
barSpeed = 0.4;
tileColors = 5;
}
if (level == 3) {
barSpeed = 0.5;
tileColors = 5;
}
if (level == 4) {
barSpeed = 0.6;
tileColors = 6;
}
if (level == 5) {
barSpeed = 0.7;
tileColors = 6;
}
if (level == 6) {
barSpeed = 0.7;
tileColors = 7;
}
if (level == 7) {
barSpeed = 0.7;
tileColors = 7;
}
if (level > 7) {
barSpeed = 0.8;
tileColors = 8;
}
}
function released() {
if (loaded == true) {
pushing = true;
loaded = false;
pushedAt = lastUp;
var _local1 = 0;
_local1 = 11;
while (_local1 > lastUp) {
t1_mc = game_mc["leftTile_" + _local1];
t2_mc = game_mc["rightTile_" + _local1];
t1a_mc = game_mc["leftTile_" + (_local1 - 1)];
t2a_mc = game_mc["rightTile_" + (_local1 - 1)];
t1_mc.gotoAndStop(t1a_mc._currentframe);
t2_mc.gotoAndStop(t2a_mc._currentframe);
t1_mc._visible = t1a_mc._visible;
t2_mc._visible = t2a_mc._visible;
_local1--;
}
t1_mc = game_mc["leftTile_" + pushedAt];
t2_mc = game_mc["rightTile_" + pushedAt];
t1_mc._visible = false;
t2_mc._visible = false;
}
scoreFactor = 1;
}
function resetAllTilesPosition() {
var _local1 = 0;
_local1 = 0;
while (_local1 < 12) {
t1_mc = game_mc["leftTile_" + _local1];
t2_mc = game_mc["rightTile_" + _local1];
t1_mc._y = t1_mc.y;
t2_mc._y = t2_mc.y;
_local1++;
}
}
function setAllTilesPosition(newUp) {
var _local2 = newUp;
var _local1 = 0;
_local1 = _local2;
while (_local1 < 12) {
t1_mc = game_mc["leftTile_" + _local1];
t2_mc = game_mc["rightTile_" + _local1];
t1_mc._y = t1_mc.y - 10;
t2_mc._y = t2_mc.y - 10;
_local1++;
}
}
function GameOver() {
game_mc.removeMovieClip();
gotoAndStop ("title");
}
function NextLevel() {
level++;
setLevelVars();
removedTiles = 0;
loadTile();
}
function loadTile() {
var _local1 = game_mc.leftTile_11;
var _local2 = game_mc.rightTile_11;
if ((_local1._visible == true) || (_local2._visible == true)) {
GameOver_mc._visible = true;
} else if (removedTiles >= 35) {
LevelCleared_mc._visible = true;
} else {
game_mc.control_mc.tile1_mc._x = game_mc.control_mc.tile1_mc.x;
game_mc.control_mc.tile2_mc._x = game_mc.control_mc.tile2_mc.x;
tile1 = tile1_mc._currentframe;
tile2 = tile2_mc._currentframe;
if (game_mc._xmouse <= game_mc.meter_bar_mc._x) {
game_mc.control_mc.tile1_mc.gotoAndStop(tile1);
game_mc.control_mc.tile2_mc.gotoAndStop(tile2);
} else {
game_mc.control_mc.tile1_mc.gotoAndStop(tile2);
game_mc.control_mc.tile2_mc.gotoAndStop(tile1);
}
game_mc.meter_bar_mc._yscale = 0;
setNextTile();
game_mc.control_mc.tile1_mc._visible = true;
game_mc.control_mc.tile2_mc._visible = true;
game_mc.control_mc.gotoAndPlay(2);
}
}
function setNextTile() {
tile1_mc.gotoAndStop(random(tileColors) + 1);
tile2_mc.gotoAndStop(random(tileColors) + 1);
}
function pauseGame() {
GamePaused_mc._visible = true;
paused = true;
}
function unpause() {
GamePaused_mc._visible = false;
paused = false;
}
var i = 0;
var lastUp = null;
var pushing = false;
var stacking = false;
var pushedAt = 0;
var loaded = false;
var pushingInt = 0;
var cleaning2var = 0;
var tile1 = 0;
var tile2 = 0;
var score = 0;
var level = 1;
var scoreFactor = 1;
var removedTiles = 0;
var barSpeed = 0.4;
var tileColors = 4;
var paused = false;
LevelCleared_mc._visible = false;
GameOver_mc._visible = false;
GamePaused_mc._visible = false;
setLevelVars();
game_mc.control_mc.tile1_mc.x = game_mc.control_mc.tile1_mc._x;
game_mc.control_mc.tile2_mc.x = game_mc.control_mc.tile2_mc._x;
setNextTile();
loadTile();
i = 0;
while (i < 12) {
var leftTile_mc = game_mc.attachMovie("tile_mc", "leftTile_" + i, 112 + i);
var ruler_mc = game_mc.attachMovie("ruler_mc", "ruler_" + i, 50 + i);
ruler_mc._x = 0;
ruler_mc._y = -(i * (leftTile_mc._height + 2));
ruler_mc._visible = true;
leftTile_mc._x = 0;
leftTile_mc._y = -(i * (leftTile_mc._height + 2));
leftTile_mc._visible = false;
leftTile_mc.y = leftTile_mc._y;
leftTile_mc.gotoAndStop(1);
leftTile.marked = false;
var rightTile_mc = game_mc.attachMovie("tile_mc", "rightTile_" + i, 100 + i);
var ruler_mc = game_mc.attachMovie("ruler_mc", "ruler2_" + i, 65 + i);
ruler_mc._x = 293;
ruler_mc._y = -(i * (leftTile_mc._height + 2));
ruler_mc._visible = true;
rightTile_mc._x = 248;
rightTile_mc._y = -(i * (rightTile_mc._height + 2));
rightTile_mc._visible = false;
rightTile_mc.y = rightTile_mc._y;
rightTile_mc.gotoAndStop(1);
rightTile.marked = false;
i++;
}
resetAllTilesPosition();
game_mc.onMouseDown = function () {
if (game_mc.hitTest(_xmouse, _ymouse, true)) {
if (GamePaused_mc._visible == false) {
released();
}
}
};
game_mc.onEnterFrame = function () {
if (paused == true) {
} else {
var txtScoreValue = Number(txtScore.text);
dx = score - txtScoreValue;
if (dx > 0) {
txtScore.text = txtScoreValue + 1;
}
if (dx < 0) {
txtScore.text = txtScoreValue - 1;
}
txtLevel.text = level;
if (loaded == true) {
if (game_mc._xmouse <= game_mc.meter_bar_mc._x) {
game_mc.control_mc.tile1_mc.gotoAndStop(tile1);
game_mc.control_mc.tile2_mc.gotoAndStop(tile2);
} else {
game_mc.control_mc.tile1_mc.gotoAndStop(tile2);
game_mc.control_mc.tile2_mc.gotoAndStop(tile1);
}
var _local3 = int(game_mc._ymouse / 27);
if (_local3 < -11) {
_local3 = -11;
}
if (_local3 > 0) {
_local3 = 0;
}
_local3 = Math.abs(_local3);
game_mc.control_mc._y = (-_local3) * 27;
if (lastUp != _local3) {
lastUp = _local3;
resetAllTilesPosition();
setAllTilesPosition(lastUp);
}
game_mc.meter_bar_mc._yscale = game_mc.meter_bar_mc._yscale + barSpeed;
if (game_mc.meter_bar_mc._yscale >= 100) {
released();
}
}
if (cleaning == true) {
var _local2 = false;
var _local1 = 0;
_local1 = 1;
while (_local1 < 11) {
t1_mc = game_mc["leftTile_" + _local1];
t2_mc = game_mc["rightTile_" + _local1];
t1a_mc = game_mc["leftTile_" + (_local1 - 1)];
t2a_mc = game_mc["rightTile_" + (_local1 - 1)];
t1b_mc = game_mc["leftTile_" + (_local1 + 1)];
t2b_mc = game_mc["rightTile_" + (_local1 + 1)];
if (((t1_mc._visible == true) && (t1a_mc._visible == true)) && (t1b_mc._visible == true)) {
if ((t1_mc._currentframe == t1a_mc._currentframe) && (t1_mc._currentframe == t1b_mc._currentframe)) {
t1_mc.marked = (t1a_mc.marked = (t1b_mc.marked = true));
_local2 = true;
}
}
if (((t2_mc._visible == true) && (t2a_mc._visible == true)) && (t2b_mc._visible == true)) {
if ((t2_mc._currentframe == t2a_mc._currentframe) && (t2_mc._currentframe == t2b_mc._currentframe)) {
t2_mc.marked = (t2a_mc.marked = (t2b_mc.marked = true));
_local2 = true;
}
}
_local1++;
}
_local1 = 0;
while (_local1 < 12) {
t1_mc = game_mc["leftTile_" + _local1];
t2_mc = game_mc["rightTile_" + _local1];
if (t1_mc.marked == true) {
score = score + (5 * scoreFactor);
scoreFactor++;
removedTiles++;
}
if (t2_mc.marked == true) {
score = score + (5 * scoreFactor);
scoreFactor++;
removedTiles++;
}
_local1++;
}
if (_local2 == true) {
cleaning = false;
cleaning2var = 0;
cleaning2 = true;
} else {
cleaning = false;
loadTile();
}
}
if (cleaning2 == true) {
var _local1 = 0;
while (_local1 < 12) {
t1_mc = game_mc["leftTile_" + _local1];
t2_mc = game_mc["rightTile_" + _local1];
if (t1_mc.marked == true) {
if (cleaning2var <= 10) {
t1_mc._alpha = 100 - (cleaning2var * 1);
} else {
t1_mc.marked = false;
t1_mc._visible = false;
t1_mc._alpha = 100;
}
}
if (t2_mc.marked == true) {
if (cleaning2var <= 10) {
t2_mc._alpha = 100 - (cleaning2var * 10);
} else {
t2_mc.marked = false;
t2_mc._visible = false;
t2_mc._alpha = 100;
}
}
_local1++;
}
if (cleaning2var <= 10) {
cleaning2var++;
} else {
cleaning2 = false;
stacking = true;
}
}
if (stacking == true) {
var _local2 = false;
var _local1 = 0;
_local1 = 1;
while (_local1 < 12) {
t1_mc = game_mc["leftTile_" + _local1];
t2_mc = game_mc["rightTile_" + _local1];
t1a_mc = game_mc["leftTile_" + (_local1 - 1)];
t2a_mc = game_mc["rightTile_" + (_local1 - 1)];
if ((t1_mc._visible == true) && (t1a_mc._visible == false)) {
t1a_mc.gotoAndStop(t1_mc._currentframe);
t1_mc._visible = false;
t1a_mc._visible = true;
_local2 = true;
}
if ((t2_mc._visible == true) && (t2a_mc._visible == false)) {
t2a_mc.gotoAndStop(t2_mc._currentframe);
t2_mc._visible = false;
t2a_mc._visible = true;
_local2 = true;
}
_local1++;
}
if (_local2 == false) {
stacking = false;
cleaning = true;
}
}
if (pushing == true) {
if (pushingInt < 5) {
game_mc.control_mc.tile1_mc._x = game_mc.control_mc.tile1_mc._x - 15;
game_mc.control_mc.tile2_mc._x = game_mc.control_mc.tile2_mc._x + 15;
pushingInt++;
} else {
pushingInt = 0;
pushing = false;
game_mc.control_mc.tile1_mc._visible = false;
game_mc.control_mc.tile2_mc._visible = false;
t1_mc = game_mc["leftTile_" + pushedAt];
t2_mc = game_mc["rightTile_" + pushedAt];
t1_mc._visible = true;
t2_mc._visible = true;
t1_mc.gotoAndStop(game_mc.control_mc.tile1_mc._currentframe);
t2_mc.gotoAndStop(game_mc.control_mc.tile2_mc._currentframe);
stacking = true;
}
}
}
};
stop();
Symbol 39 Button
on (release) {
play();
}
Symbol 44 Button
on (release) {
getURL ("http://www.quickflashgames.com/", "_blank");
}
Symbol 48 MovieClip Frame 1
stop();
Symbol 48 MovieClip Frame 21
stop();
_parent._parent.loaded = true;
Symbol 55 Button
on (release) {
pauseGame();
}
Symbol 68 Button
on (release) {
this._visible = false;
_parent.NextLevel();
}
Symbol 71 Button
on (release) {
this._visible = false;
_parent.GameOver();
}
Symbol 75 Button
on (release) {
_parent.unpause();
}