Frame 1
function gamePause(e) {
if (e.object == "on") {
if (_root.onMouseUp != null) {
_root.onMouseUp();
}
_global.gameon = true;
_global.BubblesFlying = 0;
} else {
_global.gameon = false;
}
}
function initDone(e) {
if (runOnce == false) {
runOnce = true;
trace("88: ***** Game starting ******");
trace("88: set and load tool bar");
cBarFunctions = new Object();
cBarFunctions.gameRestart = "reloadGame";
cBarFunctions.gamePause = "gamePause";
cBarFunctions.gameVolume = "gameVolume";
cSdkApiAS2.AGsetAndLoadToolbar(cBarFunctions, "startGame");
trace("error " + e.result);
} else {
trace("88: ***************** run Again *******************");
}
}
function gameOverInit(e) {
_root.init();
}
function reloadGame(e) {
trace("88: reload Game ran with game over init **********************");
_root.GameOver = true;
_global.DoHighScoresCall = false;
gameOverInit(e);
}
function startGame(e) {
trace("88: Start Game ran **********************");
gotoAndPlay ("Preloader");
}
var score;
var runOnce = false;
var cBarFunctions;
score = 99;
_global.DoHighScoresCall = false;
_root.isRunningActionMatch = false;
_root.doHighScores = function () {
stop();
this.waitup = function () {
_root.mrX = _root.Score;
trace(_global.ipbSend(_root.mrX));
clearInterval(holdon);
};
var holdon = setInterval(this, "waitup", 3000);
};
_global.ipb_get_gname = function () {
var _local4 = _root._url;
var _local5 = "";
var _local3 = "";
var _local6 = _local4.lastIndexOf("\\") + 1;
if ((_local6 == -1) || (_local6 == 0)) {
_local6 = _local4.lastIndexOf("/") + 1;
}
var _local2 = _local6;
var _local7 = String(_local4).length;
while (_local2 < String(_local4).length) {
_local3 = _local4.charAt(_local2);
if (_local3 == ".") {
break;
}
_local5 = _local5 + _local3;
_local2++;
}
return(_local5);
};
ipb_gname = _global.ipb_get_gname();
xx = new LoadVars();
xx.onLoad = function (success) {
if (success) {
_global.ipb_scoreVar = this.scoreVar;
}
};
fname = ((("arcade/gamedata/" + ipb_gname) + "/") + ipb_gname) + ".txt";
xx.load(fname);
Frame 4
_root.createEmptyMovieClip("musicMovieClip", 872957324);
musicMovieClip.music = new Sound(musicMovieClip);
_global.allsound = new Sound(_root);
whoosh = new Sound(this);
whoosh.attachSound("swoosh");
whoosh.start(0, 1);
_global.dummy = "Kopd";
if (_global.musicstate != "MusicIsPlaying") {
musicMovieClip.music.attachSound("177730_Reaching_The_Sky");
musicMovieClip.music.start(0, 999);
_global.musicstate = "MusicIsPlaying";
}
areweatdeadwhale = false;
highscoreText = "Submit to highscores";
_lockroot = true;
deadwhaleSplash._alpha = 0;
startingTime = getTimer();
stop();
_root.onEnterFrame = function () {
if ((getTimer() - startingTime) < 6000) {
deadwhaleSplash._alpha = (0.95 * deadwhaleSplash._alpha) + 5;
} else {
deadwhaleSplash._alpha = (0.93 * deadwhaleSplash._alpha) + 0;
if (deadwhaleSplash._alpha < 2) {
play();
}
}
};
Instance of Symbol 146 MovieClip "deadwhaleSplash" in Frame 4
on (release) {
effectSound = new Sound(this);
effectSound.attachSound("Clicki");
effectSound.start(0, 1);
getURL ("http://www.deadwhale.com", "_blank");
}
Frame 6
_global.gameon = false;
if (areweatdeadwhale) {
FrongPageButton._visible = false;
}
rotatingDecoration.onEnterFrame = function () {
this._rotation = this._rotation + 1;
};
stop();
Frame 7
function setpoints(newpoints) {
EncryptedPoints = (newpoints * Factor_b) + Factor_a;
}
function getpoints() {
return((EncryptedPoints - Factor_a) / Factor_b);
}
function setyf(xx, yy) {
xx = xx * 1;
yy = yy * 1;
return((0 * xx) + (0.866025403784439 * yy));
}
function setxf(xx, yy) {
xx = xx * 1;
yy = yy * 1;
return((1 * xx) + (0.5 * yy));
}
function gety(xx, yy) {
xx = xx * 1;
yy = yy * 1;
return(((axis1x * yy) - (xx * axis1y)) / ((axis1x * axis2y) - (axis2x * axis1y)));
}
function getx(xx, yy) {
xx = xx * 1;
yy = yy * 1;
return(((xx * axis2y) - (axis2x * yy)) / ((axis1x * axis2y) - (axis2x * axis1y)));
}
function sety(xx, yy) {
xx = xx * 1;
yy = yy * 1;
return((axis1y * xx) + (axis2y * yy));
}
function setx(xx, yy) {
xx = xx * 1;
yy = yy * 1;
return((axis1x * xx) + (axis2x * yy));
}
function SetInfo(penaltyCounter) {
i = 1;
while (i < 10) {
if (this["wastage" + i]) {
this["wastage" + i].targetalpha = 0;
this["wastage" + i].targetscale = 0;
}
i++;
}
i = 1;
while (i <= penaltyCounter) {
if (!this["wastage" + i]) {
attachMovie("tilenuclear", "wastage" + i, 789789 + i);
}
this["wastage" + i].targetalpha = 100;
this["wastage" + i].targetscale = 68;
this["wastage" + i]._y = 508.374;
this["wastage" + i]._x = ((10 + (30 * i)) * 0.9) * 0.926;
i++;
}
}
function init() {
i = 0;
while (i <= NumberOfColors) {
_root["howmanyOfThisColor" + i] = 1;
i++;
}
IsShrinking = false;
PointMultiplier = 1;
NumberOfColors = 3;
multiplierText = "";
GridRotatingSpeed = 20;
penaltyLimit = 6;
penaltyCounter = 6;
axis1x = 1;
axis1y = 0;
axis2x = 0.5;
axis2y = 0.866025403784439;
SetInfo(6);
_global.BubblesFlying = 0;
BubblesAttached = 0;
NextBubble1 = 1;
NextBubble2 = 2;
NextBubble3 = 1;
setNextBubble();
toBePopped = 0;
framerate = 0;
framesCounted = 0;
frameStartTime = 0;
NumberOfBubblesShot = 0;
GridWidth = 5;
GameOver = false;
_global.gameon = true;
gametime = 20000;
PointsThrown = 0;
attachMovie("EndScreen", "endScreen", 19);
_root.endScreen._visible = false;
_root.endScreen._x = 250.02;
_root.endScreen._y = 250.02;
_root.infoScreen._visible = false;
_root.infoScreen.killme = false;
_root.infoScreen.gotoAndPlay(1);
infoScreenPublished = getTimer();
if (infoScreen.getDepth() != 100000) {
infoScreen.swapDepths(100000);
}
tempPoints = 0;
setpoints(0);
_global.AnotherEndResult = getpoints();
Score = "" + Math.round(tempPoints);
level = 1;
_global.endResult = "0";
MouseFollower._xscale = 10;
MouseFollower._yscale = 10;
MouseFollower._x = 100;
MouseFollower._y = 100;
MouseFollower._visible = false;
this.attachMovie("empty", "grid", 0);
this.attachMovie("empty", "shots", 2);
this.attachMovie("empty", "scoreEffects", 1);
scoreEffects._x = (scoreEffects._y = 0);
this.grid._x = GridCenterX;
this.grid._y = GridCenterY;
this.grid._xscale = (this.grid._yscale = 0);
this.grid.targetscale = 100;
this.shots._x = 0;
this.shots._y = 0;
initGrid();
}
function AttachBubble(number, ii, jj, name, xv, yv, considerRemoving) {
setpoints(getpoints() - PointMultiplier);
BubblesAttached++;
grid.attachMovie("file" + number, name, grid.getNextHighestDepth());
grid[name]._xscale = (grid[name]._yscale = 100 * SizeFactor);
grid[name].myi = ii;
grid[name].myj = jj;
grid[name].myContents = number;
grid[name]._visible = true;
grid[name]._x = setxf(jj * tileW, ii * tileH);
grid[name]._y = setyf(jj * tileW, ii * tileH);
grid[name].gotoAndPlay(1);
grid[name]._rotation = -grid._rotation;
xxx = setx(jj * tileW, ii * tileH);
yyy = sety(jj * tileW, ii * tileH);
lenin = Math.sqrt((xxx * xxx) + (yyy * yyy));
xxx = xxx / lenin;
yyy = yyy / lenin;
newxxx = -yyy;
newyyy = xxx;
dpdp = (newxxx * xv) + (newyyy * yv);
GridRotatingSpeed = GridRotatingSpeed + ((7 * (dpdp - (lenin * Math.sin((GridRotatingSpeed / 180) * 3.141592)))) * Math.pow(1 / (1 + BubblesAttached), 1));
grid[name].solid = true;
grid[name].onEnterFrame = function () {
correctx = setx(this.myj * tileW, this.myi * tileH);
correcty = sety(this.myj * tileW, this.myi * tileH);
if (!_root.GameOver) {
if ((((correctx < (_root.leftBound + 50)) || (correctx > (_root.rightBound - 50))) || (correcty < (_root.upperBound + 50))) || (correcty > (_root.lowerBound - 50))) {
if (!this.beware) {
this.attachMovie("bewareGlow", "beware", this.getNextHighestDepth());
this.beware._alpha = 0;
}
this.beware._alpha = (this.beware._alpha * 0.9) + 6;
this.beware._x = 0;
this.beware._y = 0;
} else if (this.beware) {
if (this.beware._alpha < 5) {
this.beware.removeMovieClip();
} else {
this.beware._alpha = this.beware._alpha * 0.95;
}
}
if ((correctx < (_root.leftBound + (tileW * 0.4))) || (correctx > (_root.rightBound - (tileW * 0.4)))) {
_root.GameOver = true;
ThrowError(correctx + grid._x, correcty + grid._y);
}
if ((correcty < (_root.upperBound + (tileH * 0.4))) || (correcty > (_root.lowerBound - (tileH * 0.4)))) {
_root.GameOver = true;
ThrowError(correctx + grid._x, correcty + grid._y);
}
}
};
if (considerRemoving) {
removeBlock(ii, jj);
}
countDifferentColors();
}
function countDifferentColors() {
var _local5 = new Array();
var _local4 = new Array();
var _local2 = 0;
var _local3 = 0;
i = 0;
while (i <= NumberOfColors) {
_root["howmanyOfThisColor" + i] = 0;
i++;
}
_local5[_local3] = 0;
_local4[_local3] = 0;
BFSindex++;
while (_local3 <= _local2) {
iii = _local5[_local3];
jjj = _local4[_local3];
_root["howmanyOfThisColor" + grid[(("t_" + iii) + "_") + jjj].myContents]++;
iii = _local5[_local3] - 1;
jjj = _local4[_local3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3] + 1;
jjj = _local4[_local3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3];
jjj = _local4[_local3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3];
jjj = _local4[_local3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3] - 1;
jjj = _local4[_local3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3] + 1;
jjj = _local4[_local3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
_local3++;
}
}
function removeBlock(ii, jj) {
var _local5 = new Array();
var _local4 = new Array();
var _local2 = 0;
var _local3 = 0;
_local5[_local3] = ii;
_local4[_local3] = jj;
BFSindex++;
id = grid[(("t_" + ii) + "_") + jj].myContents;
while (_local3 <= _local2) {
iii = _local5[_local3] - 1;
jjj = _local4[_local3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) && (grid[(("t_" + iii) + "_") + jjj].myContents == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3] + 1;
jjj = _local4[_local3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) && (grid[(("t_" + iii) + "_") + jjj].myContents == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3];
jjj = _local4[_local3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) && (grid[(("t_" + iii) + "_") + jjj].myContents == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3];
jjj = _local4[_local3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) && (grid[(("t_" + iii) + "_") + jjj].myContents == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3] - 1;
jjj = _local4[_local3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) && (grid[(("t_" + iii) + "_") + jjj].myContents == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3] + 1;
jjj = _local4[_local3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) && (grid[(("t_" + iii) + "_") + jjj].myContents == id)) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
_local3++;
}
if (_local2 > 2) {
var _local7 = new Array();
var _local6 = new Array();
indexa3 = 0;
indexl3 = 0;
_local7[0] = 0;
_local6[0] = 0;
BFSindex++;
while (indexa3 <= indexl3) {
iii = _local7[indexa3] - 1;
jjj = _local6[indexa3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
indexl3++;
_local7[indexl3] = iii;
_local6[indexl3] = jjj;
}
}
iii = _local7[indexa3] + 1;
jjj = _local6[indexa3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
indexl3++;
_local7[indexl3] = iii;
_local6[indexl3] = jjj;
}
}
iii = _local7[indexa3];
jjj = _local6[indexa3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
indexl3++;
_local7[indexl3] = iii;
_local6[indexl3] = jjj;
}
}
iii = _local7[indexa3];
jjj = _local6[indexa3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
indexl3++;
_local7[indexl3] = iii;
_local6[indexl3] = jjj;
}
}
iii = _local7[indexa3] + 1;
jjj = _local6[indexa3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
indexl3++;
_local7[indexl3] = iii;
_local6[indexl3] = jjj;
}
}
iii = _local7[indexa3] - 1;
jjj = _local6[indexa3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
indexl3++;
_local7[indexl3] = iii;
_local6[indexl3] = jjj;
}
}
indexa3++;
}
_local5 = new Array();
_local4 = new Array();
_local2 = 0;
_local3 = 0;
_local5[_local3] = ii;
_local4[_local3] = jj;
BFSindex++;
while (_local3 <= _local2) {
iii = _local5[_local3] - 1;
jjj = _local4[_local3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) && (grid[(("t_" + iii) + "_") + jjj].myContents == id)) {
ThrowPoints(PointMultiplier, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3] + 1;
jjj = _local4[_local3];
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) && (grid[(("t_" + iii) + "_") + jjj].myContents == id)) {
ThrowPoints(PointMultiplier, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3];
jjj = _local4[_local3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) && (grid[(("t_" + iii) + "_") + jjj].myContents == id)) {
ThrowPoints(PointMultiplier, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3];
jjj = _local4[_local3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) && (grid[(("t_" + iii) + "_") + jjj].myContents == id)) {
ThrowPoints(PointMultiplier, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3] - 1;
jjj = _local4[_local3] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) && (grid[(("t_" + iii) + "_") + jjj].myContents == id)) {
ThrowPoints(PointMultiplier, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
iii = _local5[_local3] + 1;
jjj = _local4[_local3] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if ((grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) && (grid[(("t_" + iii) + "_") + jjj].myContents == id)) {
ThrowPoints(PointMultiplier, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
_local2++;
_local5[_local2] = iii;
_local4[_local2] = jjj;
}
}
_local3++;
}
var _local9 = new Array();
var _local8 = new Array();
indexa2 = 0;
indexl2 = 0;
_local9[0] = 0;
_local8[0] = 0;
BFSindex++;
while (indexa2 <= indexl2) {
iii = _local9[indexa2];
jjj = _local8[indexa2];
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
iii = _local9[indexa2] - 1;
jjj = _local8[indexa2];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
indexl2++;
_local9[indexl2] = iii;
_local8[indexl2] = jjj;
}
}
iii = _local9[indexa2] + 1;
jjj = _local8[indexa2];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
indexl2++;
_local9[indexl2] = iii;
_local8[indexl2] = jjj;
}
}
iii = _local9[indexa2];
jjj = _local8[indexa2] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
indexl2++;
_local9[indexl2] = iii;
_local8[indexl2] = jjj;
}
}
iii = _local9[indexa2];
jjj = _local8[indexa2] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
indexl2++;
_local9[indexl2] = iii;
_local8[indexl2] = jjj;
}
}
iii = _local9[indexa2] - 1;
jjj = _local8[indexa2] + 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
indexl2++;
_local9[indexl2] = iii;
_local8[indexl2] = jjj;
}
}
iii = _local9[indexa2] + 1;
jjj = _local8[indexa2] - 1;
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
grid[(("t_" + iii) + "_") + jjj].BFS = BFSindex;
indexl2++;
_local9[indexl2] = iii;
_local8[indexl2] = jjj;
}
}
indexa2++;
}
numberOfRemovedBubbles = 0;
var _local10 = 0;
while (_local10 <= indexl3) {
iii = _local7[_local10];
jjj = _local6[_local10];
if (grid[(("t_" + iii) + "_") + jjj]) {
if (grid[(("t_" + iii) + "_") + jjj].BFS != BFSindex) {
ThrowPoints(PointMultiplier, grid._x + setx(jjj * tileW, iii * tileH), grid._y + sety(jjj * tileW, iii * tileH), grid[(("t_" + iii) + "_") + jjj]);
grid[(("t_" + iii) + "_") + jjj].removeMovieClip();
numberOfRemovedBubbles++;
}
}
_local10++;
}
numberOfRemovedBubbles = numberOfRemovedBubbles + _local2;
BubblesAttached = BubblesAttached - numberOfRemovedBubbles;
setpoints(getpoints() + (numberOfRemovedBubbles * PointMultiplier));
Score = (_global.endResult = "" + getpoints());
_global.AnotherEndResult = getpoints();
}
}
function ourRandomNumber() {
attempt = 0;
do {
attempt++;
outcome = random(NumberOfColors) + 1;
} while ((_root["howmanyOfThisColor" + outcome] == 0) && (attempt < 100));
return(outcome);
}
function setBubbleManually(i, j, number) {
if (grid[(("t_" + i) + "_") + j]) {
grid[(("t_" + i) + "_") + j].removeMovieClip();
} else {
BubblesAttached++;
}
grid.attachMovie("file" + number, (("t_" + i) + "_") + j, grid.getNextHighestDepth());
grid[(("t_" + i) + "_") + j].myContents = number;
grid[(("t_" + i) + "_") + j]._xscale = (grid[(("t_" + i) + "_") + j]._yscale = SizeFactor * 100);
grid[(("t_" + i) + "_") + j]._x = setxf(tileW * j, tileH * i);
grid[(("t_" + i) + "_") + j]._y = setyf(tileW * j, tileH * i);
grid[(("t_" + i) + "_") + j].gotoAndPlay(1);
grid[(("t_" + i) + "_") + j].solid = true;
}
function dist2(x1, y1, x2, y2) {
return(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
function testhit(xx, yy) {
var _local8 = Math.round(gety(xx - _root.grid._x, yy - _root.grid._y) / tileW) - 1;
var _local9 = _local8 + 2;
var _local4 = Math.round(getx(xx - _root.grid._x, yy - _root.grid._y) / tileH) - 1;
var _local6 = _local4 + 2;
var _local3 = _local8;
while (_local3 <= _local9) {
var _local2 = _local4;
while (_local2 <= _local6) {
if (_root.grid[(("t_" + _local3) + "_") + _local2]) {
if (dist2(setx(_local2 * tileW, _local3 * tileH) + _root.grid._x, sety(_local2 * tileW, _local3 * tileH) + _root.grid._y, xx, yy) < ((729 * SizeFactor) * SizeFactor)) {
return(true);
}
}
_local2++;
}
_local3++;
}
return(false);
}
function shootrandom() {
_global.BubblesFlying++;
number = ourRandomNumber();
name = "t_" + NumberOfBubblesShot;
NumberOfBubblesShot++;
shots.attachMovie("file" + number, name, shots.getNextHighestDepth());
shots[name].numberOfBounces = 0;
shots[name]._xscale = (shots[name]._yscale = 100 * SizeFactor);
shots[name].Size = 100;
shots[name].myContents = number;
shots[name]._visible = true;
ang = (Math.random() * 2) * 3.141592;
factori = 1 + Math.random();
shots[name]._x = GridCenterX + ((Math.cos(ang) * 420) * factori);
shots[name]._y = GridCenterY + ((Math.sin(ang) * 420) * factori);
shots[name].xv = GridCenterX - shots[name]._x;
shots[name].yv = GridCenterY - shots[name]._y;
len = Math.sqrt((shots[name].xv * shots[name].xv) + (shots[name].yv * shots[name].yv));
len = len / 15;
shots[name].xv = shots[name].xv / len;
shots[name].yv = shots[name].yv / len;
shots[name]._alpha = 100;
shots[name].gotoAndPlay(1);
shots[name].solid = false;
shots[name].currentage = 0;
shots[name].onEnterFrame = function () {
if (!_global.gameon) {
this.removeMovieClip();
}
this.currentage++;
if ((!this.solid) && (_global.gameon)) {
this._y = this._y + (this.yv * 0.5);
this._x = this._x + (this.xv * 0.5);
if (testhit(this._x, this._y)) {
var _local8 = Math.round(gety(this._x - _root.grid._x, this._y - _root.grid._y) / tileW) - 1;
var _local9 = _local8 + 2;
var _local6 = Math.round(getx(this._x - _root.grid._x, this._y - _root.grid._y) / tileH) - 1;
var _local7 = _local6 + 2;
BestName = "";
bestDist = 9999999 /* 0x98967F */;
var _local5 = _local8;
while (_local5 <= _local9) {
var _local4 = _local6;
while (_local4 <= _local7) {
if (!_root.grid[(("t_" + _local5) + "_") + _local4]) {
ddd222 = dist2(_root.grid._x + setx(_local4 * tileW, _local5 * tileH), _root.grid._y + sety(_local4 * tileW, _local5 * tileH), this._x, this._y);
if (bestDist > ddd222) {
bestDist = ddd222;
Bestii = _local5;
Bestjj = _local4;
}
}
_local4++;
}
_local5++;
}
AttachBubble(this.myContents, Bestii, Bestjj, (("t_" + Bestii) + "_") + Bestjj, this.xv, this.yv, false);
_global.BubblesFlying--;
this.removeMovieClip();
return(undefined);
}
this._y = this._y + (this.yv * 0.5);
this._x = this._x + (this.xv * 0.5);
if (testhit(this._x, this._y)) {
var _local8 = Math.round(gety(this._x - _root.grid._x, this._y - _root.grid._y) / tileW) - 1;
var _local9 = _local8 + 2;
var _local6 = Math.round(getx(this._x - _root.grid._x, this._y - _root.grid._y) / tileH) - 1;
var _local7 = _local6 + 2;
BestName = "";
bestDist = 9999999 /* 0x98967F */;
var _local5 = _local8;
while (_local5 <= _local9) {
var _local4 = _local6;
while (_local4 <= _local7) {
if (!_root.grid[(("t_" + _local5) + "_") + _local4]) {
ddd222 = dist2(_root.grid._x + setx(_local4 * tileW, _local5 * tileH), _root.grid._y + sety(_local4 * tileW, _local5 * tileH), this._x, this._y);
if (bestDist > ddd222) {
bestDist = ddd222;
Bestii = _local5;
Bestjj = _local4;
}
}
_local4++;
}
_local5++;
}
AttachBubble(this.myContents, Bestii, Bestjj, (("t_" + Bestii) + "_") + Bestjj, this.xv, this.yv, false);
_global.BubblesFlying--;
this.removeMovieClip();
return(undefined);
}
}
};
}
function setNextBubble() {
NextBubble1 = NextBubble2;
NextBubble2 = NextBubble3;
attachMovie("file" + NextBubble1, "NextBubblemc1", 39);
NextBubblemc1._y = 27.78;
NextBubblemc1._xscale = (NextBubblemc1._yscale = 46.3);
NextBubblemc1.targety = Arrow._y;
NextBubblemc1.targetscale = 100 * SizeFactor;
NextBubblemc1._x = Arrow._x;
NextBubblemc1.onEnterFrame = function () {
this._xscale = (this._yscale = (0.95 * this._xscale) + (0.05 * this.targetscale));
this._y = (0.95 * this._y) + (0.05 * this.targety);
};
attachMovie("file" + NextBubble2, "NextBubblemc2", 29);
NextBubblemc2._y = 16.668;
NextBubblemc2.targety = 25.002;
NextBubblemc2._x = GridCenterX;
NextBubblemc2._xscale = (NextBubblemc2._yscale = 29.169);
NextBubblemc2.targetscale = 33.336;
NextBubblemc2.onEnterFrame = function () {
this._xscale = (this._yscale = (0.95 * this._xscale) + (0.05 * this.targetscale));
this._y = (0.95 * this._y) + (0.05 * this.targety);
};
NextBubble3 = ourRandomNumber();
attachMovie("file" + NextBubble3, "NextBubblemc3", 28);
NextBubblemc3._y = 16.668;
NextBubblemc3.targety = 13.3344;
NextBubblemc3._x = GridCenterX;
NextBubblemc3._xscale = (NextBubblemc3._yscale = 0);
NextBubblemc3.targetscale = 29.169;
NextBubblemc3.onEnterFrame = function () {
this._xscale = (this._yscale = (0.95 * this._xscale) + (0.05 * this.targetscale));
this._y = (0.95 * this._y) + (0.05 * this.targety);
};
}
function ArrowColor(whatnext) {
currentColorArrow = newColorArrow;
switch (whatnext) {
case 1 :
newColorArrow = {rb:29, gb:162, bb:218};
break;
case 2 :
newColorArrow = {rb:1, gb:152, bb:106};
break;
case 3 :
newColorArrow = {rb:236, gb:214, bb:19};
break;
case 4 :
newColorArrow = {rb:1, gb:71, bb:101};
break;
case 5 :
newColorArrow = {rb:177, gb:71, bb:1};
break;
case 6 :
newColorArrow = {rb:211, gb:146, bb:186};
}
}
function shoot() {
if (_global.BubblesFlying > 0) {
return(undefined);
}
_global.BubblesFlying++;
number = NextBubble1;
NextBubblemc1._xscale = (NextBubblemc1._yscale = 0);
NextBubblemc1.targetscale = 0;
ArrowColor(NextBubble2);
ArrowHeight = 0;
name = "t_" + NumberOfBubblesShot;
NumberOfBubblesShot++;
shots.attachMovie("file" + number, name, shots.getNextHighestDepth());
shots[name].numberOfBounces = 0;
shots[name]._xscale = (shots[name]._yscale = 100 * SizeFactor);
shots[name].Size = 100;
shots[name].myContents = number;
shots[name]._visible = true;
shots[name]._x = Arrow._x;
shots[name]._y = Arrow._y;
shots[name].xv = _root._xmouse - shots[name]._x;
shots[name].yv = _root._ymouse - shots[name]._y;
len = Math.sqrt((shots[name].xv * shots[name].xv) + (shots[name].yv * shots[name].yv));
len = len / BubbleSpeed;
shots[name].xv = shots[name].xv / len;
shots[name].yv = shots[name].yv / len;
shots[name].MyFirstFrame = true;
shots[name]._alpha = 100;
shots[name].gotoAndPlay(1);
shots[name].solid = false;
shots[name].currentage = 0;
shots[name].onEnterFrame = function () {
if (!_global.gameon) {
this.removeMovieClip();
}
this.currentage++;
if ((!this.solid) && (_global.gameon)) {
if (this.numberOfBounces > 5) {
ArrowColor(NextBubble1);
ThrowAwayBubbleEffect(this._x, this._y, this);
_root.penaltyCounter--;
SetInfo(_root.penaltyCounter);
NextBubblemc1.targetscale = 100 * SizeFactor;
_global.BubblesFlying--;
this.removeMovieClip();
return(undefined);
}
if (!this.MyFirstFrame) {
this._y = this._y + (this.yv * 0.5);
this._x = this._x + (this.xv * 0.5);
} else {
this.MyFirstFrame = false;
}
if (testhit(this._x, this._y)) {
var _local8 = Math.round(gety(this._x - _root.grid._x, this._y - _root.grid._y) / tileW) - 1;
var _local9 = _local8 + 2;
var _local6 = Math.round(getx(this._x - _root.grid._x, this._y - _root.grid._y) / tileH) - 1;
var _local7 = _local6 + 2;
BestName = "";
bestDist = 9999999 /* 0x98967F */;
var _local5 = _local8;
while (_local5 <= _local9) {
var _local4 = _local6;
while (_local4 <= _local7) {
if (!_root.grid[(("t_" + _local5) + "_") + _local4]) {
ddd222 = dist2(_root.grid._x + setx(_local4 * tileW, _local5 * tileH), _root.grid._y + sety(_local4 * tileW, _local5 * tileH), this._x, this._y);
if (bestDist > ddd222) {
bestDist = ddd222;
Bestii = _local5;
Bestjj = _local4;
}
}
_local4++;
}
_local5++;
}
oldpoints = getpoints();
AttachBubble(this.myContents, Bestii, Bestjj, (("t_" + Bestii) + "_") + Bestjj, this.xv, this.yv, true);
if (oldpoints >= getpoints()) {
penaltyCounter--;
}
SetInfo(penaltyCounter);
_global.BubblesFlying--;
setNextBubble();
this.removeMovieClip();
return(undefined);
}
this._y = this._y + (this.yv * 0.5);
this._x = this._x + (this.xv * 0.5);
if (testhit(this._x, this._y)) {
var _local8 = Math.round(gety(this._x - _root.grid._x, this._y - _root.grid._y) / tileH) - 1;
var _local9 = _local8 + 2;
var _local6 = Math.round(getx(this._x - _root.grid._x, this._y - _root.grid._y) / tileW) - 1;
var _local7 = _local6 + 2;
BestName = "";
bestDist = 9999999 /* 0x98967F */;
var _local5 = _local8;
while (_local5 <= _local9) {
var _local4 = _local6;
while (_local4 <= _local7) {
if (!_root.grid[(("t_" + _local5) + "_") + _local4]) {
ddd222 = dist2(_root.grid._x + setx(_local4 * tileW, _local5 * tileH), _root.grid._y + sety(_local4 * tileW, _local5 * tileH), this._x, this._y);
if (bestDist > ddd222) {
bestDist = ddd222;
Bestii = _local5;
Bestjj = _local4;
}
}
_local4++;
}
_local5++;
}
oldpoints = getpoints();
AttachBubble(this.myContents, Bestii, Bestjj, (("t_" + Bestii) + "_") + Bestjj, this.xv, this.yv, true);
if (oldpoints >= getpoints()) {
penaltyCounter--;
}
SetInfo(penaltyCounter);
_global.BubblesFlying--;
setNextBubble();
this.removeMovieClip();
return(undefined);
}
}
if ((this._x - _root.GridCenterX) < (_root.leftBound + (tileW / 2))) {
this._x = (_root.leftBound + (tileW / 2)) + _root.GridCenterX;
this.xv = Math.abs(this.xv);
this.numberOfBounces++;
}
if ((this._x - _root.GridCenterX) > (_root.rightBound - (tileW / 2))) {
this._x = (_root.rightBound - (tileW / 2)) + _root.GridCenterX;
this.xv = -Math.abs(this.xv);
this.numberOfBounces++;
}
if (((this._y - _root.GridCenterY) < (_root.upperBound + (tileH / 2))) && (this.currentage > 20)) {
this._y = (_root.upperBound + (tileH / 2)) + _root.GridCenterY;
this.yv = Math.abs(this.yv);
this.numberOfBounces++;
}
if ((this._y - _root.GridCenterY) > (_root.lowerBound - (tileH / 2))) {
this._y = (_root.lowerBound - (tileH / 2)) + _root.GridCenterY;
this.yv = -Math.abs(this.yv);
this.numberOfBounces++;
}
};
}
function ThrowPoints(numbertothrow, xthrow, ythrow, alkupmovie) {
if (numbertothrow < 0) {
scoreEffects.attachMovie("ScoreEffectMinus", "ScoreEffect" + PointsThrown, 700000 + PointsThrown);
} else {
scoreEffects.attachMovie("ScoreEffectPlus", "ScoreEffect" + PointsThrown, 700000 + PointsThrown);
}
scoreEffects["ScoreEffect" + PointsThrown]._x = xthrow;
scoreEffects["ScoreEffect" + PointsThrown]._y = ythrow;
scoreEffects["ScoreEffect" + PointsThrown]._xscale = 150;
scoreEffects["ScoreEffect" + PointsThrown]._yscale = 150;
if (numbertothrow > 0) {
scoreEffects["ScoreEffect" + PointsThrown].Scoreaddition = "+" + numbertothrow;
} else {
scoreEffects["ScoreEffect" + PointsThrown].Scoreaddition = numbertothrow;
}
scoreEffects["ScoreEffect" + PointsThrown].onEnterFrame = function () {
this._xscale = this._xscale + 1;
this._yscale = this._yscale + 1;
this._alpha = this._alpha - 1.5;
if (this._alpha < 1.5) {
this.removeMovieClip();
}
};
PointsThrown++;
scoreEffects.attachMovie("file" + alkupmovie.myContents, "ScoreEffect" + PointsThrown, 700000 + PointsThrown);
scoreEffects["ScoreEffect" + PointsThrown]._x = xthrow;
scoreEffects["ScoreEffect" + PointsThrown]._y = ythrow;
scoreEffects["ScoreEffect" + PointsThrown]._rotation = alkupmovie._rotation + grid._rotation;
scoreEffects["ScoreEffect" + PointsThrown].xv = (Math.random() * 10) - 5;
scoreEffects["ScoreEffect" + PointsThrown].yv = (Math.random() * 10) - 5;
scoreEffects["ScoreEffect" + PointsThrown].onEnterFrame = function () {
this._xscale = this._xscale - 2;
this._yscale = this._yscale - 2;
this._alpha = this._alpha - 1.5;
this._x = this._x + this.xv;
this._y = this._y + this.yv;
this._rotation = this._rotation + (this.xv * 10);
this.yv = this.yv + 1;
if (this._alpha < 1.5) {
this.removeMovieClip();
}
};
PointsThrown++;
}
function ThrowAwayBubbleEffect(xthrow, ythrow, alkupmovie) {
scoreEffects.attachMovie("file" + alkupmovie.myContents, "ScoreEffect" + PointsThrown, 700000 + PointsThrown);
scoreEffects["ScoreEffect" + PointsThrown]._x = xthrow;
scoreEffects["ScoreEffect" + PointsThrown]._y = ythrow;
scoreEffects["ScoreEffect" + PointsThrown]._rotation = alkupmovie._rotation + _root.grid._rotation;
scoreEffects["ScoreEffect" + PointsThrown].xv = (Math.random() * 10) - 5;
scoreEffects["ScoreEffect" + PointsThrown].yv = (Math.random() * 10) - 5;
scoreEffects["ScoreEffect" + PointsThrown].onEnterFrame = function () {
this._xscale = this._xscale - 2;
this._yscale = this._yscale - 2;
this._alpha = this._alpha - 1.5;
this._x = this._x + this.xv;
this._y = this._y + this.yv;
this._rotation = this._rotation + (this.xv * 10);
this.yv = this.yv + 1;
if (this._alpha < 1.5) {
this.removeMovieClip();
}
};
PointsThrown++;
}
function ThrowParticles(xthrow, ythrow) {
scoreEffects.attachMovie("file3", "ScoreEffect" + PointsThrown, 700000 + PointsThrown);
scoreEffects["ScoreEffect" + PointsThrown]._x = xthrow;
scoreEffects["ScoreEffect" + PointsThrown]._y = ythrow;
scoreEffects["ScoreEffect" + PointsThrown]._xscale = 50;
scoreEffects["ScoreEffect" + PointsThrown]._yscale = 50;
scoreEffects["ScoreEffect" + PointsThrown].xv = (Math.random() * 10) - 5;
scoreEffects["ScoreEffect" + PointsThrown].yv = (Math.random() * 10) - 5;
if (xthrow < -250) {
scoreEffects["ScoreEffect" + PointsThrown].xv = scoreEffects["ScoreEffect" + PointsThrown].xv + 4;
}
if (xthrow > 250) {
scoreEffects["ScoreEffect" + PointsThrown].xv = scoreEffects["ScoreEffect" + PointsThrown].xv - 4;
}
if (ythrow > 250) {
scoreEffects["ScoreEffect" + PointsThrown].yv = scoreEffects["ScoreEffect" + PointsThrown].yv - 4;
}
scoreEffects["ScoreEffect" + PointsThrown].onEnterFrame = function () {
this._xscale = this._xscale - 2;
this._yscale = this._yscale - 2;
this._alpha = this._alpha - 1.5;
this._x = this._x + this.xv;
this._y = this._y + this.yv;
this._rotation = this._rotation + (this.xv * 10);
this.yv = this.yv + 1;
if (this._alpha < 1.5) {
this.removeMovieClip();
}
};
PointsThrown++;
}
function ThrowError(xthrow, ythrow) {
aj = 0;
while (aj < 30) {
ThrowParticles(xthrow, ythrow);
aj++;
}
}
function initGrid() {
i = 0;
while (i <= 10) {
_root["howmanyOfThisColor" + i] = 0;
i++;
}
i = 0;
while (i <= NumberOfColors) {
_root["howmanyOfThisColor" + i] = 1;
i++;
}
i = StartingSizeOfHexagon - 1;
while (i > 0) {
j = 0;
while (j < (((2 * StartingSizeOfHexagon) - 1) - i)) {
setBubbleManually(-i, (((-StartingSizeOfHexagon) + 1) + i) + j, ourRandomNumber());
j++;
}
j = 0;
while (j < (((StartingSizeOfHexagon * 2) - 1) - i)) {
setBubbleManually(i, ((StartingSizeOfHexagon - 1) - i) - j, ourRandomNumber());
j++;
}
i--;
}
j = 0;
while (j < ((StartingSizeOfHexagon * 2) - 1)) {
setBubbleManually(0, ((-StartingSizeOfHexagon) + 1) + j, ourRandomNumber());
j++;
}
grid.t_0_0.removeMovieClip();
grid.attachMovie("tileBomb", "t_0_0", grid.getNextHighestDepth());
grid.t_0_0.myContents = -1;
grid.t_0_0._xscale = (grid.t_0_0._yscale = SizeFactor * 100);
setBubbleManually(-1, 0, (1 % NumberOfColors) + 1);
setBubbleManually(1, 0, (2 % NumberOfColors) + 1);
setBubbleManually(0, 1, (3 % NumberOfColors) + 1);
setBubbleManually(0, -1, (4 % NumberOfColors) + 1);
setBubbleManually(1, -1, (5 % NumberOfColors) + 1);
setBubbleManually(-1, 1, (6 % NumberOfColors) + 1);
}
BubblesPerPenalty = 10;
SizeFactor = 0.75006;
BubbleSpeed = 20.835;
StartingSizeOfHexagon = 6;
NumberOfColors = 2;
GridCenterX = 250.02;
GridCenterY = 291.69;
multiplierText = "";
PointMultiplier = 1;
IsShrinking = false;
currentColorArrow = {rb:1, gb:152, bb:106};
newColorArrow = {rb:1, gb:152, bb:106};
ArrowHeight = 100;
EncryptedPoints = 0;
Factor_a = random(1000) + 1;
Factor_b = random(100) + 1;
lowerBound = 241.686;
upperBound = -241.686;
leftBound = -241.686;
rightBound = 241.686;
GridRotatingSpeed = 0;
BubblesAttached = 0;
_global._global.BubblesFlying = 0;
Arrow._x = GridCenterX;
NextBubble1 = 1;
NextBubble2 = 2;
NextBubble3 = 1;
_root.sideBar._y = -100;
BFSindex = 0;
axis1x = 1;
axis1y = 0;
axis2x = 0.5;
axis2y = 0.866025403784439;
tileW = 34 * SizeFactor;
tileH = 34 * SizeFactor;
_global.mouseIsDown = false;
_root.onMouseDown = function () {
_global.mouseIsDown = true;
};
_root.onMouseUp = function () {
_global.mouseIsDown = false;
};
_root.onEnterFrame = function () {
_root.sideBar._y = (0.9 * _root.sideBar._y) + 24.33528;
framesCounted++;
if (framesCounted >= 30) {
framerate = (1000 * (framesCounted * 1)) / ((1 * (getTimer() - frameStartTime)) + 0.001);
frameStartTime = getTimer();
framesCounted = 0;
}
if (!_global.gameon) {
if (_global.DoHighScoresCall == true) {
_global.DoHighScoresCall = false;
_root.doHighScores();
trace("**************** game Over HighScores called. *************");
}
} else {
if ((BubblesAttached == 1) && (IsShrinking == false)) {
IsShrinking = true;
grid.targetscale = 0;
}
if ((IsShrinking == true) && (grid._xscale < 2)) {
IsShrinking = false;
grid._xscale = (grid._yscale = 0);
grid.targetscale = 100;
PointMultiplier = PointMultiplier + 1;
NumberOfColors = Math.min(6, 2 + PointMultiplier);
initGrid();
multiplierText = PointMultiplier + "x";
}
grid._xscale = (grid._yscale = (0.95 * grid._xscale) + (0.05 * grid.targetscale));
i = 1;
while (i <= 10) {
if (this["wastage" + i]) {
this["wastage" + i]._rotation = Math.sin((getTimer() / 1800) + (i * 0.2)) * 200;
this["wastage" + i]._alpha = (this["wastage" + i]._alpha * 0.95) + (this["wastage" + i].targetalpha * 0.05);
this["wastage" + i]._xscale = (this["wastage" + i]._yscale = (this["wastage" + i]._xscale * 0.95) + (this["wastage" + i].targetscale * 0.05));
}
i++;
}
GridRotatingSpeed = GridRotatingSpeed * 0.97;
if (_root._ymouse > ((GridCenterY + upperBound) + 5)) {
Arrow._rotation = (Math.atan2(_root._ymouse - Arrow._y, _root._xmouse - Arrow._x) / 3.14159) * 180;
}
_root.Arrow2._rotation = _root.Arrow._rotation;
if ((((((!IsShrinking) && (_global.mouseIsDown)) && (_root._ymouse > ((GridCenterY + upperBound) + 5))) && (Math.abs(GridRotatingSpeed) < 2)) && (_global.BubblesFlying == 0)) && (_root.infoScreen._visible == false)) {
MouseFollower._x = _root._xmouse;
MouseFollower._y = _root._ymouse;
if (!MouseFollower.hitTest(mutebutton)) {
shoot();
bubblePop = new Sound(_root);
bubblePop.attachSound("FOLEY WHIP WHOOSH DOUBLE ALUMINUM ROD 01");
bubblePop.start(0, 1);
_global.mouseIsDown = false;
}
}
if (penaltyCounter == 0) {
whoosi = new Sound(_root);
whoosi.attachSound("ropes_whoosh");
whoosi.start(0, 1);
i = 0;
while (i < BubblesPerPenalty) {
shootrandom();
i++;
}
penaltyLimit--;
if (penaltyLimit == 0) {
penaltyLimit = 6;
}
penaltyCounter = penaltyLimit;
SetInfo(penaltyCounter);
}
grid._x = GridCenterX;
grid._y = GridCenterY;
grid._rotation = grid._rotation + GridRotatingSpeed;
ang = (grid._rotation * 3.14159265) / 180;
axis1x = Math.cos(ang);
axis1y = Math.sin(ang);
axis2x = Math.cos(ang + 1.04719733333333);
axis2y = Math.sin(ang + 1.04719733333333);
}
if (_global.gameon) {
Score = "" + Math.round(tempPoints);
tempPoints = (0.93 * tempPoints) + (0.07 * getpoints());
if ((getpoints() > 0) && (oldpo < getpoints())) {
bubblePop = new Sound(this);
bubblePop.attachSound("bubble");
bubblePop.start(0, 1);
}
oldpo = getpoints();
}
if ((GameOver == true) && (_global.gameon == true)) {
trace("********* do end screen stuff *******");
whoosh = new Sound(_root);
whoosh.attachSound("Descending Gamey Blip");
whoosh.start(0, 1);
_global.gameon = false;
if (_root.infoScreen._visible == true) {
_root.infoScreen.killme = true;
}
_global.DoHighScoresCall = true;
}
};
init();
stop();
Instance of Symbol 109 MovieClip [Arrow] "Arrow2" in Frame 7
onClipEvent (enterFrame) {
this._xscale = _root.Arrow._xscale;
this._yscale = _root.Arrow._yscale;
this._rotation = _root.Arrow._rotation;
}
Instance of Symbol 109 MovieClip [Arrow] "Arrow" in Frame 7
onClipEvent (load) {
myColor = new Color(this);
myColor.setTransform(_root.currentColorArrow);
ease = 1;
}
onClipEvent (enterFrame) {
_root.Arrow2._xscale = _root.Arrow._xscale;
_root.Arrow2._yscale = _root.Arrow._yscale;
_root.Arrow2._rotation = _root.Arrow._rotation;
_root.currentColorArrow.rb = _root.currentColorArrow.rb + ((_root.newColorArrow.rb - _root.currentColorArrow.rb) / ease);
_root.currentColorArrow.gb = _root.currentColorArrow.gb + ((_root.newColorArrow.gb - _root.currentColorArrow.gb) / ease);
_root.currentColorArrow.bb = _root.currentColorArrow.bb + ((_root.newColorArrow.bb - _root.currentColorArrow.bb) / ease);
_root.ArrowHeight = _root.ArrowHeight + ((100 - _root.ArrowHeight) / 5);
this._xscale = _root.ArrowHeight;
myColor.setTransform(_root.currentColorArrow);
}
Instance of Symbol 196 MovieClip "infoScreen" in Frame 7
on (release) {
effectSound = new Sound(this);
effectSound.attachSound("Clicki");
effectSound.start(0, 1);
this.killme = true;
}
onClipEvent (enterFrame) {
if (this._visible) {
if (this.killme) {
this._alpha = this._alpha - 10;
}
if (this._alpha <= 0) {
this._alpha = 100;
this.killme = false;
this._visible = false;
}
}
}
Instance of Symbol 109 MovieClip [Arrow] "Arrow" in Frame 8
onClipEvent (load) {
myColor = new Color(this);
myColor.setTransform(_root.currentColorArrow);
ease = 1;
}
onClipEvent (enterFrame) {
_root.currentColorArrow.rb = _root.currentColorArrow.rb + ((_root.newColorArrow.rb - _root.currentColorArrow.rb) / ease);
_root.currentColorArrow.gb = _root.currentColorArrow.gb + ((_root.newColorArrow.gb - _root.currentColorArrow.gb) / ease);
_root.currentColorArrow.bb = _root.currentColorArrow.bb + ((_root.newColorArrow.bb - _root.currentColorArrow.bb) / ease);
_root.ArrowHeight = _root.ArrowHeight + ((100 - _root.ArrowHeight) / 5);
this._xscale = _root.ArrowHeight;
myColor.setTransform(_root.currentColorArrow);
}
Frame 11
_global.gameon = false;
stop();
Frame 16
gotoAndPlay ("Start");
Symbol 204 MovieClip Frame 1
if (yy.savescore == 1) {
if (ipb_score == undefined) {
ipb_score = eval (_global.ipb_scoreVar);
}
xx = new LoadVars();
xx.arcadegid = _root.ibpro_gameid;
xx.gscore = ipb_score;
xx.gname = _global.ipb_get_gname();
xx.enscore = (ipb_score * yy.randchar) ^ yy.randchar2;
xx.send("index.php?autocom=arcade&do=savescore", "_self", "POST");
stop();
}
_global.ipbSend = function (ipb_score) {
_root._visible = false;
_root.enabled = false;
xx = new LoadVars();
yy = new LoadVars();
xx.sendAndLoad("index.php?autocom=arcade&do=verifyscore", yy, "POST");
};
Symbol 21 MovieClip [tile9] Frame 1
stop();
Symbol 23 MovieClip [tile8] Frame 1
stop();
Symbol 25 MovieClip [file7] Frame 1
stop();
Symbol 26 MovieClip [tile7] Frame 1
stop();
Symbol 28 MovieClip [tile6] Frame 1
stop();
Symbol 30 MovieClip [tile5] Frame 1
stop();
Symbol 32 MovieClip [tile1] Frame 1
stop();
Symbol 34 MovieClip [file8] Frame 1
stop();
Symbol 36 MovieClip [tile4] Frame 1
stop();
Symbol 38 MovieClip [tile3] Frame 1
stop();
Symbol 40 MovieClip [filex] Frame 1
stop();
Symbol 42 MovieClip [file9] Frame 1
stop();
Symbol 44 MovieClip [tile2] Frame 1
stop();
Symbol 46 MovieClip [tilenuclear] Frame 1
stop();
Symbol 52 Button
on (release) {
if ((_root.endScreen.publishingTime + 1000) < getTimer()) {
effectSound = new Sound();
effectSound.attachSound("Clicki");
effectSound.start(0, 1);
this._visible = false;
_root.init();
}
}
Symbol 54 MovieClip Frame 1
if (_root.ollaankodeadwhalessa) {
isonappi._visible = false;
}
Symbol 55 MovieClip [EndScreen] Frame 10
stop();
Symbol 57 MovieClip [tile_show_on] Frame 1
stop();
Symbol 62 MovieClip Frame 1
stop();
Symbol 63 MovieClip [tile] Frame 8
stop();
Symbol 63 MovieClip [tile] Frame 16
stop();
Symbol 96 MovieClip [Tausta] Frame 1
function onEnterFrame() {
aikakerroin = (getTimer() - edellinenaika) / 33;
edellinenaika = getTimer();
if (this._visible) {
this._alpha = this._alpha - (1 * aikakerroin);
}
if (this._alpha < 0) {
this._visible = false;
}
}
edellinenaika = 0;
stop();
Symbol 120 Button
on (release) {
effectSound = new Sound(this);
effectSound.attachSound("Clicki");
effectSound.start(0, 1);
if (_root.infoScreen._visible == false) {
_root.infoScreen._visible = true;
_root.infoScreen.killme = false;
_root.infoScreen.gotoAndPlay(1);
infoScreenPublished = getTimer();
} else {
_root.infoScreen.killme = true;
}
}
Symbol 128 MovieClip [file6] Frame 1
stop();
Symbol 130 MovieClip [file5] Frame 1
stop();
Symbol 132 MovieClip [file4] Frame 1
stop();
Symbol 134 MovieClip [file3] Frame 1
stop();
Symbol 136 MovieClip [file2] Frame 1
stop();
Symbol 138 MovieClip [file1] Frame 1
stop();
Symbol 141 MovieClip [tileBomb] Frame 1
stop();
Symbol 203 MovieClip [__Packages.SdkApiAS2] Frame 0
class SdkApiAS2
{
var cThisParent, cReturnFunction, cSDKClientLocalConnectionName, cSDKManagerLocalConnectionName, cLocalConnection, cIntervalId, cSendLocalConnection;
function SdkApiAS2 (pThisParent, pReturnFunction) {
debugTrace("AG SDK AS2 API version 1.05");
cThisParent = pThisParent;
var _local4;
var _local3;
cReturnFunction = pReturnFunction;
System.security.allowDomain("*");
System.security.allowInsecureDomain("*");
debugTrace("Passed in URL with query " + cThisParent._url);
_local4 = cThisParent._url;
_local3 = _local4.indexOf(SDK_CLIENT_SWF_LC_QUERY_ELEMENT);
if (_local3 <= -1) {
callReturnFunction("Error: No SDK Client localConnectionID .SWF URL Query", null);
return;
}
cSDKClientLocalConnectionName = _local4.substr(_local3 + SDK_CLIENT_SWF_LC_QUERY_ELEMENT.length);
if ((cSDKClientLocalConnectionName == "") || (cSDKClientLocalConnectionName == undefined)) {
callReturnFunction("Error: Bad localConnectionID .SWF URL Query ID", null);
return;
}
debugTrace("SDK LC Names: " + cSDKClientLocalConnectionName);
_local3 = cSDKClientLocalConnectionName.indexOf(SDK_MANAGER_SWF_LC_QUERY_ELEMENT);
if (_local3 <= -1) {
callReturnFunction("Error: No SDK Manager localConnectionID .SWF URL Query", null);
return;
}
cSDKManagerLocalConnectionName = cSDKClientLocalConnectionName.substr(_local3 + SDK_MANAGER_SWF_LC_QUERY_ELEMENT.length);
if ((cSDKManagerLocalConnectionName == "") || (cSDKManagerLocalConnectionName == undefined)) {
callReturnFunction("Error: Bad localConnectionID .SWF URL Query ID", null);
return;
}
_local3 = cSDKClientLocalConnectionName.indexOf("&");
if (_local3 <= -1) {
callReturnFunction("Error: No & in queryString bewteen LC names in .SWF URL Query", null);
return;
}
cSDKClientLocalConnectionName = cSDKClientLocalConnectionName.substring(0, _local3);
debugTrace("Manager LC: " + cSDKManagerLocalConnectionName);
clearSendLocalConnection(true);
cLocalConnection = new LocalConnection();
cLocalConnection.allowDomain = function (sendingDomain) {
return(true);
};
cLocalConnection.onStatus = function (sendingDomain) {
};
var _this = this;
cLocalConnection[SDK_CLIENT_RECIEVE_FUNCTION] = function () {
_this.theReceive.apply(_this, arguments);
};
cLocalConnection.allowDomain("*");
cLocalConnection.connect(cSDKClientLocalConnectionName);
callAPIFunction = true;
callSDKusingLocalConnection(new Array("stageGood", RETURN_FUNCTION_ID + "sDKInit"));
}
function sDKInit(pResultObject) {
debugTrace("SDK Manager Found");
callReturnFunction("OK", null);
}
function noShellTimeOut() {
clearInterval(cIntervalId);
callReturnFunction("Error: no Shell found, TimeOut called", null);
}
function clearSendLocalConnection(pClearReceive) {
if (cSendLocalConnection != null) {
cSendLocalConnection.close();
cSendLocalConnection = null;
}
if (pClearReceive == true) {
if (cLocalConnection != null) {
cLocalConnection.close();
cLocalConnection = null;
}
}
}
function callSDKusingLocalConnection(pDataObjectArray) {
debugTrace("Attempting SDK Connect Call Comand " + pDataObjectArray[0]);
cSDKloadTryCount++;
if (cSDKloadTryCount > MAX_LOCAL_CONNECTION_TRY_COUNT) {
callReturnFunction("Error: connect failed to many tries", null);
return(undefined);
}
cIntervalId = setInterval(this, "noShellTimeOut", cDuration);
clearSendLocalConnection(false);
cSendLocalConnection = new LocalConnection();
cSendLocalConnection.allowDomain = function (sendingDomain) {
return(true);
};
cSendLocalConnection.onStatus = function (sendingDomain) {
};
debugTrace("Send to LC Name: " + cSDKManagerLocalConnectionName);
if (cSendLocalConnection.send(cSDKManagerLocalConnectionName, SDK_MANAMGER_RECIEVE_FUNCTION, pDataObjectArray, cSDKClientLocalConnectionName) == false) {
callReturnFunction("Error: Local Connection Send Failed", null);
}
}
function theReceive() {
var _local3;
var _local4;
clearInterval(cIntervalId);
_local3 = arguments[0];
_local4 = arguments[1];
debugTrace("the Recieve, returnFunction " + _local3);
if (callAPIFunction == true) {
callAPIFunction = false;
this[_local3].apply(this, new Array(_local4));
} else {
debugTrace("Return Function: " + _local3);
debugTrace("pReturnObject.result: " + _local4.result);
cReturnFunction = _local3;
callReturnFunction(_local4.result, _local4.object);
}
}
function serverTimeOut() {
clearInterval(cIntervalId);
callReturnFunction("Error: Server timed out. Try Again.", null);
}
function AGsetAndLoadToolbar(pBarFunctions, pReturnFunction) {
cSDKloadTryCount = 0;
pReturnFunction = RETURN_FUNCTION_ID + pReturnFunction;
debugTrace("AGsetAndLoadToolbar");
debugTrace("first pbar function" + pBarFunctions.gameRestart);
callSDKusingLocalConnection(new Array(AG_SET_AND_LOAD_TOOLBAR, pBarFunctions, pReturnFunction));
}
function AGgameOver(pScoreObject, pGameReturnFunction) {
cSDKloadTryCount = 0;
pGameReturnFunction = RETURN_FUNCTION_ID + pGameReturnFunction;
debugTrace("AGgameover Called. The Score: " + pScoreObject.score);
callSDKusingLocalConnection(new Array("AGgameOver", pScoreObject, pGameReturnFunction));
}
function debugTrace(pDebugText) {
if (cTurnOnDebugTrace == true) {
trace("14: " + pDebugText);
}
}
function callReturnFunction(pResult, pObject) {
debugTrace("callReturnFunction result = " + pResult);
if (cReturnFunction != null) {
debugTrace("called return function");
cReturnObject.result = pResult;
cReturnObject.object = pObject;
cThisParent[cReturnFunction].apply(cThisParent, new Array(cReturnObject));
}
return(undefined);
}
function freeAll() {
clearSendLocalConnection(true);
}
var SDK_CLIENT_SWF_LC_QUERY_ELEMENT = "SDKClientLCID=";
var SDK_MANAGER_SWF_LC_QUERY_ELEMENT = "SDKManagerLCID=";
var SDK_CLIENT_LC_NAME = "_SDKClientLocalConnection";
var SDK_MANAGER_LC_NAME = "_SDKManagerLocalConnection";
var SDK_CLIENT_RECIEVE_FUNCTION = "ReceiveHandler";
var SDK_MANAMGER_RECIEVE_FUNCTION = "ReceiveHandler";
var JUMP_OVER_HTTP = 8;
var SERVER_REQUEST_TIMEOUT = 30;
var DOWNLOAD_TIME = 30;
var MAX_LOCAL_CONNECTION_TRY_COUNT = 2;
var RETURN_FUNCTION_ID = "XUFunctionXUName";
var DEFAULT_CONFIG_FILE_PATH_AND_NAME = "/sdkmanager/config/?c&s=ag";
var DEVELOPER_CONFIG_URL = "http://dev.addictingGames.com/sdkmanager/config/sdkManagerConfig.xml";
var GET_ELEMENT_FROM_FLASHVARS = "FlashVars";
var GAME_AG_HTML_URL_FV = "gamehtmlurl";
var GET_ELEMENT_FROM_CONFIG_XML = "XML";
var GAME_DEFINE_ELEMENT_XML = "GameDefine";
var DEBUG_ELEMENT_XML = "RShardRating";
var GAME_ID_ELEMENT_XML = "GameID";
var LOAD_CONFIG_TRY_COUNT = 2;
var AS3_CALL_CODE = "AGAs3Call";
var AGTOOLBAR_LOGO_HOTLINKED = "AGLogoHotLinked";
var AGTEASER_HOTLINKED = "TeaserTargetURL";
var TRUE_STRING = "true";
var AG_SET_AND_LOAD_TOOLBAR = "AGsetAndLoadToolbar";
var TEASER_URL = "TeaserURL";
var GAME_TITLE_ELEMENT_XML = "GameTitle";
var AVATAR_PATH = "avatarpath";
var LOAD_POLICY_INFORMATION = true;
var DONT_LOAD_POLICY_INFORMATION = true;
var cReturnObject = {result:null, object:null};
var cTurnOnDebugTrace = true;
var cDuration = 1000;
var cServercDuration = 60000;
var cSDKloadTryCount = 0;
var callAPIFunction = false;
}
Symbol 153 Button
on (release) {
effectSound = new Sound(this);
effectSound.attachSound("Clicki");
effectSound.start(0, 1);
gotoAndPlay ("Main");
}
Symbol 156 Button
on (release) {
effectSound = new Sound(this);
effectSound.attachSound("Clicki");
effectSound.start(0, 1);
gotoAndPlay ("Main");
}
Symbol 171 Button
on (press) {
getURL ("http://www.addictinggames.com", blank);
}
Symbol 196 MovieClip Frame 10
stop();
Symbol 201 Button
on (release) {
effectSound = new Sound(this);
effectSound.attachSound("Clicki");
effectSound.start(0, 1);
getURL ("http://www.deadwhale.com", "_blank");
}