Frame 1
play();
Instance of Symbol 11 MovieClip "progress" in Frame 1
onClipEvent (enterFrame) {
percentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
gotoAndStop(percentLoaded);
if ((percentLoaded >= 100) and (_parent.scriptpath ne "none")) {
_parent.gotoAndStop("ready");
}
}
Frame 2
stop();
Frame 5
stop();
Frame 6
function newLevel() {
gameStatus = "PLAY";
if (gameLevel < 5) {
gameLevel++;
}
setupLevel();
gotoAndPlay ("newLevel");
}
function setupLevel() {
shotScore = 0;
combLevel = 0;
combThreshold = 132;
levelTime = 0;
lastComb = 48 + (gameLevel * 12);
plungerY = -134;
plunger._y = plungerY;
shooter._rotation = 0;
i = 1;
while (200 >= i) {
linkCheck[i] = 0;
combBackup[i] = 0;
if (lastComb >= i) {
comb[i] = 1 + random(5);
} else {
comb[i] = 0;
}
row = rowCalc(i);
col = colCalc(i, row);
if (evenRow[row] == 0) {
eval ("comb" + i)._x = 45 + ((col - 1) * 30);
} else {
eval ("comb" + i)._x = 60 + ((col - 1) * 30);
if (col == 12) {
comb[i] = 0;
}
}
eval ("comb" + i)._y = 26 + ((row - 1) * 26);
eval ("comb" + i).gotoAndStop(comb[i] + 1);
i++;
}
i = 1;
while (200 >= i) {
combBackup[i] = 0;
i++;
}
shooterRot = 0;
nextShootComb = 1 + random(5);
combLoader.gotoAndStop("drop" + nextShootComb);
dropper.gotoAndPlay(2);
}
function testConnection(blockTest, index, rowTest, colTest, rowEven, combType) {
combBackup[blockTest] = comb[blockTest];
comb[blockTest] = 0;
k = 0;
while (5 >= k) {
if (rowEven == 1) {
blockNext = blockTest + evenNeighbour[k];
} else {
blockNext = blockTest + oddNeighbour[k];
}
if (((k == 0) or (k == 2)) or (k == 4)) {
if ((((1 < colTest) or (((colTest == 1) and (rowEven == 1)) and (0 < k))) and (0 < blockNext)) and (comb[blockNext] == combType)) {
connectionCount++;
rowNext = rowCalc(blockNext);
colNext = colCalc(blockNext, rowNext);
testConnection(blockNext, k, rowNext, colNext, evenRow[rowNext], combType);
}
} else if (((colTest < 12) and (0 < blockNext)) and (comb[blockNext] == combType)) {
connectionCount++;
rowNext = rowCalc(blockNext);
colNext = colCalc(blockNext, rowNext);
testConnection(blockNext, k, rowNext, colNext, evenRow[rowNext], combType);
}
k++;
}
k = index;
}
function rowCalc(block) {
row = int((block - 1) / 12) + 1;
return(row);
}
function colCalc(block, row) {
col = block - ((row - 1) * 12);
return(col);
}
function startShot() {
angle = (Math.PI/180) * Math.abs(shooterRot);
shootCombYoffset = 80 * Math.cos(angle);
shootCombXoffset = 80 * Math.sin(angle);
shootCombY = 396 - shootCombYoffset;
if (shooterRot < 0) {
shootCombX = 206 - shootCombXoffset;
shootX = shootCombXoffset / -4;
} else {
shootCombX = 206 + shootCombXoffset;
shootX = shootCombXoffset / 4;
}
shootY = shootCombYoffset / -4;
shootCombMC.gotoAndStop(shootComb + 1);
shootCombMC._x = shootCombX;
shootCombMC._y = shootCombY;
gotoAndPlay ("shoot");
}
function combCollision() {
blockRest = 0;
if ((shootCombY - plungerY) < 160) {
blockTemp = int((shootCombX - 45) / 30) + 1;
if (comb[blockTemp] == 0) {
blockRest = blockTemp;
} else if (comb[blockTemp + 1] == 0) {
blockRest = blockTemp + 1;
} else {
blockRest = blockTemp - 1;
}
} else {
i = 1;
while (200 >= i) {
combTest = "comb" + i;
dX = shootCombX - eval (combTest)._x;
dY = shootCombY - eval (combTest)._y;
if (((((0 < comb[i]) and (-20 < dX)) and (dX < 20)) and (0 < dY)) and (dY < 25)) {
testRow = rowCalc(i);
testCol = colCalc(i, testRow);
if (dX < 0) {
if (evenRow[testRow] == 0) {
if (comb[i + 11] == 0) {
blockRest = i + 11;
} else if ((1 < testCol) and (comb[i - 1] == 0)) {
blockRest = i - 1;
} else {
blockRest = i + 12;
}
} else if (comb[i + 12] == 0) {
blockRest = i + 12;
} else if ((1 < testCol) and (comb[i - 1] == 0)) {
blockRest = i - 1;
} else {
blockRest = i + 13;
}
} else if (evenRow[testRow] == 0) {
if (comb[i + 12] == 0) {
blockRest = i + 12;
} else if ((testCol < 12) and (comb[i + 1] == 0)) {
blockRest = i + 1;
} else {
blockRest = i + 11;
}
} else if (comb[i + 13] == 0) {
blockRest = i + 13;
} else if ((testCol < 12) and (comb[i + 1] == 0)) {
blockRest = i + 1;
} else {
blockRest = i + 12;
}
combRow = rowCalc(blockRest);
combCol = colCalc(blockRest, combRow);
if ((evenRow[combRow] == 1) and (combCol == 12)) {
combCol = 11;
blockRest--;
}
i = 200;
}
i++;
}
}
return(blockRest);
}
function callConnection(block) {
connectionCount = 0;
row = rowCalc(block);
col = colCalc(block, row);
testConnection(block, 0, row, col, evenRow[row], comb[block]);
if (connectionCount < 2) {
i = 1;
while (200 >= i) {
if (0 < combBackup[i]) {
comb[i] = combBackup[i];
}
i++;
}
} else {
shotScore = 6;
i = 2;
while (connectionCount >= i) {
shotScore = shotScore + (i * 2);
i++;
}
score = score + shotScore;
i = 1;
while (200 >= i) {
if (0 < combBackup[i]) {
eval ("comb" + i).gotoAndPlay("die" + combBackup[i]);
}
i++;
}
callLinks();
}
i = 1;
while (200 >= i) {
combBackup[i] = 0;
i++;
}
}
function moveLevel() {
combLevel++;
combThreshold = combThreshold - 12;
plungerY = plungerY + 26;
plunger._y = plungerY;
i = 1;
while (200 >= i) {
row = rowCalc(i);
eval ("comb" + i)._y = ((combLevel * 26) + 26) + ((row - 1) * 26);
i++;
}
checkThreshold();
}
function checkThreshold() {
lastComb = 0;
i = 200;
while (i >= 1) {
if (0 < comb[i]) {
lastComb = i;
i = 0;
}
i--;
}
if (combThreshold < lastComb) {
gameStatus = "LOSE";
} else if (lastComb == 0) {
gameStatus = "WIN";
}
}
function callLinks() {
gap = 1;
i = 1;
while (12 >= i) {
if (comb[i] == 0) {
gap = 1;
} else if (gap == 1) {
gap = 0;
testLinks(i, 0, 1, i, 0);
}
i++;
}
dropCount = 0;
i = 1;
while (200 >= i) {
if ((0 < comb[i]) and (linkCheck[i] == 0)) {
eval ("comb" + i).gotoAndPlay("drop" + comb[i]);
comb[i] = 0;
dropCount++;
}
linkCheck[i] = 0;
i++;
}
if (0 < dropCount) {
shotScore = 0;
i = 1;
while (dropCount >= i) {
shotScore = shotScore + (i * 10);
i++;
}
score = score + shotScore;
}
}
function testLinks(blockTest, index, rowTest, colTest, rowEven) {
linkCheck[blockTest] = 1;
k = 0;
while (5 >= k) {
if (rowEven == 1) {
blockNext = blockTest + evenNeighbour[k];
} else {
blockNext = blockTest + oddNeighbour[k];
}
if (((k == 0) or (k == 2)) or (k == 4)) {
if (((((1 < colTest) or (((colTest == 1) and (rowEven == 1)) and (0 < k))) and (0 < blockNext)) and (0 < comb[blockNext])) and (linkCheck[blockNext] == 0)) {
rowNext = rowCalc(blockNext);
colNext = colCalc(blockNext, rowNext);
testLinks(blockNext, k, rowNext, colNext, evenRow[rowNext]);
}
} else if ((((colTest < 12) and (0 < blockNext)) and (0 < comb[blockNext])) and (linkCheck[blockNext] == 0)) {
rowNext = rowCalc(blockNext);
colNext = colCalc(blockNext, rowNext);
testLinks(blockNext, k, rowNext, colNext, evenRow[rowNext]);
}
k++;
}
k = index;
}
function countTypes() {
i = 1;
while (5 >= i) {
combTypeCount[i] = 0;
i++;
}
i = 1;
while (lastComb >= i) {
combType = comb[i];
if (0 < combType) {
combTypeCount[combType]++;
}
i++;
}
}
gameStatus = "PLAY";
score = 0;
gameLevel = 0;
combTypeCount = new Array(0, 0, 0, 0, 0, 0);
linkCheck = new Array();
evenRow = new Array(0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0);
evenNeighbour = new Array(-1, 1, -12, -11, 12, 13);
oddNeighbour = new Array(-1, 1, -13, -12, 11, 12);
comb = new Array();
combBackup = new Array();
i = 1;
while (200 >= i) {
duplicateMovieClip ("comb", "comb" + i, 10 + i);
i++;
}
shooter._rotation = 0;
shooterSFX = new Sound("shooter");
shooterSFX.attachSound("shooterSFX");
shooterSFX.setVolume(50);
setupLevel();
play();
Instance of Symbol 59 MovieClip "waterlevel" in Frame 6
onClipEvent (enterFrame) {
if (_parent.gameStatus eq "PLAY") {
if (_parent.levelTime < 100) {
_parent.levelTime = _parent.levelTime + 0.1;
gotoAndStop(int(_parent.levelTime) + 1 +5);
} else {
_parent.levelTime = 0;
_parent.moveLevel();
}
}
}
Frame 7
play();
Frame 10
shooterFX = 0;
if (gameStatus eq "PLAY") {
combLoader.gotoAndPlay("load" + nextShootComb);
shootComb = nextShootComb;
countTypes();
check = 0;
do {
temp = 1 + random(5);
if (0 < combTypeCount[temp]) {
check = 1;
}
} while (check == 0);
nextShootComb = temp;
stop();
} else if (gameStatus eq "LOSE") {
gotoAndPlay ("gameover");
}
Frame 11
if (gameStatus eq "PLAY") {
shooter.gotoAndStop(1);
shooter.comb.gotoAndStop(shootComb + 1);
play();
} else if (gameStatus eq "LOSE") {
gotoAndPlay ("gameover");
}
Frame 12
if (gameStatus eq "PLAY") {
play();
} else if (gameStatus eq "LOSE") {
gotoAndPlay ("gameover");
}
Frame 13
if (Key.isDown(37)) {
if (shooterFX == 0) {
shooterSFX.start(0, 1000);
shooterFX = 1;
}
if (-70 < shooterRot) {
shooterRot = shooterRot - 3;
}
shooter._rotation = shooterRot;
if (1 < loopy._currentframe) {
loopy.prevFrame();
} else {
loopy.gotoAndStop(12);
}
prevFrame();
} else if (Key.isDown(39)) {
if (shooterFX == 0) {
shooterSFX.start(0, 1000);
shooterFX = 1;
}
if (shooterRot < 70) {
shooterRot = shooterRot + 3;
}
shooter._rotation = shooterRot;
if (loopy._currentframe < 12) {
loopy.nextFrame();
} else {
loopy.gotoAndStop(1);
}
prevFrame();
} else if (shooterFX == 1) {
shooterSFX.stop();
shooterFX = 0;
}
if (Key.isDown(38)) {
shooterSFX.stop();
shooter.nextFrame();
stop();
} else {
prevFrame();
}
Frame 15
play();
Frame 16
shootCombX = shootCombX + shootX;
shootCombY = shootCombY + shootY;
if (shootCombX < 55) {
shootCombMC._x = 55;
shootX = shootX * -1;
} else if (375 < shootCombX) {
shootCombMC._x = 375;
shootX = shootX * -1;
} else {
shootCombMC._x = shootCombX;
}
shootCombMC._y = shootCombY;
hitBlock = combCollision();
if (hitBlock == 0) {
prevFrame();
} else {
eval ("comb" + hitBlock).gotoAndStop(shootComb + 1);
shootCombMC.gotoAndStop(1);
comb[hitBlock] = shootComb;
callConnection(hitBlock);
checkThreshold();
if (gameStatus eq "PLAY") {
gotoAndPlay ("newComb");
} else if (gameStatus eq "LOSE") {
gotoAndPlay ("gameover");
} else if (gameStatus eq "WIN") {
gotoAndPlay ("levelWin");
}
}
Frame 20
stop();
Frame 25
i = 1;
play();
Frame 26
play();
Frame 27
if (0 < comb[i]) {
eval ("comb" + i).gotoAndPlay("lose");
}
if (i < lastComb) {
i++;
prevFrame();
} else {
nextFrame();
}
Frame 28
stop();
Symbol 11 MovieClip Frame 1
stop();
Symbol 13 Button
on (keyPress "d") {
nextFrame();
}
Symbol 22 Button
on (keyPress "d") {
prevFrame();
}
Symbol 23 MovieClip Frame 1
stop();
Symbol 49 Button
on (release) {
gotoAndStop (6);
}
Symbol 55 MovieClip Frame 1
stop();
Symbol 55 MovieClip Frame 4
stop();
Symbol 55 MovieClip Frame 5
play();
Symbol 55 MovieClip Frame 7
stop();
Symbol 55 MovieClip Frame 8
play();
Symbol 55 MovieClip Frame 10
_parent.nextFrame();
_parent.dropper.gotoAndPlay(2);
gotoAndStop("drop" + _parent.nextShootComb);
Symbol 55 MovieClip Frame 19
stop();
Symbol 55 MovieClip Frame 20
play();
Symbol 55 MovieClip Frame 22
stop();
Symbol 55 MovieClip Frame 23
play();
Symbol 55 MovieClip Frame 25
_parent.nextFrame();
_parent.dropper.gotoAndPlay(2);
gotoAndStop("drop" + _parent.nextShootComb);
Symbol 55 MovieClip Frame 28
stop();
Symbol 55 MovieClip Frame 29
play();
Symbol 55 MovieClip Frame 31
stop();
Symbol 55 MovieClip Frame 32
play();
Symbol 55 MovieClip Frame 34
_parent.nextFrame();
_parent.dropper.gotoAndPlay(2);
gotoAndStop("drop" + _parent.nextShootComb);
Symbol 55 MovieClip Frame 37
stop();
Symbol 55 MovieClip Frame 38
play();
Symbol 55 MovieClip Frame 40
stop();
Symbol 55 MovieClip Frame 41
play();
Symbol 55 MovieClip Frame 43
_parent.nextFrame();
_parent.dropper.gotoAndPlay(2);
gotoAndStop("drop" + _parent.nextShootComb);
Symbol 55 MovieClip Frame 47
stop();
Symbol 55 MovieClip Frame 48
play();
Symbol 55 MovieClip Frame 50
stop();
Symbol 55 MovieClip Frame 51
play();
Symbol 55 MovieClip Frame 53
_parent.nextFrame();
_parent.dropper.gotoAndPlay(2);
gotoAndStop("drop" + _parent.nextShootComb);
Symbol 59 MovieClip Frame 1
stop();
Symbol 62 MovieClip Frame 1
stop();
Symbol 62 MovieClip Frame 2
play();
Symbol 62 MovieClip Frame 10
_parent.combLoader.nextFrame();
gotoAndStop (1);
Symbol 69 MovieClip Frame 1
stop();
Symbol 69 MovieClip Frame 10
play();
Symbol 69 MovieClip Frame 18
stop();
Symbol 69 MovieClip Frame 20
play();
Symbol 69 MovieClip Frame 29
gotoAndStop (1);
Symbol 69 MovieClip Frame 30
play();
Symbol 69 MovieClip Frame 39
gotoAndStop (1);
Symbol 69 MovieClip Frame 40
play();
Symbol 69 MovieClip Frame 49
gotoAndStop (1);
Symbol 69 MovieClip Frame 50
play();
Symbol 69 MovieClip Frame 59
gotoAndStop (1);
Symbol 69 MovieClip Frame 60
play();
Symbol 69 MovieClip Frame 69
gotoAndStop (1);
Symbol 69 MovieClip Frame 75
play();
Symbol 69 MovieClip Frame 84
gotoAndStop (1);
Symbol 69 MovieClip Frame 85
play();
Symbol 69 MovieClip Frame 94
gotoAndStop (1);
Symbol 69 MovieClip Frame 95
play();
Symbol 69 MovieClip Frame 104
gotoAndStop (1);
Symbol 69 MovieClip Frame 105
play();
Symbol 69 MovieClip Frame 114
gotoAndStop (1);
Symbol 69 MovieClip Frame 115
play();
Symbol 69 MovieClip Frame 124
gotoAndStop (1);
Symbol 71 MovieClip Frame 1
stop();
Symbol 71 MovieClip Frame 2
comb.gotoAndStop(_parent.shootComb + 1);
play();
Symbol 71 MovieClip Frame 3
comb.gotoAndStop(_parent.shootComb + 1);
Symbol 71 MovieClip Frame 4
_parent.startShot();
Symbol 71 MovieClip Frame 6
stop();
Symbol 79 MovieClip Frame 1
if (random(2) == 0) {
nextFrame();
} else {
stop();
}
Symbol 85 Button
on (release, keyPress "<Space>") {
newLevel();
}
Symbol 88 Button
on (release, keyPress "<Space>") {
gotoAndPlay (6);
}