Instance of Symbol 212 MovieClip in Frame 1
onClipEvent (enterFrame) {
if (_parent.getBytesTotal() == _parent.getBytesLoaded()) {
_root.gotoAndStop(3);
} else {
_root.gotoAndPlay(1);
}
}
Frame 3
stop();
Frame 5
stop();
Frame 9
var gameSounds = new SoundLibrary();
_root.attachMovie("gameSymbol", "game_mc", getNextHighestDepth());
_root.attachMovie("controllerSymbol", "gameController", getNextHighestDepth());
var myScore = new Score();
stop();
Frame 10
stop();
Symbol 29 MovieClip [dropSymbol] Frame 1
#initclip 12
Object.registerClass("dropSymbol", Drop);
#endinitclip
stop();
Symbol 29 MovieClip [dropSymbol] Frame 2
this.removeMovieClip();
Symbol 29 MovieClip [dropSymbol] Frame 5
play();
Symbol 29 MovieClip [dropSymbol] Frame 10
this.removeMovieClip();
Symbol 175 MovieClip [tileSymbol] Frame 1
#initclip 8
Object.registerClass("tileSymbol", Bubble);
#endinitclip
stop();
Symbol 175 MovieClip [tileSymbol] Frame 30
stop();
Symbol 175 MovieClip [tileSymbol] Frame 31
play();
Symbol 175 MovieClip [tileSymbol] Frame 60
stop();
Symbol 175 MovieClip [tileSymbol] Frame 85
stop();
Symbol 175 MovieClip [tileSymbol] Frame 86
play();
Symbol 175 MovieClip [tileSymbol] Frame 117
stop();
Symbol 175 MovieClip [tileSymbol] Frame 143
stop();
Symbol 175 MovieClip [tileSymbol] Frame 144
play();
Symbol 175 MovieClip [tileSymbol] Frame 161
stop();
Symbol 175 MovieClip [tileSymbol] Frame 188
stop();
Symbol 175 MovieClip [tileSymbol] Frame 189
play();
Symbol 175 MovieClip [tileSymbol] Frame 194
stop();
Symbol 175 MovieClip [tileSymbol] Frame 196
stop();
Symbol 176 MovieClip [gameSymbol] Frame 1
#initclip 9
Object.registerClass("gameSymbol", GameBoard);
#endinitclip
Symbol 179 MovieClip [controllerSymbol] Frame 1
#initclip 10
Object.registerClass("controllerSymbol", Controller);
#endinitclip
Symbol 186 MovieClip Frame 8
stop();
Symbol 191 Button
on (release) {
_root.gameController.gameBegin();
}
Symbol 203 MovieClip Frame 1
stop();
Symbol 207 MovieClip Frame 1
stop();
Symbol 208 MovieClip [interfaceSymbol] Frame 1
#initclip 11
Object.registerClass("interfaceSymbol", Interface);
#endinitclip
stop();
Symbol 284 MovieClip [__Packages.Bubble] Frame 0
class Bubble extends MovieClip
{
var onRollOver, _playable, _currentBubbleSize, _x, _y, gotoAndStop, gotoAndPlay, _name;
function Bubble () {
super();
onRollOver = function () {
this.wiggleBubble();
};
}
function init(playable, xPos, yPos, bubbleSize) {
_playable = playable;
_currentBubbleSize = bubbleSize;
_x = xPos;
_y = yPos;
gotoAndStop(_idleLabels[_currentBubbleSize]);
return(this);
}
function setBubble(nSize) {
_currentBubbleSize = nSize;
if (_playable != false) {
gotoAndStop(_idleLabels[_currentBubbleSize]);
} else {
gotoAndStop(196);
}
}
function growBubble() {
_currentBubbleSize = _currentBubbleSize + 1;
gotoAndPlay(_growLabels[_currentBubbleSize]);
_root.gameSounds._bubbleGrow[random(_root.gameSounds._bubbleGrow.length)].start();
}
function burstBubble() {
_currentBubbleSize = 0;
gotoAndPlay(189);
var _local3 = 1;
while (_local3 < 5) {
var _local4 = ((("d" + _name.charAt(2)) + _name.charAt(4)) + "_") + _local3;
var _local5 = _x + 30;
var _local6 = _y + 30;
var _local7 = _local3;
_root.game_mc.attachMovie("dropSymbol", _local4, _root.game_mc.getNextHighestDepth()).init(_local7, _local5, _local6);
_local3++;
}
_root.myScore.addBurst();
_root.gameSounds._bubblePop_alt.start();
}
function wiggleBubble() {
if ((_playable != false) && (_currentBubbleSize != 0)) {
gotoAndPlay(_wiggleLabels[_currentBubbleSize]);
}
}
function getBubbleSize() {
return(_currentBubbleSize);
}
var _minBubbleSize = 0;
var _maxBubbleSize = 4;
var _idleLabels = [194, 30, 85, 143, 188, 196];
var _wiggleLabels = [194, 2, 61, 118, 162];
var _growLabels = [194, 1, 31, 86, 144, 189];
}
Symbol 285 MovieClip [__Packages.GameBoard] Frame 0
class GameBoard extends MovieClip
{
var _mapWidth, _mapHeight, _x, _y, onMouseDown, attachMovie, getNextHighestDepth, playable, bubbleSize;
function GameBoard () {
super();
_mapWidth = _tiles[0].length;
_mapHeight = _tiles.length;
_x = -32;
_y = -48;
buildgameBoard();
onMouseDown = function () {
if (_level0.gameController._turnEnd == true) {
var _local3 = this.findTile(this._xmouse, this._ymouse);
if (_local3 != undefined) {
if (_local3._playable != false) {
_root.gameController.turnBegin();
var _local4 = _local3.getBubbleSize();
if (_local4 < 4) {
_local3.growBubble();
}
if (_local4 == 4) {
_local3.burstBubble();
}
}
}
} else {
_root.gameSounds._errorDing.start();
}
};
}
function buildgameBoard() {
var _local3 = 0;
while (_local3 < _mapHeight) {
var _local2 = 0;
while (_local2 < _mapWidth) {
var _local4 = ("t" + _local3) + _local2;
initTile(_tiles[_local3][_local2]);
var _local5 = attachMovie("tileSymbol", _local4, getNextHighestDepth()).init(playable, _local2 * _tileW, _local3 * _tileH, bubbleSize);
gameBoard[_local3][_local2] = _local5;
_local2++;
}
_local3++;
}
return(true);
}
function newLevel() {
var _local4 = shuffleLevel();
var _local5 = 0;
var _local3 = 0;
while (_local3 < _mapHeight) {
var _local2 = 0;
while (_local2 < _mapWidth) {
if (gameBoard[_local3][_local2]._playable != 0) {
gameBoard[_local3][_local2].setBubble(parseInt(_local4.pop()));
}
_local2++;
}
_local3++;
}
return(true);
}
function shuffleLevel() {
_difficultyIncrement = _difficultyIncrement + 1;
if ((_difficultyIncrement > 10) && (_root.myScore._numLevels < 50)) {
increaseDifficulty();
}
trace("bubble_pool " + _bubblePool);
var _local5 = [];
var _local4 = 0;
while (_local4 < _bubblePool.length) {
var _local3 = 0;
while (_local3 < _bubblePool[_local4]) {
_local5.push(_local4);
_local3++;
}
_local4++;
}
var _local6 = [];
while (_local5.length > 0) {
_local6.push(_local5.splice(Math.floor(Math.random() * _local5.length), 1));
}
return(_local6);
}
function increaseDifficulty() {
_difficultyIncrement = 0;
_bubblePool.splice(0, 1, _bubblePool[0] + 1);
_bubblePool.splice(1, 1, _bubblePool[1] + 1);
_bubblePool.splice(2, 1, _bubblePool[2] + 1);
_bubblePool.splice(3, 1, _bubblePool[3] - 1);
_bubblePool.splice(4, 1, _bubblePool[4] - 1);
trace("more difficult " + _bubblePool);
}
function resetDifficulty() {
_bubblePool = [8, 6, 10, 10, 6];
trace(_bubblePool);
}
function initTile(b) {
switch (b) {
case 0 :
playable = false;
bubbleSize = 0;
break;
case 1 :
playable = true;
bubbleSize = 0;
}
}
function findTile(x, y) {
var _local5 = 0;
var _local2 = 0;
var _local4 = 0;
while (_local4 < gameBoard.length) {
if ((y > _local5) && (y <= (_local5 + _tileH))) {
_local5 = 0;
var _local3 = 0;
while (_local3 < gameBoard[_local4].length) {
if ((x > _local2) && (x <= (_local2 + _tileW))) {
_local2 = 0;
break;
}
_local2 = _local2 + _tileW;
_local3++;
}
break;
}
_local5 = _local5 + _tileH;
_local4++;
}
return(gameBoard[_local4][_local3]);
}
function getBoardState() {
var _local4 = true;
var _local3 = 0;
while (_local3 < _mapHeight) {
var _local2 = 0;
while (_local2 < _mapWidth) {
if (gameBoard[_local3][_local2]._currentBubbleSize > 0) {
_local4 = false;
break;
}
_local2++;
}
_local3++;
}
return(_local4);
}
function getTile(r, c) {
return(gameBoard[r][c]._name);
}
function clearBoard() {
var _local3 = 0;
while (_local3 < _mapHeight) {
var _local2 = 0;
while (_local2 < _mapWidth) {
gameBoard[_local3][_local2]._currentBubbleSize = 0;
gameBoard[_local3][_local2].gotoAndStop("blank");
_local2++;
}
_local3++;
}
}
var _tileW = 60;
var _tileH = 60;
var _tiles = [[0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 1, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0]];
var _bubblePool = [8, 6, 10, 10, 6];
var _difficultyIncrement = 0;
var gameBoard = GameBoard.prototype._tiles;
}
Symbol 286 MovieClip [__Packages.Controller] Frame 0
class Controller extends MovieClip
{
var _activeDrops, onEnterFrame, _levelEnd, _messageClip, attachMovie, getNextHighestDepth;
function Controller () {
super();
loadTracking();
_activeDrops = [];
var _local4 = _root.game_mc.newLevel();
onEnterFrame = function () {
if (this._gameEnd == false) {
if (this._levelEnd != true) {
if (this._turnEnd != true) {
if (this._activeDrops.length != 0) {
this.turnExecute();
} else {
this.turnEnd();
}
}
} else if (this._tik > this._displayTime) {
this.levelBegin();
} else {
this._tik = this._tik + 1;
}
}
updateAfterEvent();
};
}
function turnExecute() {
var _local3 = 0;
while (_local3 < _activeDrops.length) {
_activeDrops[_local3].moveDrop();
var _local4 = _root.game_mc.findTile(_activeDrops[_local3]._x, _activeDrops[_local3]._y);
if (_local4._playable == true) {
var _local5 = _local4.getBubbleSize();
if ((_local5 > 0) && (_local5 < 4)) {
_activeDrops[_local3].killDrop(_local3);
_local4.growBubble();
}
if (_local5 == 4) {
_activeDrops[_local3].killDrop(_local3);
_local4.burstBubble();
}
} else {
_activeDrops[_local3].wallSplat(_local3);
}
_local3++;
}
}
function turnBegin() {
_turnEnd = false;
_root.myScore.clearCombos();
_root.myScore.reduceDrops(1);
}
function turnEnd() {
_gameEnd = _root.myScore.dropsLeft();
_levelEnd = _root.game_mc.getBoardState();
if (_gameEnd == false) {
if (_levelEnd == true) {
levelEnd();
} else {
_turnEnd = true;
}
} else if (_levelEnd == true) {
_gameEnd = false;
levelEnd();
} else {
gameEnd();
}
}
function levelBegin() {
killMessage();
var _local3 = _root.game_mc.newLevel();
_root.myScore.clearCombos();
_root.myScore.addLevel(1);
_levelEnd = false;
}
function levelEnd() {
_turnEnd = false;
_root.myScore.addDrop(1);
displayMessage(5);
_root._dropBowl.gotoAndPlay("blink");
_root.gameSounds._bonusDing.start();
}
function gameEnd() {
_root.game_mc.clearBoard();
_root._dropBowl.gotoAndStop(1);
_gameEnd = true;
_turnEnd = false;
displayMessage(10);
_root.myScore.showfinalLevels(_root.myScore._numLevels - 1);
_root.gameSounds._gameOver.start();
}
function gameBegin() {
killMessage();
_root.game_mc.resetDifficulty();
var _local3 = _root.game_mc.newLevel();
_gameEnd = false;
_turnEnd = false;
_root.myScore.resetScore();
loadTracking();
}
function displayMessage(num) {
_messageClip = attachMovie("interfaceSymbol", "message_mc", getNextHighestDepth());
_messageClip.showMessage(num);
}
function killMessage() {
_tik = 0;
_messageClip.removeMovieClip();
}
function loadTracking() {
var _local1 = new Date().getTime();
loadMovieNum ("tracker.swf?" + _local1, 10000);
}
var _turnEnd = true;
var _levels = 0;
var _gameEnd = false;
var _gameScore = 0;
var _gameDrops = 0;
var _displayMessage = false;
var _displayTime = 48;
var _tik = 0;
}
Symbol 287 MovieClip [__Packages.Interface] Frame 0
class Interface extends MovieClip
{
var _x, _y, gotoAndStop;
function Interface () {
super();
_x = 200;
_y = 200;
}
function showMessage(num) {
gotoAndStop(num);
}
}
Symbol 288 MovieClip [__Packages.Drop] Frame 0
class Drop extends MovieClip
{
var _nDir, _x, _y, _rotation, gotoAndPlay;
function Drop () {
super();
}
function init(nDir, xTile, yTile) {
_nDir = nDir;
_x = xTile;
_y = yTile;
placeDrop();
_root.gameController._activeDrops.push(this);
return(this);
}
function placeDrop() {
switch (_nDir) {
case 1 :
_rotation = 270;
break;
case 2 :
_rotation = 90;
break;
case 3 :
break;
case 4 :
_rotation = 180;
}
}
function moveDrop() {
switch (_nDir) {
case 1 :
_y = _y - _nSpeed;
break;
case 2 :
_y = _y + _nSpeed;
break;
case 3 :
_x = _x + _nSpeed;
break;
case 4 :
_x = _x - _nSpeed;
}
}
function killDrop(d) {
gotoAndPlay(2);
_root.gameController._activeDrops.splice(d, 1);
}
function wallSplat(d) {
gotoAndPlay(5);
_root.gameController._activeDrops.splice(d, 1);
_root.gameSounds._bubbleSplat[random(_root.gameSounds._bubbleSplat.length)].start();
}
function bubbleSplat(d) {
gotoAndPlay(5);
_root.gameController._activeDrops.splice(d, 1);
}
var _nBurst = 0;
var _nSpeed = 8;
}
Symbol 289 MovieClip [__Packages.SoundLibrary] Frame 0
class SoundLibrary
{
var _bubbleGrow, _bubbleSplat, _bonusDing, _bubblePop_alt, _errorDing, _gameOver;
function SoundLibrary () {
_bubbleGrow = [];
_bubbleSplat = [];
var _local2 = 1;
while (_local2 <= 5) {
var _local3 = new Sound();
_local3.attachSound("bubbleGrow" + _local2);
_bubbleGrow.push(_local3);
_local3 = new Sound();
_local3.attachSound("bubbleSplat" + _local2);
_bubbleSplat.push(_local3);
_local2++;
}
_bonusDing = new Sound();
_bonusDing.attachSound("bonusDing");
_bubblePop_alt = new Sound();
_bubblePop_alt.attachSound("bubblePop_alt");
_errorDing = new Sound();
_errorDing.attachSound("noDrop");
_gameOver = new Sound();
_gameOver.attachSound("gameOver");
}
}
Symbol 290 MovieClip [__Packages.Score] Frame 0
class Score extends MovieClip
{
var _numDropsLeft;
function Score () {
super();
_numDropsLeft = _numDropsBegin;
updateScore(_numDropsLeft);
updateLevel(_numLevels);
}
function addLevel(num) {
_numLevels = _numLevels + num;
if (_numLevels > _numLevelsMax) {
_gameWon = true;
_numLevels = _numLevelsMax;
}
updateLevel(_numLevels);
updateScore(_numDropsLeft);
}
function addDrop(num) {
_numDropsLeft = _numDropsLeft + num;
if (_numDropsLeft > _numDropsMax) {
_numDropsLeft = _numDropsMax;
}
updateScore(_numDropsLeft);
}
function getNumDropsLeft() {
return(_numDropsLeft);
}
function dropsLeft() {
if (_numDropsLeft > 0) {
return(false);
}
_numDropsLeft = 0;
return(true);
}
function reduceDrops(num) {
_numDropsLeft = _numDropsLeft - num;
updateScore(_numDropsLeft);
}
function addBurst() {
_numBursts = _numBursts + 1;
if ((_numBursts % _comboMin) == 0) {
addDrop(1);
_root._dropBowl.gotoAndPlay("blink");
updateScore(_numDropsLeft);
_root.gameSounds._bonusDing.start();
}
}
function clearCombos() {
_numBursts = 0;
}
function resetScore() {
_numDropsLeft = _numDropsBegin;
updateScore(_numDropsLeft);
_numLevels = 1;
updateLevel(_numLevels);
}
function updateScore(new_number) {
if (new_number <= 3) {
_root._dropBowl.gotoAndPlay("red");
}
if (new_number < 10) {
_root._dropBowl._dropCounter.gotoAndStop("1digit");
var _local5 = new_number;
_root._dropBowl._dropCounter.dropDigit1MC.gotoAndStop(_local5 + 1);
} else {
_root._dropBowl._dropCounter.gotoAndStop("2digit");
var _local5 = Math.abs(Math.floor(new_number / 10));
var _local4 = Math.abs(new_number % 10);
_root._dropBowl._dropCounter.dropDigit1MC.gotoAndStop(_local5 + 1);
_root._dropBowl._dropCounter.dropDigit2MC.gotoAndStop(_local4 + 1);
}
calibrateLiquid(new_number);
}
function calibrateLiquid(num) {
if (num < 20) {
_root._dropBowl._liquidFront.gotoAndStop(num);
_root._dropBowl._liquidBack.gotoAndStop(num);
} else {
_root._dropBowl._liquidFront.gotoAndStop(20);
_root._dropBowl._liquidBack.gotoAndStop(20);
}
}
function updateLevel(new_number) {
if (new_number < 10) {
_root._boardCounter.gotoAndStop("1digit");
var _local4 = new_number;
_root._boardCounter.levelDigit1MC.gotoAndStop(_local4 + 1);
} else {
_root._boardCounter.gotoAndStop("2digits");
var _local4 = Math.abs(Math.floor(new_number / 10));
var _local3 = Math.abs(new_number % 10);
_root._boardCounter.levelDigit1MC.gotoAndStop(_local4 + 1);
_root._boardCounter.levelDigit2MC.gotoAndStop(_local3 + 1);
}
}
function showfinalLevels(new_number) {
if (_gameWon == true) {
new_number = _numLevelsMax;
}
if (new_number < 10) {
_root.gameController._messageClip._totalCleared.gotoAndStop("1digit");
var _local5 = new_number;
_root.gameController._messageClip._totalCleared.levelDigit1MC.gotoAndStop(_local5 + 1);
} else {
_root.gameController._messageClip._totalCleared.gotoAndStop("2digits");
var _local5 = Math.abs(Math.floor(new_number / 10));
var _local4 = Math.abs(new_number % 10);
_root.gameController._messageClip._totalCleared.levelDigit1MC.gotoAndStop(_local5 + 1);
_root.gameController._messageClip._totalCleared.levelDigit2MC.gotoAndStop(_local4 + 1);
}
if (new_number == 1) {
_root.gameController._messageClip._boardsCleared.gotoAndStop(2);
}
}
var _numBursts = 0;
var _numDropsBegin = 10;
var _numDropsMax = 99;
var _comboMin = 3;
var _numLevels = 1;
var _numLevelsMax = 99;
var _gameWon = false;
}
Symbol 220 Button
on (release) {
gotoAndStop (5);
}
Symbol 225 Button
on (release) {
gotoAndPlay (6);
}
Symbol 260 MovieClip Frame 1
stop();
Symbol 282 MovieClip Frame 1
stop();
Symbol 282 MovieClip Frame 15
stop();
Symbol 282 MovieClip Frame 25
gotoAndPlay ("red");