Frame 1
stop();
_global.startMusic = false;
_global.instruct = false;
_global.flip = new Sound();
flip.attachSound("flip1");
flip.setVolume(60);
_global.newLevel = new Sound();
newLevel.attachSound("newLevel1");
newLevel.setVolume(60);
_global.timeB = new Sound();
timeB.attachSound("bonus1");
timeB.setVolume(100);
_global.halfway = new Sound();
halfway.attachSound("bonus2");
halfway.setVolume(100);
_global.explosion = new Sound();
explosion.attachSound("explosion1");
explosion.setVolume(100);
_global.glass = new Sound();
glass.attachSound("glass1");
glass.setVolume(80);
_global.music = new Sound();
music.attachSound("song");
music.setVolume(20);
Frame 2
_global.level = 1;
_global.totalSq = 0;
_global.num = 1;
_global.score = 0;
_global.timeLimit = 700;
_global.screwUps = 0;
_global.unBreakable = 0;
_global.chance = 0;
_global.chanceBomb = 2;
_global.enterHS = false;
_global.stateArray = new Array();
_global.first = true;
blackSq._alpha = 0;
if (startMusic == false) {
music.start("", 1000000);
}
widthArray = new Array();
numWidthArray = new Array();
widthArray[1] = 98;
numWidthArray[1] = 6;
widthArray[2] = 73;
numWidthArray[2] = 8;
widthArray[3] = 58;
numWidthArray[3] = 10;
Instance of Symbol 68 MovieClip "square" in Frame 2
onClipEvent (load) {
function setState(sNum) {
if (stateArray[sNum] == 4) {
stateArray[sNum] = 6;
}
if (stateArray[sNum] == 3) {
_global.unBreakable--;
}
if (stateArray[sNum] == 2) {
_global.screwUps--;
}
if ((stateArray[sNum] != 0) && (stateArray[sNum] != 6)) {
stateArray[sNum] = 5;
}
}
function calculateExplosion(thisNum) {
totalNum = rowNum * rowNum;
i = 1;
testLeft = thisNum - 1;
if (((testLeft % rowNum) != 0) && (thisNum != 1)) {
left = testLeft;
} else {
left = -1;
}
if (((testLeft + 1) % rowNum) != 0) {
right = testLeft + 2;
} else {
right = -1;
}
if (((testLeft + 1) - rowNum) > -1) {
up = (testLeft + 1) - rowNum;
} else {
up = -1;
}
if (((testLeft + 1) + rowNum) < (totalNum + 1)) {
down = (testLeft + 1) + rowNum;
} else {
down = -1;
}
stateArray[thisNum] = 0;
while ((i < total) && (i < 8)) {
if ((left != -1) && ((left % rowNum) != 0)) {
setState(left);
i++;
left--;
}
if ((right != -1) && ((right % rowNum) != 0)) {
setState(right);
i++;
right++;
}
if ((up != -1) && ((up - rowNum) > -1)) {
setState(up);
i++;
up = up - rowNum;
}
if ((down != -1) && ((down + rowNum) < (totalNum + 1))) {
setState(down);
i++;
down = down + rowNum;
}
}
}
wait = 0;
num = this._name.substring(6);
check = random(100);
wasZero = false;
localState = stateArray[num];
if (localState == 2) {
gotoAndStop (25);
} else if (localState == 3) {
gotoAndStop (26);
} else if (localState == 7) {
gotoAndPlay (27);
stateArray[num] = 1;
} else if (check < 85) {
stateArray[num] = 1;
} else if (check > (100 - chanceBomb)) {
gotoAndStop (88);
stateArray[num] = 4;
} else {
gotoAndStop (15);
_global.counter++;
wasZero = true;
stateArray[num] = 0;
}
}
on (rollOver) {
up = stateArray[num];
if (up != 3) {
if (up == 1) {
block.gotoAndStop(1);
gotoAndPlay (2);
flip.start(0, 1);
stateArray[num] = 0;
if (wasZero == false) {
_global.score = _global.score + 1;
wasZero = true;
}
_global.counter++;
} else if (up == 0) {
block.gotoAndStop(1);
gotoAndPlay (16);
stateArray[num] = 1;
badluck = random(100);
if (badluck <= chance) {
if (badluck < 2) {
gotoAndStop (88);
stateArray[num] = 4;
} else {
gotoAndPlay (27);
}
}
_global.counter--;
} else if (up == 2) {
block.gotoAndStop(1);
gotoAndStop (1);
flip.start(0, 1);
stateArray[num] = 1;
_global.screwUps--;
_global.score = _global.score + 1;
} else if (up == 4) {
_root.levelMov.gotoAndPlay(21);
gotoAndPlay (89);
_global.counter++;
calculateExplosion(num);
}
}
}
onClipEvent (enterFrame) {
if (stateArray[num] == 5) {
block.gotoAndPlay(2);
_global.counter++;
if (wasZero == false) {
_global.score = _global.score + 1;
wasZero = true;
}
stateArray[num] = 0;
} else if (stateArray[num] == 6) {
if (wait > 1) {
gotoAndPlay (89);
_global.counter++;
calculateExplosion(num);
wait = 0;
} else {
wait++;
}
}
}
Frame 3
_global.counter = 0;
_global.timer = 0;
_global.state = 0;
_global.numSquares = 1;
_global.fifty = false;
_global.done = false;
_global.lose = false;
sqWidth = widthArray[num];
sqHeight = widthArray[num];
_global.rowNum = numWidthArray[num];
_global.colNum = numWidthArray[num];
_global.totalSq = rowNum * colNum;
_global.total = (rowNum + rowNum) - 1;
var col = 1;
while (col <= colNum) {
var row = 1;
while (row <= rowNum) {
s = square.duplicateMovieClip("square" + numSquares, (col * 100) + row);
if ((stateArray[numSquares] != 0) && (stateArray[numSquares] != null)) {
if (stateArray[numSquares] == 2) {
stateArray[numSquares] = 3;
_global.unBreakable++;
} else if (stateArray[numSquares] == 3) {
stateArray[numSquares] = 3;
} else {
stateArray[numSquares] = 2;
_global.screwUps++;
}
} else if (level > 1) {
chance = random(100);
numToBeat = math.floor(level - (level * 0.8));
if (numToBeat > 4) {
numToBeat = 4;
}
if (chance < numToBeat) {
stateArray[numSquares] = 7;
}
} else {
stateArray[numSquares] = 0;
}
s._width = sqWidth;
s._height = sqHeight;
s._y = ((sqHeight + 2) * col) - sqHeight;
s._x = ((sqWidth + 2) * row) - sqWidth;
_global.numSquares++;
row++;
}
col++;
}
_global.first = false;
Frame 4
scoreMov.scoreText.text = score;
if ((counter >= (totalSq * 0.75)) && (fifty == false)) {
title.gotoAndPlay(2);
halfway.start("", 1);
_global.fifty = true;
} else if (((counter + unBreakable) == totalSq) || (timer >= timeLimit)) {
_global.level++;
levelMov.gotoAndPlay(2);
i = 1;
while (i <= (rowNum * colNum)) {
var s = ("square" + i);
removeMovieClip(s);
_global.numSquares--;
i++;
}
if (timer != timeLimit) {
newLevel.start("", 1);
if (unBreakable == 0) {
_global.score = _global.score + (math.ceil((((timeLimit - timer) / timeLimit) * 50) * level) + (50 * level));
timeB.start("", 1);
scoreMov.play(2);
}
} else if (fifty == false) {
_global.lose = true;
} else {
newLevel.start("", 1);
}
if (level < 10) {
_global.num = 1;
_global.timeLimit = _global.timeLimit - 25;
} else if ((level > 9) && (level < 20)) {
if (level == 10) {
_global.chanceBomb++;
_global.chance = 5;
_global.timeLimit = _global.timeLimit + 200;
} else {
_global.chance++;
_global.timeLimit = _global.timeLimit - 25;
}
_global.num = 2;
} else if ((level > 19) && (level < 30)) {
if (level == 20) {
_global.chanceBomb++;
_global.chance = 10;
_global.timeLimit = _global.timeLimit + 200;
} else {
_global.chance++;
_global.timeLimit = _global.timeLimit - 25;
}
newScrewUps = (random(10) + level) - 15;
if (newScrewUps > 30) {
newScrewUps = 30;
}
_global.screwUps = _global.screwUps + newScrewUps;
_global.num = 3;
} else {
_global.chanceBomb = 6;
if (level > 40) {
_global.chanceBomb = 2;
}
newScrewUps = (random(10) + level) - 15;
if (newScrewUps > 30) {
newScrewUps = 30;
}
_global.screwUps = _global.screwUps + newScrewUps;
if (timeLimit > 1000) {
_global.timeLimit = _global.timeLimit - 25;
} else if ((timeLimit < 1000) && (timeLimit > 600)) {
_global.timeLimit = _global.timeLimit - 10;
}
if (chance < 40) {
_global.chance++;
}
_global.num = 3;
}
if (lose == false) {
if (((level < 11) && ((level % 5) == 0)) || ((level % 10) == 0)) {
levelTxt.duplicateMovieClip("levelTxt1", 13000);
levelTxt1._x = 300;
levelTxt1._y = 650;
feedBackMov.gotoAndPlay(2);
stop();
} else {
_global.done = true;
feedBackMov.gotoAndPlay(2);
stop();
}
} else {
_global.done = true;
feedBackMov.gotoAndPlay(2);
stop();
}
}
_global.timer++;
scale = ((timeLimit - timer) / timeLimit) * 177.2;
if (scale > 0) {
time._xscale = scale;
} else {
time._xscale = 0;
}
Frame 5
gotoAndPlay (4);
Frame 6
stop();
scoreText.text = score;
player = SharedObject.getLocal("player_profile");
i = 1;
while (i < 11) {
_root["score" + i] = player.data["score" + i];
_root["name" + i] = player.data["name" + i];
i++;
}
if ((score >= player.data.score10) && (enterHS == false)) {
highScore.gotoAndPlay(2);
} else {
highScore.gotoAndStop(1);
}
Frame 7
gotoAndPlay (6);
Symbol 9 MovieClip Frame 1
stop();
Symbol 14 Button
on (release) {
if (instruct == false) {
halfway.start("", 1);
instructionsMov.gotoAndPlay(2);
_global.instruct = true;
}
}
Symbol 17 Button
on (release) {
timeB.start("", 1);
gotoAndPlay (2);
}
Symbol 25 MovieClip Frame 1
stop();
Symbol 25 MovieClip Frame 19
stop();
Symbol 26 Button
on (release) {
if (instruct == false) {
instructionsMov.gotoAndPlay(2);
_global.instruct = true;
}
}
Symbol 27 Button
on (release) {
gotoAndPlay (2);
}
Symbol 33 MovieClip Frame 1
stop();
Symbol 33 MovieClip Frame 55
gotoAndStop (1);
Symbol 43 MovieClip Frame 1
stop();
scoreText.text = score;
Symbol 43 MovieClip Frame 40
gotoAndStop (1);
Symbol 48 MovieClip Frame 1
stop();
levelMov2.levelText.text = level;
Symbol 48 MovieClip Frame 2
levelMov.levelText.text = level - 1;
Symbol 48 MovieClip Frame 15
levelMov.levelText.text = level;
Symbol 48 MovieClip Frame 20
gotoAndStop (1);
Symbol 48 MovieClip Frame 38
gotoAndStop (1);
Symbol 49 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 35
_root.gotoAndPlay(2);
Symbol 52 MovieClip Frame 1
numFeedBack.text = math.floor((counter / totalSq) * 100) + "%";
Symbol 53 MovieClip Frame 1
stop();
Symbol 53 MovieClip Frame 2
_root.backG._alpha = 50;
Symbol 53 MovieClip Frame 28
_root.blackSq._alpha = 0;
if (done == true) {
if (lose == false) {
if ((level != 5) && ((level % 10) != 0)) {
_root.backG._alpha = 100;
_root.gotoAndPlay(3);
} else {
_root.backG._alpha = 50;
}
} else if (lose == true) {
_root.gotoAndPlay(6);
_root.backG._alpha = 100;
}
}
Symbol 65 MovieClip Frame 1
stop();
Symbol 65 MovieClip Frame 40
num = _parent._name.substring(6);
stateArray[num] = 0;
stop();
Symbol 67 MovieClip Frame 1
stop();
Symbol 67 MovieClip Frame 2
_parent.block.gotoAndPlay(2);
Symbol 67 MovieClip Frame 11
glass.start("", 1);
stop();
Symbol 68 MovieClip Frame 1
stop();
Symbol 68 MovieClip Frame 10
stop();
Symbol 68 MovieClip Frame 24
stop();
Symbol 68 MovieClip Frame 25
stop();
Symbol 68 MovieClip Frame 26
stop();
Symbol 68 MovieClip Frame 27
gotoAndPlay (28);
Symbol 68 MovieClip Frame 64
stop();
_global.screwUps++;
num = this._name.substring(6);
stateArray[num] = 2;
Symbol 68 MovieClip Frame 88
stop();
Symbol 68 MovieClip Frame 89
stop();
Instance of Symbol 67 MovieClip "bomb" in Symbol 68 MovieClip Frame 89
onClipEvent (load) {
played = 0;
}
onClipEvent (enterFrame) {
if (played == 0) {
this.gotoAndPlay(2);
explosion.start("", 1);
played = 1;
}
}
Symbol 68 MovieClip Frame 90
block.gotoAndPlay(2);
stop();
Symbol 71 MovieClip Frame 1
if (this._name == "accuracy") {
bonusText.bonus.text = "+Accuracy Bonus!";
} else if (this._name == "timeBonus") {
bonusText.bonus.text = "+Time Bonus!";
}
Symbol 71 MovieClip Frame 5
if (this._name == "accuracy") {
bonusText.bonus.text = "+Accuracy Bonus!";
} else if (this._name == "timeBonus") {
bonusText.bonus.text = "+Time Bonus!";
}
Symbol 71 MovieClip Frame 10
if (this._name == "accuracy") {
bonusText.bonus.text = "+Accuracy Bonus!";
} else if (this._name == "timeBonus") {
bonusText.bonus.text = "+Time Bonus!";
}
Symbol 71 MovieClip Frame 30
stop();
this.removeMovieClip();
Symbol 76 MovieClip Frame 1
if (this._name != "levelTxt") {
_root.backG._alpha = 50;
_global.start = true;
levelMov.levelB.text = "Level " + level;
}
Symbol 76 MovieClip Frame 52
if (this._name != "levelTxt") {
bonus = level * 50;
levelBonus.levelBonus.text = "+" + bonus;
}
Symbol 76 MovieClip Frame 105
if (this._name != "levelTxt") {
_global.score = _global.score + (level * 50);
_root.backG._alpha = 100;
_root.gotoAndPlay(3);
this.removeMovieClip();
}
stop();
Symbol 84 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 30
_root.gotoAndPlay(2);
Symbol 86 Button
on (press) {
_global.startMusic = true;
newLevel.start("", 1);
playAgain.gotoAndPlay(2);
}
Symbol 124 Button
on (release, keyPress "<Enter>") {
player = SharedObject.getLocal("player_profile");
i = 1;
while (i < 6) {
if (player.data["score" + i] == undefined) {
player.data["score" + i] = 0;
player.flush();
}
if (player.data["name" + i] == undefined) {
player.data["name" + i] = "";
player.flush();
}
i++;
}
i = 1;
while (i < 6) {
if (_root.score >= player.data["score" + i]) {
n = 6;
while (n > i) {
player.data["score" + n] = player.data["score" + (n - 1)];
player.data["name" + n] = player.data["name" + (n - 1)];
player.flush();
n--;
}
player.data["score" + i] = _root.score;
player.data["name" + i] = _root.name;
player.flush();
break;
}
i++;
}
i = 1;
while (i < 6) {
_root["score" + i] = player.data["score" + i];
_root["name" + i] = player.data["name" + i];
i++;
}
_root.gotoAndStop("done");
}
Symbol 126 Button
on (release, keyPress "<Enter>") {
player = SharedObject.getLocal("player_profile");
i = 1;
while (i < 11) {
if (player.data["score" + i] == undefined) {
player.data["score" + i] = 0;
player.flush();
}
if (player.data["score" + i] == 0) {
player.data["name" + i] = "Player";
player.flush();
}
i++;
}
i = 1;
while (i < 11) {
if (score >= player.data["score" + i]) {
n = 11;
while (n > i) {
player.data["score" + n] = player.data["score" + (n - 1)];
player.data["name" + n] = player.data["name" + (n - 1)];
player.flush();
n--;
}
player.data["score" + i] = score;
player.data["name" + i] = _root.name;
player.flush();
break;
}
i++;
}
i = 1;
while (i < 11) {
_root["score" + i] = player.data["score" + i];
_root["name" + i] = player.data["name" + i];
i++;
}
_global.enterHS = true;
gotoAndPlay (21);
}
Symbol 128 MovieClip Frame 20
stop();
Symbol 128 MovieClip Frame 40
_root.gotoAndPlay(7);