Frame 1
stop();
Instance of Symbol 16 MovieClip in Frame 1
onClipEvent (enterFrame) {
xstep = _xmouse / 50;
ystep = _ymouse / 50;
_x = (_x + xstep);
_y = (_y + ystep);
}
Instance of Symbol 27 MovieClip in Frame 1
onClipEvent (load) {
status = "loading...";
}
onClipEvent (enterFrame) {
myPercentLoaded = int((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
_root.bytesLoaded = int(_root.getBytesLoaded());
_root.bytesTotal = int(_root.getBytesTotal());
if (myPercentLoaded == 100) {
status = "loaded!";
ystep = (600 - _y) / 10;
_y = (_y + ystep);
}
if (_y >= 590) {
_root.play();
}
}
Instance of Symbol 34 MovieClip in Frame 1
onClipEvent (load) {
this.swapDepths(9999);
}
Frame 2
musicOn = true;
sugarRush = false;
gameScore = 0;
_root.myurl = _root._url;
_root.domain1 = _root.myurl.substring(0, 28);
_root.domain2 = _root.myurl.substring(0, 27);
_root.domain3 = _root.myurl.substring(0, 31);
if (((_root.domain1 == "http://www.mindistortion.net") || (_root.domain2 == "http://www.mindistortion.tv")) || (_root.domain3 == "http://mindistortion.finito.net")) {
atHome = true;
} else {
atHome = false;
}
Frame 8
stop();
Frame 38
stop();
function onePlayer() {
numPlayers = 1;
gotoAndStop ("init_game");
}
function twoPlayer() {
numPlayers = 2;
gotoAndStop ("init_game");
}
function moreGames() {
getURL ("http://www.mindistortion.tv/?p=games", "_blank");
}
function instructions() {
gotoAndStop (39);
}
function credits() {
gotoAndStop (40);
}
function settings() {
gotoAndStop (41);
}
btn_1player.onRelease = function () {
onePlayer();
};
btn_1player.onReleaseOutside = function () {
onePlayer();
};
btn_2player.onRelease = function () {
twoPlayer();
};
btn_2player.onReleaseOutside = function () {
twoPlayer();
};
btn_moregames.onRelease = function () {
moreGames();
};
btn_moregames.onReleaseOutside = function () {
moreGames();
};
btn_instructions.onRelease = function () {
instructions();
};
btn_instructions.onReleaseOutside = function () {
instructions();
};
btn_credits.onRelease = function () {
credits();
};
btn_credits.onReleaseOutside = function () {
credits();
};
btn_settings.onRelease = function () {
settings();
};
btn_settings.onReleaseOutside = function () {
settings();
};
Instance of Symbol 16 MovieClip in Frame 38
onClipEvent (enterFrame) {
xstep = _xmouse / 50;
ystep = _ymouse / 50;
_x = (_x + xstep);
_y = (_y + ystep);
}
Frame 39
function back() {
gotoAndStop (38);
}
function powerUpLibrary() {
gotoAndStop (42);
}
btn_back.onRelease = function () {
back();
};
btn_back.onReleaseOutside = function () {
back();
};
btn_poweruplibrary.onRelease = function () {
powerUpLibrary();
};
btn_poweruplibrary.onReleaseOutside = function () {
powerUpLibrary();
};
Frame 40
function back() {
gotoAndStop (38);
}
function tracklist() {
getURL ("http://www.mindistortion.tv/tracklist/bubbles2", "_blank");
}
function ngaudio() {
getURL ("http://www.newgrounds.com/audio", "_blank");
}
btn_back.onRelease = function () {
back();
};
btn_back.onReleaseOutside = function () {
back();
};
btn_tracklist.onRelease = function () {
tracklist();
};
btn_tracklist.onReleaseOutside = function () {
tracklist();
};
btn_ngaudio.onRelease = function () {
ngaudio();
};
btn_ngaudio.onReleaseOutside = function () {
ngaudio();
};
Frame 41
function back() {
gotoAndStop (38);
}
btn_back.onRelease = function () {
back();
};
btn_back.onReleaseOutside = function () {
back();
};
if (atHome) {
clip_nosr._visible = false;
} else {
clip_sr._visible = false;
}
Frame 43
stop();
function newGame() {
this.createEmptyMovieClip("gameContainer", 1);
gameContainer.attachMovie("Game", "game", 1, {stageWidth:350, stageHeight:400, numPlayers:numPlayers});
}
newGame();
Frame 44
function mainMenu() {
gotoAndStop ("main_menu");
}
function playAgain() {
gotoAndStop ("init_game");
}
btn_mainmenu.onRelease = function () {
mainMenu();
};
btn_mainmenu.onReleaseOutside = function () {
mainMenu();
};
btn_playagain.onRelease = function () {
playAgain();
};
btn_playagain.onReleaseOutside = function () {
playAgain();
};
_root.myurl = _root._url;
_root.domain1 = _root.myurl.substring(0, 28);
_root.domain2 = _root.myurl.substring(0, 27);
_root.domain3 = _root.myurl.substring(0, 31);
if (((_root.domain1 == "http://www.mindistortion.net") || (_root.domain2 == "http://www.mindistortion.tv")) || (_root.domain3 == "http://mindistortion.finito.net")) {
gotoAndStop (48);
} else {
gotoAndStop (46);
}
Frame 46
function playHighscore() {
getURL ("http://www.mindistortion.tv/games/bubbles2", "_blank");
}
function moreGames() {
getURL ("http://www.mindistortion.tv/?p=games", "_blank");
}
btn_playhighscore.onRelease = function () {
playHighscore();
};
btn_playhighscore.onReleaseOutside = function () {
playHighscore();
};
btn_moregames.onRelease = function () {
moreGames();
};
btn_moregames.onReleaseOutside = function () {
moreGames();
};
Frame 47
stop();
Frame 49
stop();
Symbol 16 MovieClip Frame 1
stop();
Symbol 16 MovieClip Frame 2
stop();
Instance of Symbol 24 MovieClip in Symbol 27 MovieClip Frame 1
onClipEvent (enterFrame) {
_xscale = _parent.myPercentLoaded;
}
Symbol 32 MovieClip [md_link] Frame 1
function openSite() {
getURL ("http://www.mindistortion.tv", "_blank");
}
lnk.onRelease = function () {
openSite();
};
lnk.onReleaseOutside = function () {
openSite();
};
Symbol 401 MovieClip [__Packages.Background] Frame 0
class Background extends MovieClip
{
var distance, maxDistance, shade, light, wrapAround, p;
function Background () {
super();
}
function onLoad() {
distance = 0;
maxDistance = 12600;
shade._alpha = 100;
light._alpha = 0;
wrapAround._visible = false;
}
function onEnterFrame() {
if (distance < maxDistance) {
distance++;
}
p = Math.floor((100 * distance) / maxDistance);
shade._alpha = 100 - p;
light._alpha = p;
}
}
Symbol 402 MovieClip [__Packages.JukeBox] Frame 0
class JukeBox extends MovieClip
{
var music, track, targetVol;
function JukeBox () {
super();
}
function onLoad() {
stopAllSounds();
music = new Sound();
playTrack(track);
}
function playTrack(track) {
if (currTrack != track) {
currTrack = track;
music.attachSound(track);
music.stop();
if (currTrack != "pop.wav") {
music.start(0, 9999);
music.setVolume(0);
} else {
music.start(0, 0);
music.setVolume(100);
}
}
}
function setVol(v) {
targetVol = v;
}
function onEnterFrame() {
if (currTrack != "") {
var _local2 = (targetVol - music.getVolume()) / 15;
music.setVolume(music.getVolume() + _local2);
}
}
var currTrack = "";
}
Symbol 403 MovieClip [__Packages.Game] Frame 0
class Game extends MovieClip
{
var spawnSpeed, playerSpeed, currSpawn, maxSpawns, difficulty, defaultRadius, maxDifficulty, stageWidth, stageHeight, movMax, movAcc, movDec, bounce, initCooldown, pauseGame, pauseTrigger, numPlayers, p, s, _parent, bonusSpawnDelay, bonusSpawnTrigger, bonusSprites, bonusRarity, bonusTimerMax, bonusActive, bubblesOnly, druggy, noir, wrapAround, leaveTrail, projectiles, currProjectile, maxProjectiles, shootRecoil, createEmptyMovieClip, bg, playfield, msg, hud, ctrlStatus, usedKeys, oppositeKeys, ctrl, jukeBox, blur, bg_bmp, attachMovie;
function Game () {
super();
}
function onLoad() {
spawnSpeed = 1;
playerSpeed = 1;
currSpawn = 0;
maxSpawns = 70;
difficulty = 0;
defaultRadius = 7.65;
maxDifficulty = 3600;
stageWidth = 350;
stageHeight = 400;
movMax = 7.5;
movAcc = 0.5;
movDec = 1.2;
bounce = -0.3;
initCooldown = 20;
pauseGame = false;
pauseTrigger = true;
if (numPlayers < 1) {
numPlayers = 1;
}
p = new Array();
s = new Array();
var _local2 = 0;
while (_local2 < numPlayers) {
p[_local2] = new Object();
_local2++;
}
if (_parent._parent.sugarRush) {
bonusSpawnDelay = 30;
} else {
bonusSpawnDelay = 100;
}
bonusSpawnTrigger = 0;
bonusSprites = new Array();
bonusRarity = new Array();
bonusSprites[0] = "bubble_time";
bonusRarity[0] = 2;
bonusSprites[1] = "bouncy";
bonusRarity[1] = 2;
bonusSprites[2] = "speed";
bonusRarity[2] = 2;
bonusSprites[3] = "bubbles_only";
bonusRarity[3] = 3;
bonusSprites[4] = "druggy";
bonusRarity[4] = 5;
bonusSprites[5] = "invincible";
bonusRarity[5] = 5;
bonusSprites[6] = "noir";
bonusRarity[6] = 5;
bonusSprites[7] = "wraparound";
bonusRarity[7] = 3;
bonusSprites[8] = "agility";
bonusRarity[8] = 3;
bonusSprites[9] = "ultimate_bubble_time";
bonusRarity[9] = 9;
bonusSprites[10] = "shooter";
bonusRarity[10] = 5;
bonusSprites[11] = "repel";
bonusRarity[11] = 5;
bonusSprites[12] = "attract";
bonusRarity[12] = 5;
bonusTimerMax = 270;
bonusActive = new Array();
_local2 = 0;
while (_local2 < bonusSprites.length) {
bonusActive[bonusSprites[_local2]] = false;
_local2++;
}
bubblesOnly = false;
druggy = false;
noir = false;
wrapAround = false;
leaveTrail = false;
projectiles = new Array();
currProjectile = 0;
maxProjectiles = 32 * numPlayers;
shootRecoil = 0;
initCtrl();
initBackground();
initPlayers();
initHUD();
initSound();
}
function onEnterFrame() {
runCtrl();
if ((initCooldown < 1) && (!pauseGame)) {
if (difficulty < maxDifficulty) {
difficulty++;
}
spawn();
updatePositions();
for (var _local2 in p) {
if (p[_local2].alive) {
hitBoundary(p[_local2]);
hitSpawns(p[_local2]);
if (p[_local2].repel) {
repelMines(Number(_local2));
}
if (p[_local2].shooter) {
hitProjectiles();
}
if (p[_local2].attract) {
attractBubbles(Number(_local2));
}
}
}
if (numPlayers > 1) {
billard(p[0], p[1]);
}
render();
runBonus();
if (leaveTrail) {
runTrail();
}
} else {
initCooldown--;
}
}
function updatePositions() {
for (var _local3 in p) {
p[_local3].x = p[_local3].x + ((p[_local3].xStep * playerSpeed) * p[_local3].speed);
p[_local3].y = p[_local3].y + ((p[_local3].yStep * playerSpeed) * p[_local3].speed);
if (p[_local3].shooter) {
for (var _local2 in projectiles) {
if (projectiles[_local2].clip != undefined) {
projectiles[_local2].x = projectiles[_local2].x + (projectiles[_local2].xStep * playerSpeed);
projectiles[_local2].y = projectiles[_local2].y + (projectiles[_local2].yStep * playerSpeed);
projectiles[_local2].clip._x = projectiles[_local2].x;
projectiles[_local2].clip._y = projectiles[_local2].y;
if ((projectiles[_local2].y + projectiles[_local2].clip._height) < 0) {
projectiles[_local2].clip.removeMovieClip(this);
projectiles[_local2] = new Object();
}
}
}
}
}
for (var _local3 in s) {
if (s[_local3].clip != undefined) {
s[_local3].x = s[_local3].x + ((s[_local3].xStep + s[_local3].xForce) * spawnSpeed);
s[_local3].y = s[_local3].y + ((s[_local3].yStep + s[_local3].yForce) * spawnSpeed);
s[_local3].clip._x = s[_local3].x;
s[_local3].clip._y = s[_local3].y;
if ((s[_local3].y - s[_local3].clip._height) > stageHeight) {
s[_local3].clip.removeMovieClip(this);
s[_local3] = new Object();
}
}
}
}
function render() {
for (var _local2 in p) {
p[_local2].clip._x = p[_local2].x;
p[_local2].clip._y = p[_local2].y;
if (numPlayers > 1) {
p[_local2].marker._x = p[_local2].clip._x;
p[_local2].marker._y = p[_local2].clip._y;
p[_local2].marker._xscale = p[_local2].clip._xscale;
p[_local2].marker._yscale = p[_local2].clip._yscale;
}
}
}
function initBackground() {
createEmptyMovieClip("bg", 1);
bg.attachMovie("Background", "clip", 1);
bg._width = stageWidth;
bg._height = stageHeight;
}
function initPlayers() {
createEmptyMovieClip("playfield", 10);
createEmptyMovieClip("msg", 100);
for (var _local4 in p) {
var _local3 = "player" + _local4;
playfield.createEmptyMovieClip(_local3, _local4 + 5);
p[_local4].clip = playfield[_local3];
p[_local4].sprite = "bubble_basic";
p[_local4].clip.attachMovie(p[_local4].sprite, "sprite", 1);
if (numPlayers < 2) {
p[_local4].x = stageWidth / 2;
} else {
p[_local4].x = ((stageWidth / 2) + 50) - (_local4 * 100);
var _local2 = "marker" + _local4;
playfield.createEmptyMovieClip(_local2, _local4 + 7);
p[_local4].marker = playfield[_local2];
p[_local4].marker.attachMovie(("player" + _local4) + "_marker", "marker", 1);
p[_local4].marker._x = p[_local4].x;
p[_local4].marker._y = stageHeight - 100;
}
p[_local4].y = stageHeight - 100;
p[_local4].targetXscale = 100;
p[_local4].targetYscale = 100;
p[_local4].scale = 100;
p[_local4].xStep = 0;
p[_local4].yStep = 0;
p[_local4].movMax = movMax;
p[_local4].movAcc = movAcc;
p[_local4].movDec = movDec;
p[_local4].bounce = bounce;
p[_local4].speed = 1;
p[_local4].radius = p[_local4].clip._width / 2;
p[_local4].bonusTimer = new Array();
p[_local4].bonusSwitch = new Array();
p[_local4].bonusActive = new Array();
p[_local4].invincible = false;
p[_local4].bouncy = false;
p[_local4].shooter = false;
p[_local4].attract = false;
p[_local4].repel = false;
p[_local4].alive = true;
p[_local4].score = 0;
p[_local4].id = _local4;
p[_local4].clip._x = p[_local4].x;
p[_local4].clip._y = p[_local4].y;
}
}
function initHUD() {
createEmptyMovieClip("hud", 1000);
if (numPlayers > 1) {
msg.attachMovie("msg_lastbubblestanding", "msg", 1);
msg._x = stageWidth / 2;
msg._y = 100;
} else {
msg.attachMovie("msg_go!", "msg", 1);
msg._x = stageWidth / 2;
msg._y = 100;
}
if (numPlayers == 1) {
hud.timerDisplay = new Array();
hud.numTimers = 0;
hud.displayExists = new Array();
} else {
hud.timerDisplay = new Array();
hud.numTimers = new Array();
hud.displayExists = new Array();
var _local2 = 0;
while (_local2 < numPlayers) {
hud.timerDisplay[_local2] = new Array();
hud.numTimers[_local2] = 0;
hud.displayExists[_local2] = new Array();
_local2++;
}
}
hud.attachMovie("md_link", "md_link", 200);
hud.md_link._x = 5;
hud.md_link._y = 5;
hud.attachMovie("sound_ctrl", "sound_ctrl", 201);
hud.sound_ctrl._x = stageWidth - 7;
hud.sound_ctrl._y = 5;
var _local3 = "score_display0";
hud.attachMovie("score_display", _local3, 2001);
hud[_local3]._x = stageWidth - 5;
hud[_local3]._y = stageHeight - 5;
if (numPlayers == 2) {
_local3 = "score_display1";
hud.attachMovie("score_display2", _local3, 2002);
hud[_local3]._x = 5;
hud[_local3]._y = stageHeight - 5;
hud.attachMovie("hud_marker0", "marker0", 2010);
hud.marker0._x = 5;
hud.marker0._y = stageHeight - 5;
hud.attachMovie("hud_marker1", "marker1", 2011);
hud.marker1._x = stageWidth - 5;
hud.marker1._y = stageHeight - 5;
}
}
function initCtrl() {
ctrlStatus = new Array();
usedKeys = new Array();
usedKeys[0] = 38;
usedKeys[1] = 40;
usedKeys[2] = 39;
usedKeys[3] = 37;
usedKeys[4] = 83;
usedKeys[5] = 87;
usedKeys[6] = 65;
usedKeys[7] = 68;
usedKeys[8] = 32;
oppositeKeys = new Array();
oppositeKeys[38] = 40;
oppositeKeys[40] = 38;
oppositeKeys[39] = 37;
oppositeKeys[37] = 39;
oppositeKeys[83] = 87;
oppositeKeys[87] = 83;
oppositeKeys[68] = 65;
oppositeKeys[65] = 68;
ctrl = new Array();
var _local2 = 0;
while (_local2 < 2) {
ctrl[_local2] = new Object();
_local2++;
}
ctrl[0].up = 38;
ctrl[0].down = 40;
ctrl[0].left = 37;
ctrl[0].right = 39;
ctrl[1].up = 87;
ctrl[1].down = 83;
ctrl[1].left = 65;
ctrl[1].right = 68;
}
function runCtrl() {
for (var _local2 in usedKeys) {
if (Key.isDown(usedKeys[_local2])) {
ctrlStatus[usedKeys[_local2]] = true;
} else {
ctrlStatus[usedKeys[_local2]] = false;
}
}
if (((numPlayers == 1) && (p[0].alive)) || (((numPlayers == 2) && (p[0].alive)) && (p[1].alive))) {
if ((ctrlStatus[32] && (!pauseGame)) && (pauseTrigger)) {
pauseGame = true;
pauseTrigger = false;
playfield._visible = false;
msg.attachMovie("msg_pause", "msg", 1);
msg._x = stageWidth / 2;
msg._y = (stageHeight / 2) - 50;
} else if ((ctrlStatus[32] && (pauseGame)) && (pauseTrigger)) {
pauseGame = false;
pauseTrigger = false;
playfield._visible = true;
msg.msg.removeMovieClip(this);
}
}
if (!ctrlStatus[32]) {
pauseTrigger = true;
}
if (numPlayers == 1) {
if (ctrlStatus[ctrl[0].up] || (ctrlStatus[ctrl[1].up])) {
if (p[0].yStep > (-movMax)) {
p[0].yStep = p[0].yStep - p[0].movAcc;
}
} else if (ctrlStatus[ctrl[0].down] || (ctrlStatus[ctrl[1].down])) {
if (p[0].yStep < movMax) {
p[0].yStep = p[0].yStep + p[0].movAcc;
}
}
if (ctrlStatus[ctrl[0].left] || (ctrlStatus[ctrl[1].left])) {
if (p[0].xStep > (-movMax)) {
p[0].xStep = p[0].xStep - p[0].movAcc;
}
} else if (ctrlStatus[ctrl[0].right] || (ctrlStatus[ctrl[1].right])) {
if (p[0].xStep < movMax) {
p[0].xStep = p[0].xStep + p[0].movAcc;
}
}
if ((((!ctrlStatus[ctrl[0].up]) && (!ctrlStatus[ctrl[0].down])) && (!ctrlStatus[ctrl[1].up])) && (!ctrlStatus[ctrl[1].down])) {
p[0].yStep = p[0].yStep / p[0].movDec;
if ((p[0].yStep > -0.01) && (p[0].yStep < 0.01)) {
p[0].yStep = 0;
}
}
if ((((!ctrlStatus[ctrl[0].left]) && (!ctrlStatus[ctrl[0].right])) && (!ctrlStatus[ctrl[1].left])) && (!ctrlStatus[ctrl[1].right])) {
p[0].xStep = p[0].xStep / p[0].movDec;
if ((p[0].xStep > -0.01) && (p[0].xStep < 0.01)) {
p[0].xStep = 0;
}
}
}
if (numPlayers == 2) {
for (var _local2 in p) {
if (ctrlStatus[ctrl[_local2].up]) {
if (p[_local2].yStep > (-movMax)) {
p[_local2].yStep = p[_local2].yStep - p[_local2].movAcc;
}
} else if (ctrlStatus[ctrl[_local2].down]) {
if (p[_local2].yStep < movMax) {
p[_local2].yStep = p[_local2].yStep + p[_local2].movAcc;
}
}
if (ctrlStatus[ctrl[_local2].left]) {
if (p[_local2].xStep > (-movMax)) {
p[_local2].xStep = p[_local2].xStep - p[_local2].movAcc;
}
} else if (ctrlStatus[ctrl[_local2].right]) {
if (p[_local2].xStep < movMax) {
p[_local2].xStep = p[_local2].xStep + p[_local2].movAcc;
}
}
if ((!ctrlStatus[ctrl[_local2].up]) && (!ctrlStatus[ctrl[_local2].down])) {
p[_local2].yStep = p[_local2].yStep / p[_local2].movDec;
if ((p[_local2].yStep > -0.01) && (p[_local2].yStep < 0.01)) {
p[_local2].yStep = 0;
}
}
if ((!ctrlStatus[ctrl[_local2].left]) && (!ctrlStatus[ctrl[_local2].right])) {
p[_local2].xStep = p[_local2].xStep / p[_local2].movDec;
if ((p[_local2].xStep > -0.01) && (p[_local2].xStep < 0.01)) {
p[_local2].xStep = 0;
}
}
}
}
}
function runBonus() {
runHUD();
animBonus();
if ((p[0].bonusTimer[4] > 0) || (p[1].bonusTimer[4] > 0)) {
if (p[0].bonusSwitch[4] || (p[1].bonusSwitch[4])) {
for (var _local3 in p) {
if (p[_local3].alive) {
if (!p[_local3].shooter) {
p[_local3].sprite = "bonus_" + bonusSprites[4];
} else {
p[_local3].sprite = "bonus_shooter_" + bonusSprites[4];
}
p[_local3].clip.attachMovie(p[_local3].sprite, "sprite", 1);
}
if (p[_local3].bonusTimer[6] > 0) {
p[_local3].bonusTimer[6] = 0;
p[_local3].bonusSwitch[6] = false;
noir = false;
}
p[_local3].bonusSwitch[4] = false;
}
jukeBox.playTrack(bonusSprites[4] + ".wav");
bg.clip.gotoAndStop(2);
for (var _local2 in s) {
if (s[_local2].type == "bubble") {
s[_local2].sprite = "bonus_" + bonusSprites[4];
s[_local2].clip.attachMovie(s[_local2].sprite, "sprite", 1);
} else if (s[_local2].type == "mine") {
s[_local2].sprite = "mine_" + bonusSprites[4];
s[_local2].clip.attachMovie(s[_local2].sprite, "sprite", 1);
}
}
druggy = true;
}
for (var _local3 in p) {
if (p[_local3].bonusTimer[4] == 1) {
p[_local3].bonusSwitch[4] = true;
}
if (p[_local3].bonusTimer[4] > 0) {
p[_local3].bonusTimer[4]--;
}
}
} else if (((p[0].bonusSwitch[4] && (numPlayers == 1)) || (p[0].bonusSwitch[4] && ((p[1].bonusTimer[4] < 1) || (p[1].bonusTimer[4] == undefined)))) || (p[1].bonusSwitch[4] && ((p[0].bonusTimer[4] < 1) || (p[0].bonusTimer[4] == undefined)))) {
for (var _local3 in p) {
if (p[_local3].alive) {
if (!p[_local3].shooter) {
p[_local3].sprite = "bubble_basic";
} else {
p[_local3].sprite = "bonus_shooter";
}
p[_local3].clip.attachMovie(p[_local3].sprite, "sprite", 1);
}
p[_local3].bonusSwitch[4] = false;
}
if (jukeBox.currTrack == (bonusSprites[4] + ".wav")) {
jukeBox.playTrack("normal.wav");
}
if (!noir) {
bg.clip.gotoAndStop(1);
for (var _local2 in s) {
if (s[_local2].type == "bubble") {
s[_local2].sprite = "bubble_basic";
s[_local2].clip.attachMovie(s[_local2].sprite, "sprite", 1);
} else if (s[_local2].type == "mine") {
s[_local2].sprite = "mine_basic";
s[_local2].clip.attachMovie(s[_local2].sprite, "sprite", 1);
}
}
}
druggy = false;
}
if ((p[0].bonusTimer[6] > 0) || (p[1].bonusTimer[6] > 0)) {
if (p[0].bonusSwitch[6] || (p[1].bonusSwitch[6])) {
for (var _local3 in p) {
if (p[_local3].alive) {
if (!p[_local3].shooter) {
p[_local3].sprite = "bonus_" + bonusSprites[6];
} else {
p[_local3].sprite = "bonus_shooter_" + bonusSprites[6];
}
p[_local3].clip.attachMovie(p[_local3].sprite, "sprite", 1);
}
if (p[_local3].bonusTimer[4] > 0) {
p[_local3].bonusTimer[4] = 0;
p[_local3].bonusSwitch[4] = false;
druggy = false;
}
p[_local3].bonusSwitch[6] = false;
}
jukeBox.playTrack(bonusSprites[6] + ".wav");
bg.clip.gotoAndStop(3);
for (var _local2 in s) {
if (s[_local2].type == "bubble") {
s[_local2].sprite = "bonus_" + bonusSprites[6];
s[_local2].clip.attachMovie(s[_local2].sprite, "sprite", 1);
} else if (s[_local2].type == "mine") {
s[_local2].sprite = "mine_" + bonusSprites[6];
s[_local2].clip.attachMovie(s[_local2].sprite, "sprite", 1);
}
}
noir = true;
}
for (var _local3 in p) {
if (p[_local3].bonusTimer[6] == 1) {
p[_local3].bonusSwitch[6] = true;
}
if (p[_local3].bonusTimer[6] > 0) {
p[_local3].bonusTimer[6]--;
}
}
} else if (((p[0].bonusSwitch[6] && (numPlayers == 1)) || (p[0].bonusSwitch[6] && ((p[1].bonusTimer[6] < 1) || (p[1].bonusTimer[6] == undefined)))) || (p[1].bonusSwitch[6] && ((p[0].bonusTimer[6] < 1) || (p[0].bonusTimer[6] == undefined)))) {
for (var _local3 in p) {
if (p[_local3].alive) {
if (!p[_local3].shooter) {
p[_local3].sprite = "bubble_basic";
} else {
p[_local3].sprite = "bonus_shooter";
}
p[_local3].clip.attachMovie(p[_local3].sprite, "sprite", 1);
}
p[_local3].bonusSwitch[6] = false;
}
if (jukeBox.currTrack == (bonusSprites[6] + ".wav")) {
jukeBox.playTrack("normal.wav");
}
if (!druggy) {
bg.clip.gotoAndStop(1);
for (var _local2 in s) {
if (s[_local2].type == "bubble") {
s[_local2].sprite = "bubble_basic";
s[_local2].clip.attachMovie(s[_local2].sprite, "sprite", 1);
} else if (s[_local2].type == "mine") {
s[_local2].sprite = "mine_basic";
s[_local2].clip.attachMovie(s[_local2].sprite, "sprite", 1);
}
}
}
noir = false;
}
for (var _local3 in p) {
if (p[_local3].bonusTimer[0] > 0) {
if (p[_local3].bonusSwitch[0]) {
jukeBox.playTrack(bonusSprites[0] + ".wav");
playerSpeed = 0.3;
spawnSpeed = 0.3;
p[_local3].bonusSwitch[0] = false;
if (p[0].bonusTimer[2] > 0) {
p[0].bonusTimer[2] = 0;
p[0].bonusSwitch[2] = false;
}
if (p[0].bonusTimer[9] > 0) {
p[0].bonusTimer[9] = 0;
p[0].bonusSwitch[9] = false;
leaveTrail = false;
removeTrail();
}
if (numPlayers > 1) {
if (p[1].bonusTimer[2] > 0) {
p[1].bonusTimer[2] = 0;
p[1].bonusSwitch[2] = false;
}
if (p[1].bonusTimer[9] > 0) {
p[1].bonusTimer[9] = 0;
p[1].bonusSwitch[9] = false;
leaveTrail = false;
removeTrail();
}
}
}
if (p[_local3].bonusTimer[0] == 1) {
p[_local3].bonusSwitch[0] = true;
}
p[_local3].bonusTimer[0]--;
} else if (p[_local3].bonusSwitch[0]) {
if (jukeBox.currTrack == (bonusSprites[0] + ".wav")) {
jukeBox.playTrack("normal.wav");
}
playerSpeed = 1;
spawnSpeed = 1;
p[_local3].bonusSwitch[0] = false;
}
if (p[_local3].bonusTimer[1] > 0) {
if (p[_local3].bonusSwitch[1]) {
jukeBox.playTrack(bonusSprites[1] + ".wav");
p[_local3].bounce = bounce * 4;
p[_local3].clip.attachMovie(p[_local3].sprite, "sprite", 1);
p[_local3].bouncy = true;
p[_local3].bonusSwitch[1] = false;
}
if (p[_local3].bonusTimer[1] == 1) {
p[_local3].bonusSwitch[1] = true;
}
p[_local3].bonusTimer[1]--;
} else if (p[_local3].bonusSwitch[1]) {
if (jukeBox.currTrack == (bonusSprites[1] + ".wav")) {
jukeBox.playTrack("normal.wav");
}
if (p[_local3].sprite == ("bonus_" + bonusSprites[1])) {
}
p[_local3].clip.attachMovie(p[_local3].sprite, "sprite", 1);
p[_local3].bounce = bounce;
p[_local3].bouncy = false;
p[_local3].bonusSwitch[1] = false;
}
if (p[_local3].bonusTimer[2] > 0) {
if (p[_local3].bonusSwitch[2]) {
jukeBox.playTrack(bonusSprites[2] + ".wav");
playerSpeed = 2;
spawnSpeed = 2;
p[_local3].bonusSwitch[2] = false;
if (p[0].bonusTimer[0] > 0) {
p[0].bonusTimer[0] = 0;
p[0].bonusSwitch[0] = false;
}
if (p[0].bonusTimer[9] > 0) {
p[0].bonusTimer[9] = 0;
p[0].bonusSwitch[9] = false;
leaveTrail = false;
removeTrail();
}
if (numPlayers > 1) {
if (p[1].bonusTimer[0] > 0) {
p[1].bonusTimer[0] = 0;
p[1].bonusSwitch[0] = false;
}
if (p[1].bonusTimer[9] > 0) {
p[1].bonusTimer[9] = 0;
p[1].bonusSwitch[9] = false;
leaveTrail = false;
removeTrail();
}
}
}
if (p[_local3].bonusTimer[2] == 1) {
p[_local3].bonusSwitch[2] = true;
}
p[_local3].bonusTimer[2]--;
} else if (p[_local3].bonusSwitch[2]) {
if (jukeBox.currTrack == (bonusSprites[2] + ".wav")) {
jukeBox.playTrack("normal.wav");
}
playerSpeed = 1;
spawnSpeed = 1;
p[_local3].bonusSwitch[2] = false;
}
if (p[_local3].bonusTimer[3] > 0) {
if (p[_local3].bonusSwitch[3]) {
jukeBox.playTrack(bonusSprites[3] + ".wav");
bubblesOnly = true;
p[_local3].bonusSwitch[3] = false;
}
if (p[_local3].bonusTimer[3] == 1) {
p[_local3].bonusSwitch[3] = true;
}
p[_local3].bonusTimer[3]--;
} else if (p[_local3].bonusSwitch[3]) {
if (jukeBox.currTrack == (bonusSprites[3] + ".wav")) {
jukeBox.playTrack("normal.wav");
}
bubblesOnly = false;
p[_local3].bonusSwitch[3] = false;
}
if (p[_local3].bonusTimer[5] > 0) {
if (p[_local3].bonusSwitch[5]) {
jukeBox.playTrack(bonusSprites[5] + ".wav");
p[_local3].invincible = true;
p[_local3].bonusSwitch[5] = false;
}
if (p[_local3].bonusTimer[5] == 1) {
p[_local3].bonusSwitch[5] = true;
}
p[_local3].bonusTimer[5]--;
} else if (p[_local3].bonusSwitch[5]) {
if (jukeBox.currTrack == (bonusSprites[5] + ".wav")) {
jukeBox.playTrack("normal.wav");
}
p[_local3].invincible = false;
p[_local3].clip.sprite._alpha = 100;
p[_local3].bonusSwitch[5] = false;
}
if (p[_local3].bonusTimer[7] > 0) {
if (p[_local3].bonusSwitch[7]) {
jukeBox.playTrack(bonusSprites[7] + ".wav");
wrapAround = true;
bg.clip.wrapAround._visible = true;
p[_local3].bonusSwitch[7] = false;
p[_local3].bonusActive.wraparound = true;
}
if (p[_local3].bonusTimer[7] == 1) {
p[_local3].bonusSwitch[7] = true;
}
p[_local3].bonusTimer[7]--;
} else if (p[_local3].bonusSwitch[7]) {
if (jukeBox.currTrack == (bonusSprites[7] + ".wav")) {
jukeBox.playTrack("normal.wav");
}
wrapAround = false;
bg.clip.wrapAround._visible = false;
p[_local3].bonusActive.wraparound = false;
p[_local3].bonusSwitch[7] = false;
}
if (p[_local3].bonusTimer[8] > 0) {
if (p[_local3].bonusSwitch[8]) {
jukeBox.playTrack(bonusSprites[8] + ".wav");
p[_local3].speed = 1.3;
p[_local3].movAcc = movAcc * 2;
p[_local3].bonusSwitch[8] = false;
}
if (p[_local3].bonusTimer[8] == 1) {
p[_local3].bonusSwitch[8] = true;
}
p[_local3].bonusTimer[8]--;
} else if (p[_local3].bonusSwitch[8]) {
if (jukeBox.currTrack == (bonusSprites[8] + ".wav")) {
jukeBox.playTrack("normal.wav");
}
p[_local3].speed = 1;
p[_local3].movAcc = movAcc;
p[_local3].bonusSwitch[8] = false;
}
if (p[_local3].bonusTimer[9] > 0) {
if (p[_local3].bonusSwitch[9]) {
jukeBox.playTrack(bonusSprites[9] + ".wav");
spawnSpeed = 0.1;
playerSpeed = 1;
if (!leaveTrail) {
initTrail(5);
}
leaveTrail = true;
if (p[0].bonusTimer[2] > 0) {
p[0].bonusTimer[2] = 0;
p[0].bonusSwitch[2] = false;
}
if (p[0].bonusTimer[0] > 0) {
p[0].bonusTimer[0] = 0;
p[0].bonusSwitch[0] = false;
}
if (numPlayers > 1) {
if (p[1].bonusTimer[2] > 0) {
p[1].bonusTimer[2] = 0;
p[1].bonusSwitch[2] = false;
}
if (p[1].bonusTimer[0] > 0) {
p[1].bonusTimer[0] = 0;
p[1].bonusSwitch[0] = false;
}
}
}
if (p[_local3].bonusTimer[9] == 1) {
p[_local3].bonusSwitch[9] = true;
}
p[_local3].bonusTimer[9]--;
} else if (p[_local3].bonusSwitch[9]) {
if (jukeBox.currTrack == (bonusSprites[9] + ".wav")) {
jukeBox.playTrack("normal.wav");
}
spawnSpeed = 1;
leaveTrail = false;
removeTrail();
p[_local3].bonusSwitch[9] = false;
}
if (p[_local3].bonusTimer[10] > 0) {
if (p[_local3].bonusSwitch[10]) {
jukeBox.playTrack(bonusSprites[10] + ".wav");
if (p[_local3].alive) {
if ((!druggy) && (!noir)) {
p[_local3].sprite = "bonus_" + bonusSprites[10];
} else if (druggy) {
p[_local3].sprite = ("bonus_" + bonusSprites[10]) + "_druggy";
} else if (noir) {
p[_local3].sprite = ("bonus_" + bonusSprites[10]) + "_noir";
}
p[_local3].clip.attachMovie(p[_local3].sprite, "sprite", 1);
}
p[_local3].shooter = true;
p[_local3].bonusSwitch[10] = false;
}
if (p[_local3].bonusTimer[10] == 1) {
p[_local3].bonusSwitch[10] = true;
}
p[_local3].bonusTimer[10]--;
} else if (p[_local3].bonusSwitch[10]) {
if (jukeBox.currTrack == (bonusSprites[10] + ".wav")) {
jukeBox.playTrack("normal.wav");
}
if (p[_local3].alive) {
if ((!druggy) && (!noir)) {
p[_local3].sprite = "bubble_basic";
} else if (druggy) {
p[_local3].sprite = "bonus_druggy";
} else if (noir) {
p[_local3].sprite = "bonus_noir";
}
p[_local3].clip.attachMovie(p[_local3].sprite, "sprite", 1);
}
p[_local3].shooter = false;
var _local2 = 0;
while (_local2 < maxProjectiles) {
projectiles[_local2].clip.removeMovieClip(this);
projectiles[_local2] = undefined;
_local2++;
}
p[_local3].bonusSwitch[10] = false;
}
if (p[_local3].shooter) {
if (shootRecoil >= (6 * (1 / playerSpeed))) {
shootProjectiles(p[_local3]);
shootRecoil = 0;
} else {
shootRecoil++;
}
}
if (p[_local3].bonusTimer[11] > 0) {
if (p[_local3].bonusSwitch[11]) {
jukeBox.playTrack(bonusSprites[11] + ".wav");
p[_local3].repel = true;
p[_local3].bonusSwitch[11] = false;
}
if (p[_local3].bonusTimer[11] == 1) {
p[_local3].bonusSwitch[11] = true;
}
p[_local3].bonusTimer[11]--;
} else if (p[_local3].bonusSwitch[11]) {
if (jukeBox.currTrack == (bonusSprites[11] + ".wav")) {
jukeBox.playTrack("normal.wav");
}
p[_local3].repel = false;
p[_local3].bonusSwitch[11] = false;
}
if (p[_local3].bonusTimer[12] > 0) {
if (p[_local3].bonusSwitch[12]) {
jukeBox.playTrack(bonusSprites[12] + ".wav");
p[_local3].attract = true;
p[_local3].bonusSwitch[12] = false;
}
if (p[_local3].bonusTimer[12] == 1) {
p[_local3].bonusSwitch[12] = true;
}
p[_local3].bonusTimer[12]--;
} else if (p[_local3].bonusSwitch[12]) {
if (jukeBox.currTrack == (bonusSprites[12] + ".wav")) {
jukeBox.playTrack("normal.wav");
}
p[_local3].attract = false;
p[_local3].bonusSwitch[12] = false;
}
}
}
function animBonus() {
for (var _local2 in p) {
if (p[_local2].invincible) {
if (p[_local2].clip.sprite._alpha == 100) {
p[_local2].clip.sprite._alpha = 20;
} else {
p[_local2].clip.sprite._alpha = 100;
}
}
if (p[_local2].bouncy) {
if ((p[_local2].targetXscale == 100) && (p[_local2].targetYscale == 100)) {
p[_local2].targetXscale = 70;
p[_local2].targetYscale = 120;
}
if (p[_local2].clip.sprite._yscale > 110) {
p[_local2].targetXscale = 120;
p[_local2].targetYscale = 70;
} else if (p[_local2].clip.sprite._xscale > 110) {
p[_local2].targetXscale = 70;
p[_local2].targetYscale = 120;
}
p[_local2].clip.sprite._xscale = p[_local2].clip.sprite._xscale + ((p[_local2].targetXscale - p[_local2].clip.sprite._xscale) / 2);
p[_local2].clip.sprite._yscale = p[_local2].clip.sprite._yscale + ((p[_local2].targetYscale - p[_local2].clip.sprite._yscale) / 2);
}
}
}
function runHUD() {
if (numPlayers == 1) {
var _local7 = "score_display0";
hud[_local7].txtScore.text = String(p[0].score);
var _local3 = 0;
while (_local3 < bonusSprites.length) {
var _local6 = 0;
while (_local6 < hud.timerDisplay.length) {
if (_local3 == hud.timerDisplay[_local6].type) {
if (p[0].bonusTimer[_local3] <= 0) {
hud.timerDisplay[_local6].icon.removeMovieClip(this);
hud.timerDisplay[_local6].bar.removeMovieClip(this);
hud.timerDisplay[_local6].deleteme = true;
hud.displayExists[_local3] = false;
}
}
_local6++;
}
_local6 = 0;
while (_local6 < hud.timerDisplay.length) {
if (hud.timerDisplay[_local6].deleteme) {
hud.timerDisplay.splice(_local6, 1);
_local6 = -1;
}
_local6++;
}
for (_local6 in hud.timerDisplay) {
hud.timerDisplay[_local6].icon._y = (stageHeight - 15) - (10 * _local6);
hud.timerDisplay[_local6].bar._y = (stageHeight - 15) - (10 * _local6);
if (_local3 == hud.timerDisplay[_local6].type) {
hud.timerDisplay[_local6].bar._width = p[0].bonusTimer[_local3] / 10;
}
}
if ((p[0].bonusTimer[_local3] == bonusTimerMax) && (!hud.displayExists[_local3])) {
var _local4 = hud.timerDisplay.push(new Object()) - 1;
var _local5 = "icon" + _local3;
hud.attachMovie("bonus_" + bonusSprites[_local3], _local5, 1 + _local3);
hud.timerDisplay[_local4].type = _local3;
hud.timerDisplay[_local4].icon = hud[_local5];
hud.timerDisplay[_local4].icon._xscale = 50;
hud.timerDisplay[_local4].icon._yscale = hud.timerDisplay[_local4].icon._xscale;
hud.timerDisplay[_local4].icon._x = 15;
hud.timerDisplay[_local4].icon._y = (stageHeight - 15) - (10 * _local4);
_local5 = "bar" + _local3;
hud.attachMovie("status_bar", _local5, 20 + _local3);
hud.timerDisplay[_local4].bar = hud[_local5];
hud.timerDisplay[_local4].bar._width = bonusTimerMax / 10;
hud.timerDisplay[_local4].bar._x = 30;
hud.timerDisplay[_local4].bar._y = (stageHeight - 15) - (10 * _local4);
hud.displayExists[_local3] = true;
}
_local3++;
}
} else {
var _local2 = 0;
while (_local2 < numPlayers) {
var _local7 = "score_display" + _local2;
hud[_local7].txtScore.text = String(p[_local2].score);
var _local3 = 0;
while (_local3 < bonusSprites.length) {
var _local6 = 0;
while (_local6 < hud.timerDisplay[_local2].length) {
if (_local3 == hud.timerDisplay[_local2][_local6].type) {
if (p[_local2].bonusTimer[_local3] <= 0) {
hud.timerDisplay[_local2][_local6].icon.removeMovieClip(this);
hud.timerDisplay[_local2][_local6].bar.removeMovieClip(this);
hud.timerDisplay[_local2][_local6].deleteme = true;
hud.displayExists[_local2][_local3] = false;
}
}
_local6++;
}
_local6 = 0;
while (_local6 < hud.timerDisplay[_local2].length) {
if (hud.timerDisplay[_local2][_local6].deleteme) {
hud.timerDisplay[_local2].splice(_local6, 1);
_local6 = -1;
}
_local6++;
}
for (_local6 in hud.timerDisplay[_local2]) {
hud.timerDisplay[_local2][_local6].icon._y = (stageHeight - 35) - (10 * _local6);
hud.timerDisplay[_local2][_local6].bar._y = (stageHeight - 35) - (10 * _local6);
if (_local3 == hud.timerDisplay[_local2][_local6].type) {
hud.timerDisplay[_local2][_local6].bar._width = p[_local2].bonusTimer[_local3] / 10;
}
}
if ((p[_local2].bonusTimer[_local3] == bonusTimerMax) && (!hud.displayExists[_local2][_local3])) {
var _local4 = hud.timerDisplay[_local2].push(new Object()) - 1;
var _local5 = "icon" + _local3;
hud.attachMovie("bonus_" + bonusSprites[_local3], _local5, (1 + _local3) + (20 * _local2));
hud.timerDisplay[_local2][_local4].type = _local3;
hud.timerDisplay[_local2][_local4].icon = hud[_local5];
hud.timerDisplay[_local2][_local4].icon._xscale = 50;
hud.timerDisplay[_local2][_local4].icon._yscale = hud.timerDisplay[_local2][_local4].icon._xscale;
if (_local2 == 0) {
hud.timerDisplay[_local2][_local4].icon._x = stageWidth - 15;
} else {
hud.timerDisplay[_local2][_local4].icon._x = 15;
}
hud.timerDisplay[_local2][_local4].icon._y = (stageHeight - 35) - (10 * _local4);
_local5 = "bar" + _local3;
if (_local2 == 0) {
hud.attachMovie("status_bar2", _local5, 40 + _local3);
} else {
hud.attachMovie("status_bar", _local5, 60 + _local3);
}
hud.timerDisplay[_local2][_local4].bar = hud[_local5];
hud.timerDisplay[_local2][_local4].bar._width = bonusTimerMax / 10;
if (_local2 == 0) {
hud.timerDisplay[_local2][_local4].bar._x = stageWidth - 30;
} else {
hud.timerDisplay[_local2][_local4].bar._x = 30;
}
hud.timerDisplay[_local2][_local4].bar._y = (stageHeight - 15) - (10 * _local4);
hud.displayExists[_local2][_local3] = true;
}
_local3++;
}
_local2++;
}
}
}
function hitBoundary(p) {
if (!wrapAround) {
if ((p.x + p.radius) > stageWidth) {
p.xStep = p.xStep * p.bounce;
p.x = stageWidth - p.radius;
} else if ((p.x - p.radius) < 0) {
p.xStep = p.xStep * p.bounce;
p.x = p.radius;
}
if ((p.y + p.radius) > stageHeight) {
p.yStep = p.yStep * p.bounce;
p.y = stageHeight - p.radius;
} else if ((p.y - p.radius) < 0) {
p.yStep = p.yStep * p.bounce;
p.y = p.radius;
}
} else {
if (((p.x - (p.radius * 2)) > stageWidth) && (p.xStep > 0)) {
p.x = -2 * p.radius;
} else if (((p.x + (p.radius * 2)) < 0) && (p.xStep < 0)) {
p.x = stageWidth + (2 * p.radius);
}
if ((p.y + p.radius) > stageHeight) {
p.yStep = p.yStep * p.bounce;
p.y = stageHeight - p.radius;
} else if ((p.y - p.radius) < 0) {
p.yStep = p.yStep * p.bounce;
p.y = p.radius;
}
}
}
function hitSpawns(p) {
for (var _local6 in s) {
if ((softCircleHitCircle(p, s[_local6]) && (s[_local6].clip != undefined)) && (p.alive)) {
if (s[_local6].type == "bubble") {
p.score = p.score + Math.round(s[_local6].radius);
p.radius = p.radius + (s[_local6].radius / p.radius);
var _local5 = (p.radius * 100) / defaultRadius;
p.clip._xscale = _local5;
p.clip._yscale = p.clip._xscale;
s[_local6].clip.removeMovieClip(this);
s[_local6] = new Object();
} else if ((s[_local6].type == "mine") && (p.alive)) {
if (!p.invincible) {
jukeBox.playTrack("pop.wav");
p.sprite = "bubble_pop";
p.clip.attachMovie(p.sprite, "sprite", 1);
p.alive = false;
if (numPlayers > 1) {
p.marker.removeMovieClip(this);
}
var _local3 = 0;
while (_local3 < bonusSprites.length) {
if (p.bonusTimer[_local3] > 1) {
p.bonusTimer[_local3] = 1;
}
_local3++;
}
if (numPlayers == 1) {
msg.attachMovie("msg_gameover", "msg", 1);
msg.msg.score = p.score;
msg._x = stageWidth / 2;
msg._y = 170;
} else if (p.id == 0) {
msg.attachMovie("msg_player1_wins", "msg", 1);
disable(1);
msg._x = stageWidth / 2;
msg._y = 170;
} else {
msg.attachMovie("msg_player2_wins", "msg", 1);
disable(0);
msg._x = stageWidth / 2;
msg._y = 170;
}
} else {
p.score = p.score + Math.round(s[_local6].radius * 2);
var _local4 = "explode" + _local6;
s[_local6].clip.removeMovieClip(this);
playfield.attachMovie("mine_explode", _local4, 100 + _local6);
playfield[_local4]._x = s[_local6].x;
playfield[_local4]._y = s[_local6].y;
s[_local6] = undefined;
}
} else if ((s[_local6].type == "bonus") && (p.sprite != "bubble_pop")) {
p.score = p.score + Math.round(s[_local6].radius * 2);
p.radius = p.radius + (s[_local6].radius / p.radius);
if (p.sprite != "bonus_bouncy") {
p.clip._width = p.radius * 2;
p.clip._yscale = p.clip._xscale;
} else {
var _local5 = (p.radius * 100) / defaultRadius;
p.clip._xscale = _local5;
p.clip._yscale = p.clip._xscale;
}
p.bonusTimer[s[_local6].bonus] = bonusTimerMax;
p.bonusSwitch[s[_local6].bonus] = true;
msg.attachMovie("msg_" + bonusSprites[s[_local6].bonus], "msg", 1);
msg._x = stageWidth / 2;
msg._y = 100;
s[_local6].clip.removeMovieClip(this);
s[_local6] = new Object();
}
}
}
}
function hitProjectiles() {
for (var _local4 in s) {
if (s[_local4].type == "mine") {
for (var _local3 in projectiles) {
if ((projectiles[_local3].clip != undefined) && (s[_local4].clip != undefined)) {
if (softCircleHitCircle(s[_local4], projectiles[_local3])) {
s[_local4].clip.removeMovieClip(this);
p[projectiles[_local3].owner].score = p[projectiles[_local3].owner].score + 5;
var _local2 = "explode" + _local4;
playfield.attachMovie("mine_explode", _local2, 100 + _local4);
playfield[_local2]._x = s[_local4].x;
playfield[_local2]._y = s[_local4].y;
s[_local4] = undefined;
}
}
}
}
}
}
function softCircleHitCircle(circle1, circle2) {
var _local2 = circle1.x - circle2.x;
var _local1 = circle1.y - circle2.y;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
if (_local3 <= ((circle1.radius + circle2.radius) - 1)) {
return(true);
}
return(false);
}
function circleHitCircle(circle1, circle2) {
var _local2 = circle1.x - circle2.x;
var _local1 = circle1.y - circle2.y;
var _local3 = Math.sqrt((_local2 * _local2) + (_local1 * _local1));
if (_local3 <= (circle1.radius + circle2.radius)) {
return(true);
}
return(false);
}
function spawn() {
var _local3 = 1 / spawnSpeed;
if (!bubblesOnly) {
var _local4 = (100 * difficulty) / maxDifficulty;
_local4 = _local4 * 0.65;
_local4 = _local4 + 15;
} else {
var _local4 = 0;
}
var _local2 = Math.floor(random(7 * _local3));
if (_local2 < 1) {
var _local5 = Math.floor(random(100));
if (_local4 < _local5) {
spawnBubble();
} else {
spawnMine();
}
}
_local2 = Math.floor(random(bonusSpawnDelay * _local3));
if (_local2 < 1) {
spawnBonus();
} else {
bonusSpawnTrigger++;
if (bonusSpawnTrigger > (bonusSpawnDelay * 2)) {
spawnBonus();
bonusSpawnTrigger = 0;
}
}
}
function spawnBubble() {
if (numPlayers == 1) {
var _local3 = p[0].radius;
} else if (numPlayers == 2) {
if (p[0].radius < p[1].radius) {
var _local3 = p[0].radius;
} else {
var _local3 = p[1].radius;
}
}
var _local2 = "spawn" + currSpawn;
var _local4 = 100 + currSpawn;
playfield.createEmptyMovieClip(_local2, _local4);
s[currSpawn] = new Object();
s[currSpawn].clip = playfield[_local2];
if (druggy) {
s[currSpawn].sprite = "bonus_" + bonusSprites[4];
} else if (noir) {
s[currSpawn].sprite = "bonus_" + bonusSprites[6];
} else {
s[currSpawn].sprite = "bubble_basic";
}
s[currSpawn].clip.attachMovie(s[currSpawn].sprite, "sprite", 1);
s[currSpawn].radius = (random(_local3) / 4) + (_local3 / 4);
s[currSpawn].clip._width = s[currSpawn].radius * 2;
s[currSpawn].clip._height = s[currSpawn].clip._width;
s[currSpawn].x = Math.floor(random(stageWidth));
s[currSpawn].y = -s[currSpawn].radius;
s[currSpawn].xStep = 0;
s[currSpawn].yStep = Math.floor(random(5) + 2);
s[currSpawn].xForce = 0;
s[currSpawn].yForce = 0;
s[currSpawn].type = "bubble";
s[currSpawn].clip._x = s[currSpawn].x;
s[currSpawn].clip._y = s[currSpawn].y;
if (currSpawn < maxSpawns) {
currSpawn++;
} else {
currSpawn = 0;
}
}
function spawnMine() {
var _local2 = "spawn" + currSpawn;
var _local3 = 100 + currSpawn;
playfield.createEmptyMovieClip(_local2, _local3);
s[currSpawn] = new Object();
s[currSpawn].clip = playfield[_local2];
if (druggy) {
s[currSpawn].sprite = "mine_" + bonusSprites[4];
} else if (noir) {
s[currSpawn].sprite = "mine_" + bonusSprites[6];
} else {
s[currSpawn].sprite = "mine_basic";
}
s[currSpawn].clip.attachMovie(s[currSpawn].sprite, "sprite", 1);
s[currSpawn].radius = s[currSpawn].clip._width / 2;
s[currSpawn].x = Math.floor(random(stageWidth));
s[currSpawn].y = -s[currSpawn].radius;
s[currSpawn].xStep = 0;
s[currSpawn].yStep = Math.floor(random(5) + 2);
s[currSpawn].xForce = 0;
s[currSpawn].yForce = 0;
s[currSpawn].type = "mine";
s[currSpawn].clip._x = s[currSpawn].x;
s[currSpawn].clip._y = s[currSpawn].y;
if (currSpawn < maxSpawns) {
currSpawn++;
} else {
currSpawn = 0;
}
}
function spawnBonus() {
var _local2 = Math.floor(random(bonusSprites.length));
var _local5 = Math.floor(random(10));
if (_local5 >= bonusRarity[_local2]) {
var _local3 = "bonus" + currSpawn;
var _local4 = 100 + currSpawn;
playfield.createEmptyMovieClip(_local3, _local4);
s[currSpawn] = new Object();
s[currSpawn].clip = playfield[_local3];
s[currSpawn].sprite = "bonus_" + bonusSprites[_local2];
s[currSpawn].clip.attachMovie(s[currSpawn].sprite, "sprite", 1);
s[currSpawn].radius = defaultRadius;
s[currSpawn].x = Math.floor(random(stageWidth));
s[currSpawn].y = -s[currSpawn].radius;
s[currSpawn].xStep = 0;
s[currSpawn].yStep = Math.floor(random(5) + 2);
s[currSpawn].xForce = 0;
s[currSpawn].yForce = 0;
s[currSpawn].defaultYstep = s[currSpawn].yStep;
s[currSpawn].type = "bonus";
s[currSpawn].bonus = _local2;
s[currSpawn].clip._x = s[currSpawn].x;
s[currSpawn].clip._y = s[currSpawn].y;
if (currSpawn < maxSpawns) {
currSpawn++;
} else {
currSpawn = 0;
}
} else {
bonusSpawnTrigger++;
}
}
function initTrail(strength) {
playfield.createEmptyMovieClip("trail", 2);
blur = new flash.filters.BlurFilter(strength, strength, 1);
bg_bmp = new flash.display.BitmapData(stageWidth, stageHeight, false, 34);
playfield.trail.attachBitmap(bg_bmp, 1);
playfield.trail.filters = [blur];
}
function runTrail() {
bg_bmp.draw(playfield);
}
function removeTrail() {
playfield.trail.removeMovieClip(this);
}
function shootProjectiles(p) {
var _local3 = "projectile" + currProjectile;
var _local4 = 200 + currProjectile;
playfield.createEmptyMovieClip(_local3, _local4);
projectiles[currProjectile] = new Object();
projectiles[currProjectile].clip = playfield[_local3];
if (druggy) {
projectiles[currProjectile].sprite = "bonus_shoot_projectile_druggy";
} else if (noir) {
projectiles[currProjectile].sprite = "bonus_shoot_projectile_noir";
} else {
projectiles[currProjectile].sprite = "bonus_shoot_projectile";
}
projectiles[currProjectile].clip.attachMovie(projectiles[currProjectile].sprite, "sprite", 1);
projectiles[currProjectile].radius = projectiles[currProjectile].clip._width / 2;
projectiles[currProjectile].x = p.x;
projectiles[currProjectile].y = p.y - p.radius;
projectiles[currProjectile].xStep = 0;
projectiles[currProjectile].yStep = -5;
projectiles[currProjectile].owner = p.id;
projectiles[currProjectile].clip._x = projectiles[currProjectile].x;
projectiles[currProjectile].clip._y = projectiles[currProjectile].y;
if (currProjectile < (maxProjectiles - 1)) {
currProjectile++;
} else {
currProjectile = 0;
}
if (p.radius > 25) {
if (maxProjectiles < (90 * numPlayers)) {
maxProjectiles = 90 * numPlayers;
}
shootMoreProjectiles(p, 1);
shootMoreProjectiles(p, -1);
}
if (p.radius > 50) {
if (maxProjectiles < (150 * numPlayers)) {
maxProjectiles = 150 * numPlayers;
}
shootMoreProjectiles(p, 2);
shootMoreProjectiles(p, -2);
}
}
function shootMoreProjectiles(p, xStep) {
var _local2 = "projectile" + currProjectile;
var _local3 = 200 + currProjectile;
playfield.createEmptyMovieClip(_local2, _local3);
projectiles[currProjectile] = new Object();
projectiles[currProjectile].clip = playfield[_local2];
if (druggy) {
projectiles[currProjectile].sprite = "bonus_shoot_projectile_druggy";
} else if (noir) {
projectiles[currProjectile].sprite = "bonus_shoot_projectile_noir";
} else {
projectiles[currProjectile].sprite = "bonus_shoot_projectile";
}
projectiles[currProjectile].clip.attachMovie(projectiles[currProjectile].sprite, "sprite", 1);
projectiles[currProjectile].radius = projectiles[currProjectile].clip._width / 2;
projectiles[currProjectile].x = p.x;
projectiles[currProjectile].y = p.y - p.radius;
projectiles[currProjectile].xStep = xStep;
projectiles[currProjectile].yStep = -5;
projectiles[currProjectile].clip._x = projectiles[currProjectile].x;
projectiles[currProjectile].clip._y = projectiles[currProjectile].y;
if (currProjectile < (maxProjectiles - 1)) {
currProjectile++;
} else {
currProjectile = 0;
}
}
function repelMines(playerId) {
for (var _local8 in s) {
if (s[_local8].type == "mine") {
var _local2 = p[playerId].x - s[_local8].x;
var _local5 = p[playerId].y - s[_local8].y;
var _local6 = Math.sqrt((_local2 * _local2) + (_local5 * _local5));
var _local4 = Math.atan(_local5 / _local2);
var _local3 = (2000 * p[playerId].radius) / (_local6 * _local6);
if (_local2 < 0) {
s[_local8].xForce = _local3 * Math.cos(_local4);
s[_local8].yForce = _local3 * Math.sin(_local4);
} else {
s[_local8].xForce = (-_local3) * Math.cos(_local4);
s[_local8].yForce = (-_local3) * Math.sin(_local4);
}
}
}
}
function attractBubbles(playerId) {
for (var _local8 in s) {
if (s[_local8].type == "bubble") {
var _local2 = p[playerId].x - s[_local8].x;
var _local5 = p[playerId].y - s[_local8].y;
var _local6 = Math.sqrt((_local2 * _local2) + (_local5 * _local5));
var _local4 = Math.atan(_local5 / _local2);
var _local3 = (500 * p[playerId].radius) / (_local6 * (_local6 / 2));
if (_local2 > 0) {
s[_local8].xForce = _local3 * Math.cos(_local4);
s[_local8].yForce = _local3 * Math.sin(_local4);
} else {
s[_local8].xForce = (-_local3) * Math.cos(_local4);
s[_local8].yForce = (-_local3) * Math.sin(_local4);
}
}
}
}
function billard(p1, p2) {
if ((circleHitCircle(p1, p2) && (p1.alive)) && (p2.alive)) {
var _local6 = p1.radius;
var _local8 = p2.radius;
var _local22 = p1.xStep;
var _local21 = p2.xStep;
var _local25 = p1.yStep;
var _local23 = p2.yStep;
var _local19 = p1.x;
var _local17 = p2.x;
var _local18 = p1.y;
var _local16 = p2.y;
var _local26 = _local19 - _local17;
var _local28 = _local18 - _local16;
var _local7 = Math.atan2(_local28, _local26);
var _local5 = Math.cos(_local7);
var _local4 = Math.sin(_local7);
var _local14 = (_local22 * _local5) + (_local25 * _local4);
var _local11 = (_local21 * _local5) + (_local23 * _local4);
var _local12 = (_local25 * _local5) - (_local22 * _local4);
var _local9 = (_local23 * _local5) - (_local21 * _local4);
var _local24 = (_local6 * _local14) + (_local8 * _local11);
var _local27 = _local14 - _local11;
var _local15 = (_local24 + (_local6 * _local27)) / (_local6 + _local8);
var _local20 = (_local15 - _local14) + _local11;
_local14 = _local20;
_local11 = _local15;
_local22 = (_local14 * _local5) - (_local12 * _local4);
_local21 = (_local11 * _local5) - (_local9 * _local4);
_local25 = (_local12 * _local5) + (_local14 * _local4);
_local23 = (_local9 * _local5) + (_local11 * _local4);
if (p1.bounce < -0.3) {
var _local13 = 1.5;
} else {
var _local13 = 1;
}
if (p2.bounce < -0.3) {
var _local10 = 1.5;
} else {
var _local10 = 1;
}
p1.xStep = (_local22 * 1.5) * _local13;
p2.xStep = (_local21 * 1.5) * _local10;
p1.yStep = (_local25 * 1.5) * _local13;
p2.yStep = (_local23 * 1.5) * _local10;
p1.x = p1.x + (p1.xStep / 2);
p2.x = p2.x + (p2.xStep / 2);
p1.y = p1.y + (p1.yStep / 2);
p2.y = p2.y + (p2.yStep / 2);
}
}
function disable(id) {
p[id].alive = false;
}
function initSound() {
attachMovie("JukeBox", "jukeBox", 200, {targetVol:100, track:"normal.wav"});
}
}
Symbol 36 MovieClip [Game] Frame 1
#initclip 6
Object.registerClass("Game", Game);
#endinitclip
Symbol 45 MovieClip Frame 22
gotoAndPlay (1);
Symbol 53 MovieClip [Background] Frame 1
#initclip 4
Object.registerClass("Background", Background);
#endinitclip
stop();
Symbol 58 MovieClip [bubble_pop] Frame 6
stop();
Symbol 74 MovieClip [bonus_speed] Frame 6
gotoAndPlay (1);
Symbol 112 MovieClip [bonus_agility] Frame 26
gotoAndPlay (1);
Instance of Symbol 116 MovieClip in Symbol 118 MovieClip [bonus_ultimate_bubble_time] Frame 1
onClipEvent (load) {
gotoAndPlay (15);
}
Symbol 124 MovieClip [bonus_shoot_projectile] Frame 4
gotoAndPlay (1);
Symbol 127 MovieClip [mine_explode] Frame 11
stop();
removeMovieClip(this);
Symbol 131 MovieClip [bonus_repel] Frame 14
gotoAndPlay (1);
Symbol 134 MovieClip [bonus_attract] Frame 14
gotoAndPlay (1);
Symbol 152 MovieClip [bonus_shoot_projectile_druggy] Frame 12
gotoAndPlay (1);
Symbol 160 MovieClip [msg_agility] Frame 20
removeMovieClip(this);
Symbol 163 MovieClip [msg_attract] Frame 20
removeMovieClip(this);
Symbol 166 MovieClip [msg_bouncy] Frame 20
removeMovieClip(this);
Symbol 169 MovieClip [msg_bubble_time] Frame 20
removeMovieClip(this);
Symbol 172 MovieClip [msg_bubbles_only] Frame 20
removeMovieClip(this);
Symbol 175 MovieClip [msg_druggy] Frame 20
removeMovieClip(this);
Symbol 178 MovieClip [msg_invincible] Frame 20
removeMovieClip(this);
Symbol 181 MovieClip [msg_noir] Frame 20
removeMovieClip(this);
Symbol 184 MovieClip [msg_repel] Frame 20
removeMovieClip(this);
Symbol 187 MovieClip [msg_shooter] Frame 20
removeMovieClip(this);
Symbol 190 MovieClip [msg_speed] Frame 20
removeMovieClip(this);
Symbol 193 MovieClip [msg_ultimate_bubble_time] Frame 20
removeMovieClip(this);
Symbol 196 MovieClip [msg_wraparound] Frame 20
removeMovieClip(this);
Symbol 231 MovieClip Frame 1
function playAgain() {
_parent._parent._parent._parent._parent.newGame();
}
function mainMenu() {
stopAllSounds();
_parent._parent._parent._parent._parent.gotoAndStop("main_menu");
_parent._parent._parent._parent._parent.gameContainer.removeMovieClip(this);
}
function moreGames() {
getURL ("http://www.mindistortion.tv/?p=games", "_blank");
}
function submitHighscore() {
stopAllSounds();
_parent._parent._parent._parent._parent.gotoAndStop("submit_highscore");
_parent._parent._parent._parent._parent.gameContainer.removeMovieClip(this);
}
score = _parent.score;
if (score == undefined) {
score = 0;
}
_parent._parent._parent._parent._parent.gameScore = score;
txtScore.text = score;
rating_indicator.stop();
if (score > 2500) {
rating_indicator.gotoAndStop(12);
} else if (score > 1500) {
rating_indicator.gotoAndStop(11);
} else if (score > 1000) {
rating_indicator.gotoAndStop(10);
} else if (score > 750) {
rating_indicator.gotoAndStop(9);
} else if (score > 500) {
rating_indicator.gotoAndStop(8);
} else if (score > 375) {
rating_indicator.gotoAndStop(7);
} else if (score > 250) {
rating_indicator.gotoAndStop(6);
} else if (score > 175) {
rating_indicator.gotoAndStop(5);
} else if (score > 100) {
rating_indicator.gotoAndStop(4);
} else if (score > 50) {
rating_indicator.gotoAndStop(3);
} else if (score > 25) {
rating_indicator.gotoAndStop(2);
}
btn_playagain.onRelease = function () {
playAgain();
};
btn_playagain.onReleaseOutside = function () {
playAgain();
};
btn_mainmenu.onRelease = function () {
mainMenu();
};
btn_mainmenu.onReleaseOutside = function () {
mainMenu();
};
btn_moregames.onRelease = function () {
moreGames();
};
btn_moregames.onReleaseOutside = function () {
moreGames();
};
btn_submithighscore.onRelease = function () {
submitHighscore();
};
btn_submithighscore.onReleaseOutside = function () {
submitHighscore();
};
Symbol 232 MovieClip [msg_gameover] Frame 25
stop();
Symbol 234 MovieClip Frame 1
function playAgain() {
_parent._parent._parent._parent._parent.newGame();
}
function mainMenu() {
stopAllSounds();
_parent._parent._parent._parent._parent.gotoAndStop("main_menu");
_parent._parent._parent._parent._parent.gameContainer.removeMovieClip(this);
}
function moreGames() {
getURL ("http://www.mindistortion.tv/?p=games", "_blank");
}
btn_playagain.onRelease = function () {
playAgain();
};
btn_playagain.onReleaseOutside = function () {
playAgain();
};
btn_mainmenu.onRelease = function () {
mainMenu();
};
btn_mainmenu.onReleaseOutside = function () {
mainMenu();
};
btn_moregames.onRelease = function () {
moreGames();
};
btn_moregames.onReleaseOutside = function () {
moreGames();
};
Symbol 235 MovieClip [msg_player1_wins] Frame 25
stop();
Symbol 237 MovieClip Frame 1
function playAgain() {
_parent._parent._parent._parent._parent.newGame();
}
function mainMenu() {
stopAllSounds();
_parent._parent._parent._parent._parent.gotoAndStop("main_menu");
_parent._parent._parent._parent._parent.gameContainer.removeMovieClip(this);
}
function moreGames() {
getURL ("http://www.mindistortion.tv/?p=games", "_blank");
}
btn_playagain.onRelease = function () {
playAgain();
};
btn_playagain.onReleaseOutside = function () {
playAgain();
};
btn_mainmenu.onRelease = function () {
mainMenu();
};
btn_mainmenu.onReleaseOutside = function () {
mainMenu();
};
btn_moregames.onRelease = function () {
moreGames();
};
btn_moregames.onReleaseOutside = function () {
moreGames();
};
Symbol 238 MovieClip [msg_player2_wins] Frame 25
stop();
Symbol 241 MovieClip [msg_lastbubblestanding] Frame 35
removeMovieClip(this);
Symbol 244 MovieClip [msg_go!] Frame 35
removeMovieClip(this);
Symbol 247 MovieClip [msg_pause] Frame 29
gotoAndPlay (1);
Symbol 248 MovieClip [JukeBox] Frame 1
#initclip 5
Object.registerClass("JukeBox", JukeBox);
#endinitclip
Symbol 257 MovieClip [sound_ctrl] Frame 1
if (_parent._parent._parent._parent.musicOn) {
stop();
_parent._parent.jukeBox.setVol(100);
} else {
nextFrame();
_parent._parent.jukeBox.setVol(0);
}
function musicOff() {
_parent._parent.jukeBox.setVol(0);
_parent._parent._parent._parent.musicOn = false;
nextFrame();
}
btn_off.onRelease = function () {
musicOff();
};
btn_off.onReleaseOutside = function () {
musicOff();
};
Symbol 257 MovieClip [sound_ctrl] Frame 2
function musicOn() {
_parent._parent.jukeBox.setVol(100);
_parent._parent._parent._parent.musicOn = true;
prevFrame();
}
btn_on.onRelease = function () {
musicOn();
};
btn_on.onReleaseOutside = function () {
musicOn();
};
Symbol 273 MovieClip Frame 1
stop();
Symbol 278 Button
on (release) {
getURL ("http://www.mindistortion.net", "_blank");
}
Symbol 279 Button
on (release) {
getURL ("http://www.mindistortion.tv", "_blank");
}
Symbol 281 MovieClip Frame 75
_root.play();
Symbol 320 MovieClip Frame 1
function lnk() {
getURL ("http://www.mindistortion.tv", "_blank");
}
btn_lnk.onRelease = function () {
lnk();
};
btn_lnk.onReleaseOutside = function () {
lnk();
};
Symbol 329 MovieClip Frame 1
if (_parent.musicOn) {
stop();
} else {
nextFrame();
}
function musicOff() {
_parent.musicOn = false;
nextFrame();
}
btn_off.onRelease = function () {
musicOff();
};
btn_off.onReleaseOutside = function () {
musicOff();
};
Symbol 329 MovieClip Frame 2
function musicOn() {
_parent.musicOn = true;
prevFrame();
}
btn_on.onRelease = function () {
musicOn();
};
btn_on.onReleaseOutside = function () {
musicOn();
};
Symbol 332 MovieClip Frame 1
if (_parent.sugarRush) {
stop();
} else {
nextFrame();
}
function musicOff() {
_parent.sugarRush = false;
nextFrame();
}
btn_off.onRelease = function () {
musicOff();
};
btn_off.onReleaseOutside = function () {
musicOff();
};
Symbol 332 MovieClip Frame 2
function musicOn() {
_parent.sugarRush = true;
prevFrame();
}
btn_on.onRelease = function () {
musicOn();
};
btn_on.onReleaseOutside = function () {
musicOn();
};
Symbol 347 Button
on (release) {
if (playername != "") {
play();
}
}
Symbol 400 MovieClip Frame 1
stop();
score = _parent.gameScore;
txtScore.text = score;
playername = "";
txtName.text = playername;
loaded = "";
Symbol 400 MovieClip Frame 2
function bitOR(a, b) {
var _local1 = (a & 1) | (b & 1);
var _local2 = (a >>> 1) | (b >>> 1);
return((_local2 << 1) | _local1);
}
function bitXOR(a, b) {
var _local1 = (a & 1) ^ (b & 1);
var _local2 = (a >>> 1) ^ (b >>> 1);
return((_local2 << 1) | _local1);
}
function bitAND(a, b) {
var _local1 = (a & 1) & (b & 1);
var _local2 = (a >>> 1) & (b >>> 1);
return((_local2 << 1) | _local1);
}
function addme(x, y) {
var _local1 = (x & 65535) + (y & 65535);
var _local2 = ((x >> 16) + (y >> 16)) + (_local1 >> 16);
return((_local2 << 16) | (_local1 & 65535));
}
function rhex(num) {
str = "";
j = 0;
while (j <= 3) {
str = str + (hex_chr.charAt((num >> ((j * 8) + 4)) & 15) + hex_chr.charAt((num >> (j * 8)) & 15));
j++;
}
return(str);
}
function str2blks_MD5(str) {
nblk = ((str.length + 8) >> 6) + 1;
blks = new Array(nblk * 16);
i = 0;
while (i < (nblk * 16)) {
blks[i] = 0;
i++;
}
i = 0;
while (i < str.length) {
blks[i >> 2] = blks[i >> 2] | (str.charCodeAt(i) << ((((str.length * 8) + i) % 4) * 8));
i++;
}
blks[i >> 2] = blks[i >> 2] | (128 << ((((str.length * 8) + i) % 4) * 8));
var _local2 = str.length * 8;
blks[(nblk * 16) - 2] = _local2 & 255;
blks[(nblk * 16) - 2] = blks[(nblk * 16) - 2] | (((_local2 >>> 8) & 255) << 8);
blks[(nblk * 16) - 2] = blks[(nblk * 16) - 2] | (((_local2 >>> 16) & 255) << 16);
blks[(nblk * 16) - 2] = blks[(nblk * 16) - 2] | (((_local2 >>> 24) & 255) << 24);
return(blks);
}
function rol(num, cnt) {
return((num << cnt) | (num >>> (32 - cnt)));
}
function cmn(q, a, b, x, s, t) {
return(addme(rol(addme(addme(a, q), addme(x, t)), s), b));
}
function ff(a, b, c, d, x, s, t) {
return(cmn(bitOR(bitAND(b, c), bitAND(~b, d)), a, b, x, s, t));
}
function gg(a, b, c, d, x, s, t) {
return(cmn(bitOR(bitAND(b, d), bitAND(c, ~d)), a, b, x, s, t));
}
function hh(a, b, c, d, x, s, t) {
return(cmn(bitXOR(bitXOR(b, c), d), a, b, x, s, t));
}
function ii(a, b, c, d, x, s, t) {
return(cmn(bitXOR(c, bitOR(b, ~d)), a, b, x, s, t));
}
function calcMD5(str) {
x = str2blks_MD5(str);
a = 1732584193 /* 0x67452301 */;
b = -271733879;
c = -1732584194;
d = 271733878 /* 0x10325476 */;
var _local1;
i = 0;
while (i < x.length) {
olda = a;
oldb = b;
oldc = c;
oldd = d;
_local1 = 0;
a = ff(a, b, c, d, x[i + 0], 7, -680876936);
d = ff(d, a, b, c, x[i + 1], 12, -389564586);
c = ff(c, d, a, b, x[i + 2], 17, 606105819);
b = ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = ff(a, b, c, d, x[i + 4], 7, -176418897);
d = ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = ff(b, c, d, a, x[i + 7], 22, -45705983);
a = ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = ff(c, d, a, b, x[i + 10], 17, -42063);
b = ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = ff(d, a, b, c, x[i + 13], 12, -40341101);
c = ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = gg(a, b, c, d, x[i + 1], 5, -165796510);
d = gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = gg(c, d, a, b, x[i + 11], 14, 643717713);
b = gg(b, c, d, a, x[i + 0], 20, -373897302);
a = gg(a, b, c, d, x[i + 5], 5, -701558691);
d = gg(d, a, b, c, x[i + 10], 9, 38016083);
c = gg(c, d, a, b, x[i + 15], 14, -660478335);
b = gg(b, c, d, a, x[i + 4], 20, -405537848);
a = gg(a, b, c, d, x[i + 9], 5, 568446438);
d = gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = gg(c, d, a, b, x[i + 3], 14, -187363961);
b = gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = gg(d, a, b, c, x[i + 2], 9, -51403784);
c = gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = hh(a, b, c, d, x[i + 5], 4, -378558);
d = hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = hh(b, c, d, a, x[i + 14], 23, -35309556);
a = hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = hh(c, d, a, b, x[i + 7], 16, -155497632);
b = hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = hh(a, b, c, d, x[i + 13], 4, 681279174);
d = hh(d, a, b, c, x[i + 0], 11, -358537222);
c = hh(c, d, a, b, x[i + 3], 16, -722521979);
b = hh(b, c, d, a, x[i + 6], 23, 76029189);
a = hh(a, b, c, d, x[i + 9], 4, -640364487);
d = hh(d, a, b, c, x[i + 12], 11, -421815835);
c = hh(c, d, a, b, x[i + 15], 16, 530742520);
b = hh(b, c, d, a, x[i + 2], 23, -995338651);
a = ii(a, b, c, d, x[i + 0], 6, -198630844);
d = ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = ii(b, c, d, a, x[i + 5], 21, -57434055);
a = ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = ii(c, d, a, b, x[i + 10], 15, -1051523);
b = ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = ii(d, a, b, c, x[i + 15], 10, -30611744);
c = ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = ii(a, b, c, d, x[i + 4], 6, -145523070);
d = ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = ii(c, d, a, b, x[i + 2], 15, 718787259);
b = ii(b, c, d, a, x[i + 9], 21, -343485551);
a = addme(a, olda);
b = addme(b, oldb);
c = addme(c, oldc);
d = addme(d, oldd);
i = i + 16;
}
return(((rhex(a) + rhex(b)) + rhex(c)) + rhex(d));
}
var hex_chr = "0123456789abcdef";
Symbol 400 MovieClip Frame 3
if (!_parent.sugarRush) {
highscore_table = "highscore_bubbles2";
} else {
highscore_table = "highscore_bubbles2_sugarrush";
}
list_size = 15;
r = Math.round(random(100)) + 1;
keycheck = calcMD5(String((score * r) + 1984));
loadVariables ("../../processing/writeHighscore.php", this, "POST");
Symbol 400 MovieClip Frame 7
if ((loaded == undefined) || (loaded == "")) {
gotoAndPlay(_currentframe - 2);
}
Symbol 400 MovieClip Frame 8
stop();
remoteVars = new LoadVars();
remoteVars.load("../../processing/readHighscore.php?list_size=15&highscore_table=" + highscore_table);
remoteVars.onLoad = function () {
name1 = remoteVars.name1;
name2 = remoteVars.name2;
name3 = remoteVars.name3;
name4 = remoteVars.name4;
name5 = remoteVars.name5;
name6 = remoteVars.name6;
name7 = remoteVars.name7;
name8 = remoteVars.name8;
name9 = remoteVars.name9;
name10 = remoteVars.name10;
name11 = remoteVars.name11;
name12 = remoteVars.name12;
name13 = remoteVars.name13;
name14 = remoteVars.name14;
name15 = remoteVars.name15;
score1 = remoteVars.score1;
score2 = remoteVars.score2;
score3 = remoteVars.score3;
score4 = remoteVars.score4;
score5 = remoteVars.score5;
score6 = remoteVars.score6;
score7 = remoteVars.score7;
score8 = remoteVars.score8;
score9 = remoteVars.score9;
score10 = remoteVars.score10;
score11 = remoteVars.score11;
score12 = remoteVars.score12;
score13 = remoteVars.score13;
score14 = remoteVars.score14;
score15 = remoteVars.score15;
play();
};
Symbol 400 MovieClip Frame 10
if (!_parent.sugarRush) {
srClip._visible = false;
}
stop();