Combined Code
frame 1 {
play();
}
movieClip 4 {
}
movieClip 5 {
}
movieClip 8 {
}
movieClip 11 {
}
movieClip 14 {
}
movieClip 17 {
}
movieClip 20 {
}
button 24 {
on (release) {
getURL('http://www.dailygames.com/', '_blank');
}
}
movieClip 26 {
}
movieClip 29 {
}
movieClip 32 {
}
movieClip 35 {
}
movieClip 37 {
}
movieClip 39 {
}
movieClip 41 {
}
button 43 {
on (release) {
getURL('http://www.candygameland.com', '_blank');
}
}
movieClip 47 {
}
movieClip 51 {
}
movieClip 55 {
}
movieClip 59 {
}
movieClip 63 {
}
movieClip 66 {
}
movieClip 70 {
}
movieClip 74 {
}
movieClip 78 {
}
movieClip 82 {
}
movieClip 84 {
frame 1 {
stop();
}
}
instance progress of movieClip 84 {
onClipEvent (enterFrame) {
percentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
gotoAndStop(percentLoaded);
if (0 != percentLoaded >= 100 & 0 != (_parent.scriptpath != 'none')) {
_parent.gotoAndStop('ready');
}
}
}
frame 2 {
stop();
}
frame 5 {
stop();
}
// unknown tag 88 length 99
button 92 {
on (release) {
gotoAndStop(6);
}
}
// unknown tag 88 length 143
movieClip 102 {
}
movieClip 103 {
}
button 110 {
on (release) {
getURL('http://www.candygameland.com', '_blank');
}
}
// unknown tag 88 length 65
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 (0 != (0 != (k == 0) | 0 != (k == 2)) | 0 != (k == 4)) {
if (0 != (0 != (0 != 1 < colTest | 0 != (0 != (0 != (colTest == 1) & 0 != (rowEven == 1)) & 0 != 0 < k)) & 0 != 0 < blockNext) & 0 != (comb[blockNext] == combType)) {
++connectionCount;
rowNext = rowCalc(blockNext);
colNext = colCalc(blockNext, rowNext);
testConnection(blockNext, k, rowNext, colNext, evenRow[rowNext], combType);
}
} else {
if (0 != (0 != colTest < 12 & 0 != 0 < blockNext) & 0 != (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 = 0.0174533 * 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;
}
}
return blockRest;
}
i = 1;
while (200 >= i) {
combTest = 'comb' + i;
dX = shootCombX - (eval(combTest))._x;
dY = shootCombY - (eval(combTest))._y;
if (0 != (0 != (0 != (0 != 0 < comb[i] & 0 != -20 < dX) & 0 != dX < 20) & 0 != 0 < dY) & 0 != 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 (0 != 1 < testCol & 0 != (comb[i - 1] == 0)) {
blockRest = i - 1;
} else {
blockRest = i + 12;
}
}
} else {
if (comb[i + 12] == 0) {
blockRest = i + 12;
} else {
if (0 != 1 < testCol & 0 != (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 (0 != testCol < 12 & 0 != (comb[i + 1] == 0)) {
blockRest = i + 1;
} else {
blockRest = i + 11;
}
}
} else {
if (comb[i + 13] == 0) {
blockRest = i + 13;
} else {
if (0 != testCol < 12 & 0 != (comb[i + 1] == 0)) {
blockRest = i + 1;
} else {
blockRest = i + 12;
}
}
}
}
combRow = rowCalc(blockRest);
combCol = colCalc(blockRest, combRow);
if (0 != (evenRow[combRow] == 1) & 0 != (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 += i * 2;
++i;
}
score += shotScore;
i = 1;
while (200 >= i) {
if (0 < combBackup[i]) {
(eval('comb' + i)).gotoAndPlay('die' + combBackup[i]);
}
++i;
}
callLinks();
}
i = 1;
for (;;) {
if (200 < i) {
return undefined;
}
combBackup[i] = 0;
++i;
}
}
function moveLevel() {
++combLevel;
combThreshold -= 12;
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';
return undefined;
}
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 != 0 < comb[i] & 0 != (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 += i * 10;
++i;
}
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 (0 != (0 != (k == 0) | 0 != (k == 2)) | 0 != (k == 4)) {
if (0 != (0 != (0 != (0 != 1 < colTest | 0 != (0 != (0 != (colTest == 1) & 0 != (rowEven == 1)) & 0 != 0 < k)) & 0 != 0 < blockNext) & 0 != 0 < comb[blockNext]) & 0 != (linkCheck[blockNext] == 0)) {
rowNext = rowCalc(blockNext);
colNext = colCalc(blockNext, rowNext);
testLinks(blockNext, k, rowNext, colNext, evenRow[rowNext]);
}
} else {
if (0 != (0 != (0 != colTest < 12 & 0 != 0 < blockNext) & 0 != 0 < comb[blockNext]) & 0 != (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;
for (;;) {
if (lastComb < i) {
return undefined;
}
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, 16384 + (10 + i));
++i;
}
shooter._rotation = 0;
shooterSFX = new Sound('shooter');
shooterSFX.attachSound('shooterSFX');
shooterSFX.setVolume(50);
setupLevel();
play();
}
movieClip 116 {
}
movieClip 120 {
}
movieClip 123 {
}
movieClip 126 {
}
movieClip 129 {
}
movieClip 131 {
}
movieClip 133 {
}
movieClip 134 {
}
movieClip 136 {
}
movieClip 138 {
}
movieClip 143 {
}
movieClip 146 {
}
movieClip 150 {
}
movieClip 153 {
}
movieClip 155 {
frame 1 {
stop();
}
frame 4 {
stop();
}
frame 5 {
play();
}
frame 7 {
stop();
}
frame 8 {
play();
}
frame 10 {
_parent.nextFrame();
_parent.dropper.gotoAndPlay(2);
gotoAndStop('drop' + _parent.nextShootComb);
}
frame 19 {
stop();
}
frame 20 {
play();
}
frame 22 {
stop();
}
frame 23 {
play();
}
frame 25 {
_parent.nextFrame();
_parent.dropper.gotoAndPlay(2);
gotoAndStop('drop' + _parent.nextShootComb);
}
frame 28 {
stop();
}
frame 29 {
play();
}
frame 31 {
stop();
}
frame 32 {
play();
}
frame 34 {
_parent.nextFrame();
_parent.dropper.gotoAndPlay(2);
gotoAndStop('drop' + _parent.nextShootComb);
}
frame 37 {
stop();
}
frame 38 {
play();
}
frame 40 {
stop();
}
frame 41 {
play();
}
frame 43 {
_parent.nextFrame();
_parent.dropper.gotoAndPlay(2);
gotoAndStop('drop' + _parent.nextShootComb);
}
frame 47 {
stop();
}
frame 48 {
play();
}
frame 50 {
stop();
}
frame 51 {
play();
}
frame 53 {
_parent.nextFrame();
_parent.dropper.gotoAndPlay(2);
gotoAndStop('drop' + _parent.nextShootComb);
}
}
movieClip 159 {
frame 1 {
stop();
}
}
instance waterlevel of movieClip 159 {
onClipEvent (enterFrame) {
if (_parent.gameStatus == 'PLAY') {
if (_parent.levelTime < 100) {
_parent.levelTime += 0.1;
gotoAndStop(int(_parent.levelTime) + 1);
} else {
_parent.levelTime = 0;
_parent.moveLevel();
}
}
}
}
movieClip 162 {
}
movieClip 164 {
}
movieClip 166 {
}
movieClip 168 {
}
movieClip 170 {
frame 1 {
stop();
}
frame 2 {
play();
}
frame 10 {
_parent.combLoader.nextFrame();
gotoAndStop(1);
}
}
movieClip 173 {
}
movieClip 174 {
}
movieClip 175 {
}
movieClip 176 {
}
movieClip 177 {
}
movieClip 181 {
frame 1 {
stop();
}
frame 10 {
play();
}
frame 18 {
stop();
}
frame 20 {
play();
}
frame 29 {
gotoAndStop(1);
}
frame 30 {
play();
}
frame 39 {
gotoAndStop(1);
}
frame 40 {
play();
}
frame 49 {
gotoAndStop(1);
}
frame 50 {
play();
}
frame 59 {
gotoAndStop(1);
}
frame 60 {
play();
}
frame 69 {
gotoAndStop(1);
}
frame 75 {
play();
}
frame 84 {
gotoAndStop(1);
}
frame 85 {
play();
}
frame 94 {
gotoAndStop(1);
}
frame 95 {
play();
}
frame 104 {
gotoAndStop(1);
}
frame 105 {
play();
}
frame 114 {
gotoAndStop(1);
}
frame 115 {
play();
}
frame 124 {
gotoAndStop(1);
}
}
movieClip 186 {
frame 1 {
stop();
}
frame 2 {
comb.gotoAndStop(_parent.shootComb + 1);
play();
}
frame 3 {
comb.gotoAndStop(_parent.shootComb + 1);
}
frame 4 {
_parent.startShot();
}
frame 6 {
stop();
}
}
// unknown tag 88 length 47
button 191 {
on (keyPress 'd') {
nextFrame();
}
}
// unknown tag 88 length 63
button 211 {
on (keyPress 'd') {
prevFrame();
}
}
movieClip 212 {
frame 1 {
stop();
}
}
frame 7 {
play();
}
frame 10 {
shooterFX = 0;
if (gameStatus == '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 == 'LOSE') {
gotoAndPlay('gameover');
}
}
}
frame 11 {
if (gameStatus == 'PLAY') {
shooter.gotoAndStop(1);
shooter.comb.gotoAndStop(shootComb + 1);
play();
} else {
if (gameStatus == 'LOSE') {
gotoAndPlay('gameover');
}
}
}
frame 12 {
if (gameStatus == 'PLAY') {
play();
} else {
if (gameStatus == 'LOSE') {
gotoAndPlay('gameover');
}
}
}
frame 13 {
if (Key.isDown(37)) {
if (shooterFX == 0) {
shooterSFX.start(0, 1000);
shooterFX = 1;
}
if (-70 < 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 += 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 += shootX;
shootCombY += shootY;
if (shootCombX < 55) {
shootCombMC._x = 55;
shootX *= -1;
} else {
if (375 < shootCombX) {
shootCombMC._x = 375;
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 == 'PLAY') {
gotoAndPlay('newComb');
} else {
if (gameStatus == 'LOSE') {
gotoAndPlay('gameover');
} else {
if (gameStatus == 'WIN') {
gotoAndPlay('levelWin');
}
}
}
}
}
frame 20 {
stop();
}
button 215 {
on (release, keyPress '<Space>') {
newLevel();
}
}
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();
}
button 219 {
on (release, keyPress '<Space>') {
gotoAndPlay(6);
}
}
button 222 {
on (release) {
getURL('http://www.candygameland.com', '_blank');
}
}