Frame 1
stop();
Frame 40
playButton.onPress = function () {
gotoAndStop ("game");
};
instructionsButton.onPress = function () {
gotoAndStop ("instructions");
};
stop();
Frame 49
playButton.onPress = function () {
gotoAndStop ("game");
};
Frame 69
oddNumber = function (number) {
var _local1 = number / 2;
_local1 = _local1.toString();
_local1 = _local1.indexOf(".");
if (_local1 == -1) {
return(false);
}
return(true);
};
distBetween = function (object1, object2) {
var _local2 = object1.xTemp;
var _local1 = object1.yTemp;
var _local4 = object2._x;
var _local3 = object2._y;
var _local5 = Math.sqrt(((_local2 - _local4) * (_local2 - _local4)) + ((_local1 - _local3) * (_local1 - _local3)));
return(_local5);
};
initDepthManager = function () {
depthManager = {};
depthManager.bubblesDepth = 10000;
depthManager.bubblesPopAnimeDepth = 20000;
depthManager.bubblesPopDepth = 30000;
depthManager.bonusDepth = 40000;
depthManager.bubblesTop = 1000;
depthManager.gridDepth = 500;
};
_root.createEmptyMovieClip("soundFX", -50000);
_root.createEmptyMovieClip("musicFX", -50001);
gigglyPopsSong = new Sound(musicFX);
gigglyPopsSong.attachSound("gigglypops");
gigglyPopsSong.setVolume(50);
gigglyPopsSong.start(0, 99999);
shootBubbleSound = new Sound(soundFX);
shootBubbleSound.attachSound("shootBubble");
pop = new Sound(soundFX);
pop.attachSound("pop");
noPop = new Sound(soundFX);
noPop.attachSound("noPop");
levelComplete = new Sound(soundFX);
levelComplete.attachSound("levelComplete");
chingSound = new Sound(soundFX);
chingSound.attachSound("KACHING");
i = 1;
while (i <= 12) {
_root["giggleSound" + i] = new Sound(soundFX);
if (i < 10) {
_root["giggleSound" + i].attachSound("giggle0" + i);
} else {
_root["giggleSound" + i].attachSound("giggle" + i);
}
i++;
}
playGiggle = function () {
var _local2 = random(12) + 1;
_root["giggleSound" + _local2].start();
};
getRowPoint = function (point) {
var _local1 = Math.floor((point - game.yOffSet) / game.rowSpace);
return(_local1);
};
getColumnPoint = function (point) {
var _local1 = Math.floor(point / game.columnSpace);
return(_local1);
};
getColumnPointOffset = function (point) {
var _local1 = Math.floor((point - (game.columnSpace / 2)) / game.columnSpace);
return(_local1);
};
levelProg = new Array([2, 2], [2, 3], [3, 3], [3, 4], [4, 4], [5, 4], [5, 5], [6, 5], [6, 6], [6, 7], [6, 8], [6, 9]);
buildArray = function () {
gameGrid = new Array();
i = 0;
while (i < game.rows) {
gameGrid[i] = new Array();
j = 0;
while (j < game.columns) {
gameGrid[i][j] = new Array();
gameGrid[i][j].type = 0;
gameGrid[i][j].id = -1;
gameGrid[i][j].colour = 0;
gameGrid[i][j].tagged = 0;
j++;
}
i++;
}
};
levelProg = new Array([3, 3, 6], [4, 4, 5], [4, 5, 4], [5, 5, 4], [5, 5, 4], [6, 5, 4], [6, 6, 4], [7, 6, 4], [7, 7, 4], [8, 7, 4], [8, 8, 4], [8, 9, 4], [8, 10, 4], [8, 10, 3], [8, 7, 2], [8, 8, 2], [8, 9, 2], [8, 10, 2]);
loadLevel = function () {
buildArray();
game.coinScore = 1000;
game.totalBubbles = 0;
game.explodeDepth = 0;
game.bonusCount = 0;
game.shotsTaken = 0;
game.yOffSet = 0;
game.path.basket._xscale = 100;
game.path.basket._yscale = 100;
game.path.basket.bucket1.gotoAndStop(1);
game.path.basket.bucket2.gotoAndStop(1);
if (game.colours >= game.maxColours) {
game.colours = game.maxColours;
}
game.level = game.level + 1;
game.colours = levelProg[game.level - 1][0];
var _local5 = levelProg[game.level - 1][1];
game.movesLeft = levelProg[game.level - 1][2];
game.startingMoves = levelProg[game.level - 1][2];
game.path.roof._y = game.yOffSet;
movesLeft = "MOVES " + game.movesLeft;
levelType = "LEVEL " + game.level;
i = 0;
while (i < _local5) {
var _local3 = oddNumber(i);
j = 0;
while (j < game.columns) {
var _local4 = random(3) + 1;
var _local2 = "bubble" + game.totalBubbles;
game.path.attachMovie("bubble", _local2, depthManager.bubblesDepth + game.totalBubbles);
var _local1 = game.path[_local2];
_local3 = oddNumber(i);
if (_local3 == true) {
_local1._x = (j * game.columnSpace) + game.columnSpace;
} else {
_local1._x = (j * game.columnSpace) + (game.columnSpace / 2);
}
_local1._y = (i * game.rowSpace) + (game.rowSpace / 2);
_local1.id = game.totalBubbles;
_local1.isReal = true;
_local1.colour = pickColour();
_local1.gotoAndStop(_local1.colour);
game.nextBubble = pickColour();
gameGrid[i][j].type = 1;
gameGrid[i][j].id = game.totalBubbles;
gameGrid[i][j].colour = _local1.colour;
gameGrid[i][j].tagged = 0;
game.totalBubbles = game.totalBubbles + 1;
j++;
}
i++;
}
createBubble();
levelTrans.gotoAndPlay("startLevel");
};
buildGrid = function () {
var _local3 = 0;
i = 0;
while (i < game.rows) {
var _local4 = oddNumber(i);
j = 0;
while (j < game.columns) {
var _local2 = "grid" + _local3;
game.path.attachMovie("gridSq", _local2, _local3 + depthManager.gridDepth);
var _local1 = game.path[_local2];
_local1._x = j * game.columnSpace;
if (_local4 == true) {
_local1._x = _local1._x + (_local1._width / 2);
}
_local1._y = i * game.rowSpace;
_local3 = _local3 + 1;
j++;
}
i++;
}
};
resetTags = function () {
i = 0;
while (i < game.rows) {
j = 0;
while (j < game.columns) {
gameGrid[i][j].tagged = 0;
j++;
}
i++;
}
};
pickColour = function () {
var _local2 = random(game.colours);
var _local1;
switch (_local2) {
case 0 :
_local1 = "green";
break;
case 1 :
_local1 = "red";
break;
case 2 :
_local1 = "blue";
break;
case 3 :
_local1 = "pink";
break;
case 4 :
_local1 = "white";
break;
case 5 :
_local1 = "orange";
break;
case 6 :
_local1 = "purple";
break;
case 7 :
_local1 = "yellow";
}
return(_local1);
};
checkGrid = function (row, column, colour) {
game.sameTypeCount = 1;
game.nextMoveCount = 0;
game.colourCheck = colour;
game.moveScore = 0;
game.bubbles2Check = new Array();
game.bubbles2Check[0] = new Array();
game.bubbles2Check[0][0] = row;
game.bubbles2Check[0][1] = column;
checkBubbles();
};
checkBubbles = function () {
if (game.colourCheck != "multi") {
i = 0;
while (i <= game.bubbles2Check.length) {
var _local7 = game.bubbles2Check[i][0];
var _local8 = game.bubbles2Check[i][1];
var _local9 = oddNumber(_local7);
if (_local9 == false) {
sqsToCheck = new Array([0, 1], [0, -1], [1, 0], [1, -1], [-1, 0], [-1, -1]);
} else {
sqsToCheck = new Array([0, 1], [0, -1], [1, 0], [1, 1], [-1, 0], [-1, 1]);
}
j = 0;
while (j <= 5) {
var _local5 = _local7 + sqsToCheck[j][0];
var _local4 = _local8 + sqsToCheck[j][1];
var _local1 = gameGrid[_local5][_local4];
if ((_local1.colour == game.colourCheck) && (_local1.tagged == 0)) {
game.sameTypeCount = game.sameTypeCount + 1;
_local1.tagged = 1;
game.bubbles2Check.push([_local5, _local4]);
}
j++;
}
i++;
}
} else {
game.multiArray = new Array();
var _local7 = game.bubbles2Check[0][0];
var _local8 = game.bubbles2Check[0][1];
var _local9 = oddNumber(_local7);
if (_local9 == false) {
sqsToCheck = new Array([0, 1], [0, -1], [1, 0], [1, -1], [-1, 0], [-1, -1]);
} else {
sqsToCheck = new Array([0, 1], [0, -1], [1, 0], [1, 1], [-1, 0], [-1, 1]);
}
j = 0;
while (j <= 5) {
var _local5 = _local7 + sqsToCheck[j][0];
var _local4 = _local8 + sqsToCheck[j][1];
var _local1 = gameGrid[_local5][_local4];
if (_local1.colour != 0) {
var _local3 = false;
i = 0;
while (i < game.multiArray.length) {
if (game.multiArray[i] == _local1.colour) {
_local3 = true;
}
i++;
}
if (_local3 == false) {
game.multiArray.push(_local1.colour);
}
}
j++;
}
i = 0;
while (i < game.rows) {
j = 0;
while (j < game.columns) {
var _local1 = gameGrid[i][j];
var _local2 = false;
k = 0;
while (k < game.multiArray.length) {
if (_local1.colour == game.multiArray[k]) {
_local2 = true;
}
k++;
}
if (_local2 == true) {
game.bubbles2Check.push([i, j]);
}
j++;
}
i++;
}
}
if ((game.sameTypeCount >= 3) || (game.colourCheck == "multi")) {
pop.start();
game.nextMoveCount = game.nextMoveCount + game.sameTypeCount;
game.moveScore = game.sameTypeCount * 10;
var _local10 = 0;
i = 0;
while (i < game.bubbles2Check.length) {
var _local1 = gameGrid[game.bubbles2Check[i][0]][game.bubbles2Check[i][1]];
var _local6 = random(100);
if (_local6 <= 30) {
createBonus(game.path["bubble" + _local1.id]._x, game.path["bubble" + _local1.id]._y);
}
game.path["bubble" + _local1.id].ymov = -1 - random(3);
game.path["bubble" + _local1.id].xmov = random(3) - random(3);
game.path["bubble" + _local1.id].swapDepths(game.path["bubble" + _local1.id].id + depthManager.bubblesPopDepth);
game.path["bubble" + _local1.id].critter.gotoAndPlay("pop");
_local1.type = 0;
_local1.id = -1;
_local1.colour = 0;
_local1.tagged = 0;
i++;
}
resetTags();
check4Float();
} else {
noPop.start();
checkMoves();
createBubble();
}
resetTags();
};
check4Float = function () {
i = 0;
while (i < game.columns) {
checkAndTag(0, i);
i++;
}
popDisconnected();
};
checkAndTag = function (row, column) {
var _local4 = new Array();
_local4[0] = new Array();
_local4[0][0] = row;
_local4[0][1] = column;
gameGrid[row][column].tagged = 1;
if (gameGrid[row][column].type == 0) {
return(undefined);
}
k = 0;
while (k <= _local4.length) {
row = _local4[k][0];
column = _local4[k][1];
var _local7 = oddNumber(row);
if (_local7 == false) {
sqsToCheck = new Array([0, 1], [0, -1], [1, 0], [1, -1], [-1, 0], [-1, -1]);
} else {
sqsToCheck = new Array([0, 1], [0, -1], [1, 0], [1, 1], [-1, 0], [-1, 1]);
}
j = 0;
while (j <= 5) {
var _local3 = row + sqsToCheck[j][0];
var _local2 = column + sqsToCheck[j][1];
var _local1 = gameGrid[_local3][_local2];
if ((_local1.type == 1) && (_local1.tagged == 0)) {
_local1.tagged = 1;
_local4.push([_local3, _local2]);
}
j++;
}
k++;
}
};
popDisconnected = function () {
i = 0;
while (i < game.rows) {
j = 0;
while (j < game.columns) {
var _local1 = gameGrid[i][j];
if ((_local1.type == 1) && (_local1.tagged == 0)) {
game.nextMoveCount = game.nextMoveCount + 1;
game.path["bubble" + _local1.id].ymov = -1 - random(3);
game.path["bubble" + _local1.id].xmov = random(4) - random(4);
game.path["bubble" + _local1.id].swapDepths(game.path["bubble" + _local1.id].id + depthManager.bubblesPopDepth);
game.path["bubble" + _local1.id].critter.gotoAndPlay("fall");
game.path["bubble" + _local1.id].onEnterFrame = popBubble;
game.path["bubble" + _local1.id].popped = true;
_local1.type = 0;
_local1.id = -1;
_local1.colour = 0;
_local1.tagged = 0;
}
j++;
}
i++;
}
game.moveScore = game.moveScore * ((game.nextMoveCount - game.sameTypeCount) + 1);
addScore(game.moveScore);
};
popBubble = function () {
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
this.xmov = this.xmov * 0.95;
this.ymov = this.ymov + game.gravity;
if (this._y > 400) {
game.nextMoveCount = game.nextMoveCount - 1;
if (game.nextMoveCount == 0) {
checkLevelCleared();
}
this.removeMovieClip();
}
};
checkLevelCleared = function () {
var _local2 = 0;
i = 0;
while (i < game.rows) {
j = 0;
while (j < game.columns) {
var _local1 = gameGrid[i][j];
if (_local1.type == 1) {
_local2 = _local2 + 1;
}
j++;
}
i++;
}
if (_local2 > 0) {
if (game.path.basket._currentframe != 1) {
game.path.basket.gotoAndPlay("close");
}
checkMoves();
createBubble();
} else {
levelComplete.start();
levelTrans.gotoAndPlay("levelCleared");
}
};
checkMoves = function () {
if (game.movesLeft == 0) {
moveDown();
}
};
moveDown = function () {
game.yOffSet = game.yOffSet + game.rowSpace;
game.movesLeft = game.startingMoves;
var _local1 = false;
i = 0;
while (i < game.totalBubbles) {
game.path["bubble" + i]._y = game.path["bubble" + i]._y + game.rowSpace;
if ((game.path["bubble" + i]._y > 312) && (game.path["bubble" + i].popped == false)) {
_local1 = true;
}
game.path.roof._y = game.yOffSet;
i++;
}
if (_local1 == true) {
gameOver();
}
};
moveUp = function () {
if (game.yOffSet <= 0) {
return(undefined);
}
game.yOffSet = game.yOffSet - game.rowSpace;
game.movesLeft = game.startingMoves;
var _local1 = false;
i = 0;
while (i < game.totalBubbles) {
game.path["bubble" + i]._y = game.path["bubble" + i]._y - game.rowSpace;
game.path.roof._y = game.yOffSet;
i++;
}
};
createBonus = function (xpos, ypos) {
var _local5 = 0;
if (game.yOffSet > 0) {
_local5 = 10;
}
var _local3 = Math.random() * (100 + _local5);
var _local2 = null;
if (_local3 <= 90) {
_local2 = "coin";
} else if (_local3 < 95) {
_local2 = "coin";
} else if (_local3 <= 100) {
_local2 = "moves";
} else if (_local3 <= 110) {
_local2 = "reverse";
}
var _local4 = "bonus" + game.bonusCount;
game.path.attachMovie("bonus", _local4, game.bonusCount + depthManager.bonusDepth);
var _local1 = game.path[_local4];
_local1.bonusType = _local2;
_local1.bonus.gotoAndStop(_local2);
_local1._x = xpos;
_local1._y = ypos;
_local1.xmove = random(13) - random(13);
_local1.ymove = Math.random() * 6;
_local1.onEnterFrame = bonusLoop;
game.bonusCount = game.bonusCount + 1;
game.nextMoveCount = game.nextMoveCount + 1;
game.path.basket.gotoAndPlay("open");
};
bonusLoop = function () {
this._x = this._x + this.xmove;
this._y = this._y - this.ymove;
this.xmove = this.xmove * 0.99;
this.ymove = this.ymove - 0.3;
var _local3 = (game.columnSpace * game.columns) + (this._width / 2);
if ((this._x - (this._width / 2)) < 0) {
this._x = 0 + (this._width / 2);
this.xmove = -this.xmove;
} else if ((this._x + (this._width / 2)) > _local3) {
this._x = _local3 - (this._width / 2);
this.xmove = -this.xmove;
}
if (this.hitTest(game.path.basket.trainTop)) {
this.ymove = -this.ymove;
}
if (this.hitTest(game.path.basket.hitZone1)) {
this.xmove = 0;
this.ymove = 0;
this.gotoAndPlay("showScore");
this.onEnterFrame = null;
game.path.basket.bucket1.nextFrame();
}
if (this.hitTest(game.path.basket.hitZone2)) {
this.xmove = 0;
this.ymove = 0;
this.gotoAndPlay("showScore");
this.onEnterFrame = null;
game.path.basket.bucket2.nextFrame();
}
if (this._y < 0) {
}
if (this._y > 400) {
game.nextMoveCount = game.nextMoveCount - 1;
if (game.nextMoveCount == 0) {
checkLevelCleared();
}
if (this.bonusType == "coin") {
_root.game.coinScore = 1000;
}
this.removeMovieClip();
this.onEnterFrame = null;
}
};
basketTimer = function () {
this.counter = this.counter - 1;
if (this.counter <= 0) {
this._xscale = 100;
this._yscale = 100;
delete this.onEnterFrame;
}
};
addCoin = function () {
_root.jar.coins = _root.jar.coins + 1;
var _local5 = "coin" + _root.jar.coins;
jar.attachMovie("goldCoin", _local5, 100000 - _root.jar.coins);
var _local4 = _root.jar[_local5];
_local4._yscale = 100 - random(30);
_local4.id = _root.jar.coins;
_local4.rotVal = random(45) - random(45);
_local4.gravity = 0.2;
_local4.ymov = random(5);
_local4.xmov = (Math.random() * 6) - (Math.random() * 6);
_local4.onEnterFrame = function () {
this.ymov = this.ymov + this.gravity;
this._x = this._x + this.xmov;
this._y = this._y + this.ymov;
this._rotation = this._rotation + this.rotVal;
this.xmov = this.xmov * 0.99;
if (this._x > 30) {
this._x = 30;
this.xmov = -this.xmov;
} else if (this._x < -30) {
this._x = -30;
this.xmov = Math.abs(this.xmov);
}
if (this._y > 115) {
this.ymov = -(this.ymov / 4);
this._y = 115;
if ((this.ymov < 0.1) && (this.ymov > -0.1)) {
this.xmov = 0;
this.ymov = 0;
this.onEnterFrame = null;
}
}
i = 1;
while (i <= _root.jar.coins) {
if (i != this.id) {
var _local3 = Math.random() * 100;
if ((((this.hitTest(_root.jar["coin" + i].hitZone) == true) && (_root.jar["coin" + i].xmov == 0)) && (_root.jar["coin" + i].ymov == 0)) && (_local3 <= 5)) {
this.ymov = -(this.ymov / 4);
if ((this.ymov < 0.1) && (this.ymov > -0.1)) {
this.xmov = 0;
this.ymov = 0;
this.onEnterFrame = null;
}
}
}
i++;
}
};
};
moveBubble = function () {
this.xTemp = this.xTemp + this.xv;
this.yTemp = this.yTemp + this.yv;
var _local19 = this.xTemp - 15;
var _local18 = this.xTemp;
var _local17 = (game.columnSpace * game.columns) + 15;
if (_local19 < 0) {
this.xTemp = 15;
this.xv = -this.xv;
}
if (_local18 > _local17) {
this.xTemp = _local17 - 15;
this.xv = -this.xv;
}
i = 0;
while (i <= game.totalBubbles) {
if ((i != this.id) && (game.path["bubble" + i].isReal == true)) {
var _local12 = distBetween(this, game.path["bubble" + i]);
if (_local12 < 29) {
var _local6 = this.xTemp;
var _local13 = this.yTemp;
var _local3 = getRowPoint(_local13);
var _local2 = getColumnPointOffset(_local6);
var _local11 = getRowPoint(game.path["bubble" + i]._y);
var _local10 = getColumnPoint(game.path["bubble" + i]._x);
var _local7 = oddNumber(_local3);
if (_local7 == true) {
_local2 = getColumnPointOffset(_local6);
} else {
_local2 = getColumnPoint(_local6);
if (_local2 >= 14) {
_local2 = 13;
}
}
var _local8 = _local2 - _local10;
var _local14 = _local3 - _local11;
if (_local8 == -2) {
_local2 = _local2 + 1;
}
if (_local8 == 2) {
_local2 = _local2 - 1;
}
if (_local14 == 2) {
_local3 = _local3 - 1;
}
if (gameGrid[_local3][_local2].type == 1) {
trace("------------bugged out---------------");
trace("row=" + _local3);
trace("column=" + _local2);
var _local4 = getRowPoint(this._y - this.yv);
trace("rowLM=" + _local4);
_local7 = oddNumber(_local4);
if (_local7 == true) {
var _local5 = getColumnPointOffset(this._x - (this.xv * 2));
} else {
var _local5 = getColumnPoint(this._x - (this.xv * 2));
if (_local5 >= 14) {
_local5 = 13;
}
}
trace("columnLM=" + _local5);
trace("oldType=" + gameGrid[_local4][_local5].type);
if (_local2 > _local5) {
var _local9 = _local2 - _local5;
if (_local9 > 1) {
var _local5 = _local2 - 1;
}
if (_local9 >= 2) {
trace("FIX SHITE HERE");
}
}
if (_local2 < _local5) {
var _local9 = _local4 - _local2;
if (_local9 > 1) {
var _local5 = _local2 + 1;
}
if (_local9 >= 2) {
trace("FIX SHITE HERE");
}
}
if ((_local4 - _local3) > 1) {
_local4 = _local3 + 1;
}
if (Math.abs(_local4 - _local3) >= 2) {
trace("FIX SHITE HERE 2");
}
if (_local3 < _local4) {
_local3 = _local4;
} else {
_local3 = _local4;
_local2 = _local5;
}
if (gameGrid[_local3][_local2].type == 1) {
if (game.path["bubble" + i]._x < this._x) {
_local2 = _local2 + 1;
}
if (game.path["bubble" + i]._x > this._x) {
_local2 = _local2 - 1;
}
}
}
this.yTemp = ((_local3 * game.rowSpace) + (game.rowSpace / 2)) + game.yOffSet;
if (_local7 == true) {
this.xTemp = (_local2 * game.columnSpace) + game.columnSpace;
} else {
this.xTemp = (_local2 * game.columnSpace) + (game.columnSpace / 2);
}
gameGrid[_local3][_local2].type = 1;
gameGrid[_local3][_local2].colour = this.colour;
gameGrid[_local3][_local2].id = this.id;
gameGrid[_local3][_local2].tagged = 1;
delete this.onEnterFrame;
this._x = this.xTemp;
this._y = this.yTemp;
if (this._y > 312) {
gameOver();
return(undefined);
}
checkGrid(_local3, _local2, this.colour);
return(undefined);
}
}
i++;
}
var _local20 = this.yTemp - 14;
if (_local20 <= (0 + game.yOffSet)) {
this.yTemp = (0 + game.yOffSet) + 14;
var _local15 = getColumnPoint(this.xTemp);
if (_local15 >= 14) {
_local15 = 13;
trace("caughtBug");
}
var _local16 = getRowPoint(this.yTemp);
this.xTemp = (_local15 * game.columnSpace) + 15;
gameGrid[_local16][_local15].type = 1;
gameGrid[_local16][_local15].colour = this.colour;
gameGrid[_local16][_local15].id = this.id;
gameGrid[_local16][_local15].tagged = 1;
delete this.onEnterFrame;
this._x = this.xTemp;
this._y = this.yTemp;
checkGrid(_local16, _local15, this.colour);
return(undefined);
}
this._x = this.xTemp;
this._y = this.yTemp;
};
createBubble = function () {
var _local3 = "bubble" + game.totalBubbles;
game.path.attachMovie("bubble", _local3, depthManager.bubblesDepth + game.totalBubbles);
var _local2 = game.path[_local3];
game.activeBubble = game.totalBubbles;
_local2._x = 157.5;
_local2._y = 500;
_local2.xTemp = _local2._x;
_local2.yTemp = _local2._y;
game.path.basket.arrow.nextBub = game.nextBubble;
_local2.id = game.totalBubbles;
_local2.isReal = true;
_local2.popped = false;
game.totalBubbles = game.totalBubbles + 1;
if (game.totalBubbles > depthManager.bubblesTop) {
game.totalBubbles = 0;
}
_local2.colour = game.nextBubble;
game.actColour = _local2.colour;
_local2.gotoAndStop(_local2.colour);
createNextBubble();
mouseMover = new Object();
mouseMover.onMouseMove = positionAimer;
Mouse.addListener(mouseMover);
game.path.arrow.gotoAndPlay("reload");
if (game.shotsTaken > 0) {
_root.game.path.basket.arrow.gotoAndPlay("reload");
game.path.arrow.gotoAndPlay("reload");
vine.spew.gotoAndPlay("suck");
}
};
createNextBubble = function () {
var _local4 = new Array();
i = 0;
while (i < game.rows) {
j = 0;
while (j < game.columns) {
var _local5 = gameGrid[i][j];
if (_local5.type == 1) {
var _local3 = _local5.colour;
var _local2 = false;
k = 0;
while (k < _local4.length) {
if (_local4[k] == _local3) {
_local2 = true;
}
k++;
}
if (_local2 == false) {
_local4.push(_local3);
}
}
j++;
}
i++;
}
game.nextBubble = _local4[random(_local4.length)];
var _local6 = Math.floor(Math.random() * 100);
if ((_local6 <= 3) && (game.shotsTaken > 0)) {
game.nextBubble = "multi";
}
_root.nextBubbleHold.gotoAndStop(game.nextBubble);
};
shootingEnabled = function () {
mouseListener = new Object();
mouseListener.onMouseDown = shootBubble;
Mouse.addListener(mouseListener);
};
shootingDisabled = function () {
Mouse.removeListener(mouseListener);
};
function bounceitem(whichitem) {
var _local2 = game.path[whichitem];
_local2.xspeed = -10 + random(10);
_local2.dy = -10 + random(10);
_local2.onEnterFrame = function () {
this._rotation = this._rotation + (this.xspeed * 10);
this._y = this._y + this.dy;
this._x = this._x + this.xspeed;
if (this.xspeed > 0) {
this.xspeed = this.xspeed - 0.1;
}
if (this.xspeed < 0) {
this.xspeed = this.xspeed + 0.1;
}
this.dy = this.dy + 2;
if (this._y > 440) {
this.removeMovieClip(this);
this.onEnterFrame = null;
}
};
}
createPop = function (colour, xpos, ypos) {
i = 0;
while (i <= 1) {
var _local1 = "explode" + game.explodeDepth;
game.explodeDepth = game.explodeDepth + 1;
game.path.attachMovie("explode", _local1, depthManager.bubblesPopAnimeDepth + game.explodeDepth);
game.path[_local1]._x = xpos;
game.path[_local1]._y = ypos;
game.path[_local1].gotoAndStop(colour);
game.explodeDepth = game.explodeDepth + 1;
if (game.explodeDepth >= (depthManager.bubblesPopAnimeDepth + 1000)) {
game.explodeDepth = depthManager.bubblesPopAnimeDepth;
}
bounceitem(_local1);
i++;
}
};
timeDelay = function (_mc) {
_mc.stop();
_mc.createEmptyMovieClip("codeRun", -2000);
_mc.codeRun.counter = random(820);
_mc.codeRun.onEnterFrame = function () {
this.counter = this.counter - 1;
if (this.counter <= 0) {
this._parent.play();
this.onEnterFrame = null;
}
};
};
positionAimer = function () {
var _local4 = game.path._xmouse - game.path.arrow._x;
var _local3 = game.path._ymouse - game.path.arrow._y;
var _local2 = Math.atan2(_local3, _local4);
_root.circTarget._y = _root._ymouse;
_root.circTarget._x = _root._xmouse;
if (_root._ymouse < 400) {
Mouse.hide();
} else {
Mouse.show();
}
_local2 = (_local2 * 180) / Math.PI;
game.shootAngle = _local2;
if (_local2 > -25) {
_local2 = -25;
}
if (_local2 < -150) {
_local2 = -150;
}
game.path.arrow._rotation = _local2;
game.angle = (_local2 * Math.PI) / 180;
updateAfterEvent();
};
shootBubble = function () {
_root.shootBubbleSound.start();
game.shotsTaken = game.shotsTaken + 1;
game.movesLeft = game.movesLeft - 1;
movesLeft = "MOVES " + game.movesLeft;
game.path["bubble" + game.activeBubble].xTemp = game.path.arrow._x + (42.5 * Math.cos(game.angle));
game.path["bubble" + game.activeBubble].yTemp = game.path.arrow._y + (42.5 * Math.sin(game.angle));
game.path["bubble" + game.activeBubble].xv = game.power * Math.cos(game.angle);
game.path["bubble" + game.activeBubble].yv = game.power * Math.sin(game.angle);
game.path["bubble" + game.activeBubble].onEnterFrame = moveBubble;
game.path.basket.arrow.gotoAndPlay("fire");
game.path.arrow.gotoAndPlay("fire");
shootingDisabled();
};
addScore = function (amount) {
game.score = game.score + amount;
_root.score = game.score;
};
gameOver = function () {
i = 0;
while (i < game.rows) {
j = 0;
while (j < game.columns) {
var _local1 = gameGrid[i][j];
game.path["bubble" + _local1.id].critter.gotoAndPlay("pop");
j++;
}
i++;
}
levelTrans.gotoAndPlay("gameOver");
};
startGame = function () {
_root.Stattooz.reportEvent("play");
game = {};
game.path = _root.world;
initDepthManager();
game.score = 0;
addScore(0);
game.columns = 14;
game.rows = 13;
game.columnSpace = 30;
game.rowSpace = 26;
game.gravity = 1;
game.level = 0;
game.colours = 2;
game.maxColours = 6;
game.power = 13;
game.totalBubbles = 0;
loadLevel();
};
startGame();
Instance of Symbol 285 MovieClip "levelTrans" in Frame 69
onClipEvent (load) {
this.swapDepths(200000);
}
Frame 78
playButton = function () {
gotoAndStop ("game");
};
instructions = function () {
gotoAndStop ("instructions");
};
Frame 107
stop();
Frame 163
stop();
Symbol 41 MovieClip [goldCoin] Frame 1
if (this._name == "bonus") {
_root.timeDelay(this);
}
stop();
Symbol 58 MovieClip [explode] Frame 1
stop();
gotoRandom = function () {
var _local1 = random(3) + 1;
blob.gotoAndStop(_local1);
};
gotoRandom();
Symbol 58 MovieClip [explode] Frame 2
gotoRandom();
Symbol 58 MovieClip [explode] Frame 3
gotoRandom();
Symbol 58 MovieClip [explode] Frame 4
gotoRandom();
Symbol 58 MovieClip [explode] Frame 5
gotoRandom();
Symbol 58 MovieClip [explode] Frame 6
gotoRandom();
Symbol 58 MovieClip [explode] Frame 7
gotoRandom();
Symbol 58 MovieClip [explode] Frame 8
gotoRandom();
Symbol 78 MovieClip [bonus] Frame 1
this.gotoAndStop(random(7) + 1);
Symbol 78 MovieClip [bonus] Frame 8
switch (bonusType) {
case "coin" :
_root.chingSound.start();
_root.addScore(_root.game.coinScore);
bonusText.score = _root.game.coinScore;
_root.game.coinScore = _root.game.coinScore + 1000;
break;
case "bigBasket" :
_root.game.path.basket._xscale = 175;
_root.game.path.basket._yscale = 175;
_root.game.path.basket.counter = 1000;
_root.game.path.basket.onEnterFrame = _root.basketTimer;
bonusText.score = "BIG MOUTH!";
break;
case "moves" :
bonusText.score = "+1 Move";
_root.game.movesLeft = _root.game.movesLeft + 1;
_root.movesLeft = "MOVES " + _root.game.movesLeft;
break;
case "reverse" :
_root.moveUp();
bonusText.score = "PUSH UP!";
}
Symbol 78 MovieClip [bonus] Frame 31
_root.game.nextMoveCount = _root.game.nextMoveCount - 1;
if (_root.game.nextMoveCount == 0) {
_root.checkLevelCleared();
}
if (!(bonusType === "coin")) {
} else {
_root.addCoin();
}
stop();
Symbol 80 MovieClip Frame 1
this.gotoAndStop(random(6) + 1);
Symbol 80 MovieClip Frame 41
gotoAndPlay (1);
Symbol 80 MovieClip Frame 70
Symbol 80 MovieClip Frame 71
_root.createPop("green", _parent._x, _parent._y);
Symbol 80 MovieClip Frame 125
_root.game.nextMoveCount = _root.game.nextMoveCount - 1;
if (_root.game.nextMoveCount == 0) {
_root.checkMoves();
_root.checkLevelCleared();
}
this._parent.removeMovieClip();
stop();
Symbol 82 MovieClip Frame 1
stop();
Symbol 82 MovieClip Frame 90
_root.createPop("red", _parent._x, _parent._y);
Symbol 82 MovieClip Frame 135
_root.game.nextMoveCount = _root.game.nextMoveCount - 1;
if (_root.game.nextMoveCount == 0) {
_root.checkMoves();
_root.checkLevelCleared();
}
this._parent.removeMovieClip();
stop();
Symbol 84 MovieClip Frame 1
stop();
Symbol 84 MovieClip Frame 90
_root.createPop("blue", _parent._x, _parent._y);
Symbol 84 MovieClip Frame 135
_root.game.nextMoveCount = _root.game.nextMoveCount - 1;
if (_root.game.nextMoveCount == 0) {
_root.checkMoves();
_root.checkLevelCleared();
}
this._parent.removeMovieClip();
stop();
Symbol 86 MovieClip Frame 1
stop();
Symbol 86 MovieClip Frame 90
_root.createPop("pink", _parent._x, _parent._y);
Symbol 86 MovieClip Frame 135
_root.game.nextMoveCount = _root.game.nextMoveCount - 1;
if (_root.game.nextMoveCount == 0) {
_root.checkMoves();
_root.checkLevelCleared();
}
this._parent.removeMovieClip();
stop();
Symbol 88 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 90
_root.createPop("white", _parent._x, _parent._y);
Symbol 88 MovieClip Frame 135
_root.game.nextMoveCount = _root.game.nextMoveCount - 1;
if (_root.game.nextMoveCount == 0) {
_root.checkMoves();
_root.checkLevelCleared();
}
this._parent.removeMovieClip();
stop();
Symbol 90 MovieClip Frame 1
stop();
Symbol 90 MovieClip Frame 90
_root.createPop("orange", _parent._x, _parent._y);
Symbol 90 MovieClip Frame 135
_root.game.nextMoveCount = _root.game.nextMoveCount - 1;
if (_root.game.nextMoveCount == 0) {
_root.checkMoves();
_root.checkLevelCleared();
}
this._parent.removeMovieClip();
stop();
Symbol 92 MovieClip Frame 1
stop();
Symbol 92 MovieClip Frame 90
_root.createPop("purple", _parent._x, _parent._y);
Symbol 92 MovieClip Frame 135
_root.game.nextMoveCount = _root.game.nextMoveCount - 1;
if (_root.game.nextMoveCount == 0) {
_root.checkMoves();
_root.checkLevelCleared();
}
this._parent.removeMovieClip();
stop();
Symbol 94 MovieClip Frame 1
stop();
Symbol 94 MovieClip Frame 90
_root.createPop("yellow", _parent._x, _parent._y);
Symbol 94 MovieClip Frame 135
_root.game.nextMoveCount = _root.game.nextMoveCount - 1;
if (_root.game.nextMoveCount == 0) {
_root.checkMoves();
_root.checkLevelCleared();
}
this._parent.removeMovieClip();
stop();
Symbol 96 MovieClip Frame 1
stop();
Symbol 96 MovieClip Frame 2
_root.createPop("blue", _parent._x, _parent._y);
_root.game.nextMoveCount = _root.game.nextMoveCount - 1;
if (_root.game.nextMoveCount == 0) {
_root.checkMoves();
_root.checkLevelCleared();
}
this._parent.removeMovieClip();
stop();
Symbol 98 MovieClip [bubble] Frame 1
stop();
Symbol 98 MovieClip [bubble] Frame 15
_root.game.nextMoveCount = _root.game.nextMoveCount - 1;
if (_root.game.nextMoveCount == 0) {
_root.checkMoves();
_root.checkLevelCleared();
}
this.removeMovieClip();
stop();
Symbol 113 MovieClip Frame 1
this.setProperty("loadBar", _xscale, 1);
Symbol 113 MovieClip Frame 2
var totalSize = _root.getBytesTotal();
var loadedSize = _root.getBytesLoaded();
var percentageLoaded = ((loadedSize / totalSize) * 100);
this.percentage_text.text = Math.round(percentageLoaded) + "%";
setProperty("loadBar", _xscale , percentageLoaded);
Symbol 113 MovieClip Frame 3
if (percentageLoaded < 100) {
this.gotoAndPlay(2);
} else {
this.gotoAndStop(4);
}
Symbol 113 MovieClip Frame 4
_root.play();
Symbol 136 MovieClip Frame 140
gotoAndPlay (52);
Symbol 149 Button
on (release) {
gotoAndStop ("credits");
}
Symbol 160 Button
on (release) {
gotoAndStop ("splash");
}
Symbol 164 Button
on (release) {
gotoAndStop ("game");
}
Symbol 167 MovieClip Frame 1
stop();
this.onEnterFrame = function () {
cog1._rotation++;
if (cog1._rotation >= 360) {
cog1._rotation = cog1._rotation - 360;
}
cog2._rotation--;
if (cog2._rotation <= 0) {
cog2._rotation = cog2._rotation + 360;
}
};
Symbol 175 MovieClip Frame 1
stop();
Symbol 175 MovieClip Frame 80
_root.createPop("blue", _parent._x, _parent._y);
Symbol 175 MovieClip Frame 114
_root.game.nextMoveCount = _root.game.nextMoveCount - 1;
if (_root.game.nextMoveCount == 0) {
_root.checkMoves();
_root.checkLevelCleared();
}
this._parent.removeMovieClip();
stop();
Symbol 179 MovieClip Frame 1
stop();
Symbol 184 MovieClip Frame 1
stop();
Symbol 187 MovieClip Frame 1
stop();
Symbol 187 MovieClip Frame 6
stop();
Symbol 187 MovieClip Frame 11
gotoAndStop (1);
Symbol 197 MovieClip Frame 1
stop();
Symbol 199 MovieClip Frame 1
stop();
Symbol 199 MovieClip Frame 5
this.onEnterFrame = function () {
play();
};
Symbol 199 MovieClip Frame 9
bubble.gotoAndStop(_root.game.actColour);
Symbol 199 MovieClip Frame 12
this.onEnterFrame = null;
Symbol 199 MovieClip Frame 13
bubble.gotoAndStop(_root.game.actColour);
_root.vine.spew.gotoAndPlay("spew");
_root.shootingEnabled();
stop();
Symbol 199 MovieClip Frame 17
stop();
Symbol 213 MovieClip Frame 1
_root.reportEvent("creditsview");
Symbol 229 MovieClip Frame 82
gotoAndStop ("stance");
Instance of Symbol 187 MovieClip "basket" in Symbol 233 MovieClip Frame 1
onClipEvent (load) {
}
onClipEvent (mouseMove) {
this._x = _parent._xmouse;
if (this._x < 50) {
this._x = 50;
}
if (this._x > (_root.game.columnSpace * _root.game.columns)) {
this._x = _root.game.columnSpace * _root.game.columns;
}
updateAfterEvent();
}
Symbol 257 MovieClip Frame 1
stop();
Symbol 257 MovieClip Frame 5
stop();
Symbol 257 MovieClip Frame 10
stop();
Symbol 257 MovieClip Frame 15
stop();
Symbol 258 MovieClip Frame 1
stop();
Symbol 278 MovieClip Frame 1
stop();
Symbol 278 MovieClip Frame 2
nextBubbleHold.gotoAndStop(_root.game.nextBubble);
Symbol 278 MovieClip Frame 4
_root.vine.spew.head.gotoAndStop(10);
Symbol 278 MovieClip Frame 6
_root.vine.spew.head.gotoAndStop(5);
Symbol 278 MovieClip Frame 9
nextBubble.gotoAndStop(nextBubbleHold._currentframe);
Symbol 278 MovieClip Frame 14
nextBubble.gotoAndStop(nextBubbleHold._currentframe);
Symbol 278 MovieClip Frame 16
_root.vine.spew.head.gotoAndStop(1);
Symbol 278 MovieClip Frame 27
nextBubble.gotoAndStop(nextBubbleHold._currentframe);
Symbol 278 MovieClip Frame 28
nextBubble.gotoAndStop(nextBubbleHold._currentframe);
stop();
Symbol 278 MovieClip Frame 29
onEnterFrame = function () {
play();
};
nextBubble.gotoAndStop(nextBubbleHold._currentframe);
nextBubble.gotoAndStop(nextBubbleHold._currentframe);
Symbol 278 MovieClip Frame 31
nextBubble.gotoAndStop(nextBubbleHold._currentframe);
Symbol 278 MovieClip Frame 33
nextBubble.gotoAndStop(nextBubbleHold._currentframe);
Symbol 278 MovieClip Frame 35
nextBubble.gotoAndStop(nextBubbleHold._currentframe);
Symbol 278 MovieClip Frame 37
onEnterFrame = null;
Symbol 278 MovieClip Frame 38
_root.game.path.arrow.gotoAndPlay("reload");
Symbol 278 MovieClip Frame 43
nextBubble.gotoAndStop(nextBubbleHold._currentframe);
Symbol 278 MovieClip Frame 51
stop();
nextBubbleHold.gotoAndStop(_root.game.nextBubble);
Symbol 285 MovieClip Frame 1
stop();
Symbol 285 MovieClip Frame 2
play();
Symbol 285 MovieClip Frame 51
_root.game.path.basket.arrow.gotoAndPlay("reload");
gotoAndStop (1);
Symbol 285 MovieClip Frame 95
_root.vine.spew.gotoAndStop(1);
_root.loadLevel();
Symbol 285 MovieClip Frame 181
trace("score=" + _root.game.score);
_root.gigglyPopsSong.stop();
if (_root.game.score < 100000) {
_root.gotoAndPlay("gameOver");
} else {
_root.gotoAndPlay("endfail");
}
_root.gigglyPopsSong.stop();
Mouse.show();
stop();
Symbol 289 MovieClip Frame 121
stop();
Symbol 299 Button
on (release) {
gotoAndStop (69);
}
Symbol 300 MovieClip Frame 1
_root.endscore.choo.train.gotoAndStop("pink");
Symbol 306 MovieClip Frame 1
score = _root.game.score;
Symbol 306 MovieClip Frame 166
stop();
Symbol 308 Button
on (release) {
gotoAndStop ("game");
}
Symbol 334 Button
on (press) {
getURL ("http://myhamleys.com/game/claimprize/");
}