Frame 1
Stage.showMenu = false;
stop();
Frame 2
levelData = new Array();
levelData = [3, 4, 3, 5, 4, 3, 5, 4, 4, 3, 5, 4, 3, 4, 3, 4, 3, 5];
pushed = levelData.push(4, 4, 3, 5, 4, 3, 4, 3, 4, 3, 5, 4, 4, 3, 5, 4, 3, 4, 3);
pushed = levelData.push(4, 4, 3, 5, 4, 3, 4, 3, 4, 3, 5, 4, 4, 3, 5, 4, 3, 4, 3);
music = new Sound();
music.attachSound("bub.mp3");
music.start(0, 99999);
boing = new Sound();
boing.attachSound("boing.mp3");
function enterLevel() {
level++;
killAllMonsters();
if (30 < level) {
level = 1;
}
a._y = -9;
a._x = 70;
a.a.gotoandstop("entrance");
aFroze = true;
aEntering = true;
killPrizes = true;
killBubbles = true;
vscene.gotoandstop(level);
hscene.gotoandstop(level);
a.gotoandstop(1);
levelTimer = 0;
}
function spawnMonsters() {
levelMonsterTot = leveldata[level - 1];
currentMonsters = levelMonsterTot;
i = 1;
while (currentMonsters >= i) {
cname = "c" + i;
duplicateMovieClip ("c", "c" + i, i + 9000);
_root[cname]._x = random(300) + 50;
_root[cname].active = true;
i++;
}
}
function killMonster() {
currentMonsters--;
if (currentMonsters < 1) {
endThisLevel();
}
}
function killAllMonsters(diamonding) {
i = 0;
while (i < 8) {
if (_root["c" + i].active) {
if (diamonding) {
diamondNum++;
duplicateMovieClip ("diamond", "diamond" + diamondNum, diamondNum + 8000);
_root["diamond" + diamondNum]._x = _root["c" + i]._x;
_root["diamond" + diamondNum]._y = _root["c" + i]._y;
}
removeMovieClip(_root["c" + i]);
}
i++;
}
}
function endThisLevel() {
trace("all monsters dead");
removeBaron();
waitForNextLevel = true;
}
function frameActions() {
if (key.isdown(81)) {
gameOver();
}
if (key.isdown(80)) {
paused = (paused ? false : true);
}
if (!paused) {
text1 = "";
if (key.isdown(79)) {
enterLevel();
}
if (key.isdown(65)) {
aDie();
}
if (aEntering) {
if (a._y >= 315) {
killPrizes = false;
killBubbles = false;
a.a.gotoandstop(1);
aInvin = true;
aEntering = false;
aFroze = false;
spawnMonsters();
} else {
a._y = a._y + 7;
}
}
if (waitForNextLevel) {
nextLevelDelay++;
if (80 < nextLevelDelay) {
waitForNextLevel = false;
nextLevelDelay = 0;
enterLevel();
trace("nextLevel");
}
}
levelTimer++;
if (levelTimer == 50) {
extendBubNum++;
duplicateMovieClip ("extendBub", "extendBub" + extendBubNum, 7000 + extendBubNum);
_root["extendBub" + extendBubNum]._x = random(300) + 50;
_root["extendBub" + extendBubNum]._y = 450;
_root["extendBub" + extendBubNum].active = true;
}
if (levelTimer == 100) {
gift.giftType = random(5) + 1;
gift.gotoandstop(gift.giftType);
gift._x = random(300) + 50;
gift._y = random(300) + 50;
gift.active = true;
}
if (levelTimer == 300) {
baron._x = 40;
baron._y = 40;
baron.active = true;
}
lastlastax = lastax;
lastax = a._x;
if (key.isdown(key.left) && (!aFroze)) {
a._x = a._x - aspeed;
afaceleft = true;
a.gotoandstop(2);
}
if (key.isdown(key.right) && (!aFroze)) {
a._x = a._x + aspeed;
afaceleft = false;
a.gotoandstop(1);
}
if (hscene.hittest(afeet._x, afeet._y, true)) {
a._x = lastlastax;
}
if (a._x < 50) {
a._x = 49;
}
if (388 < a._x) {
a._x = 387;
}
if (!aFroze) {
if (key.isdown(key.up) && (!jumping)) {
jumping = true;
boing.start();
avi = -25;
}
avi = avi + 4;
if (16 < avi) {
avi = 16;
}
if ((vscene.hittest(afeet._x, afeet._y, true) && (0 < avi)) && (!aFroze)) {
jumping = false;
avi = 0;
a._y = (Math.floor((a._y / 50) + 0.5) * 50) - 10;
}
if (a._y < -10) {
a._y = a._y + 400;
}
if (410 < a._y) {
a._y = -10;
}
a._y = a._y + avi;
afeet._x = a._x;
afeet._y = a._y;
}
bubdelay++;
if ((key.isdown(90) && (aFireSpeed < bubdelay)) && (!aFroze)) {
a.a.gotoandplay("fire");
bubdelay = 0;
bubtot++;
bubnum++;
bubname = "bub" + bubnum;
duplicateMovieClip ("bub", bubname, bubnum);
_root[bubname]._y = a._y - 10;
_root[bubname].faceleft = afaceleft;
if (!afaceleft) {
_root[bubname]._x = a._x + 10;
} else {
_root[bubname]._x = a._x - 10;
}
if (40 < bubnum) {
bubnum = 0;
}
}
if (aInvin) {
aInvinDelay++;
flashDelay++;
if (flashDelay == 1) {
a._visible = 1;
}
if (2 < flashDelay) {
a._visible = 0;
flashDelay = 0;
}
if (50 < aInvinDelay) {
aInvin = false;
a._visible = 1;
aInvinDelay = 0;
}
}
} else {
text1 = "PAUSED";
}
}
function addExtend(thisLetter) {
eval ("extendDisplay.bub" + thisLetter)._visible = true;
extendArray[thisLetter] = true;
extendCheck = true;
i = 0;
while (i < 6) {
if (!extendArray[i]) {
extendCheck = false;
}
i++;
}
if (extendCheck) {
extendDisplay.gotoandplay("congratulations");
}
}
function spawnPrize(wherex, wherey) {
prizeNum++;
prizeName = "prize" + prizeNum;
duplicateMovieClip ("prize", "prize" + prizeNum, prizeNum + 8500);
_root[prizeName]._x = wherex;
_root[prizeName]._y = wherey;
_root[prizeName].active = true;
}
function aDie() {
aFroze = true;
a.a.gotoandplay("die");
aLives--;
if (alives < 0) {
gameOver();
}
aFireSpeed = 4;
aFireLength = 30;
removeBaron();
}
function removeBaron() {
baron.active = false;
baron._x = -10;
baron._y = -10;
levelTimer = 201;
}
function aReborn() {
a._x = 50;
a._y = 350;
aInvin = true;
aFroze = false;
}
function gameOver() {
_root.score = ascore;
stopAllSounds();
killAllMonsters();
gotoAndStop (3);
}
stop();
aspeed = 8;
ascore = 0;
alives = 5;
enterLevel();
aFireSpeed = 4;
aFireLength = 30;
extendArray = new Array(6);
i = 0;
while (i < 6) {
eval ("extendDisplay.bub" + i)._visible = false;
i++;
}
Instance of Symbol 74 MovieClip in Frame 2
onClipEvent (enterFrame) {
_root.frameActions();
}
Instance of Symbol 85 MovieClip "bub" in Frame 2
onClipEvent (load) {
if (faceleft) {
hi = -_root.aFireLength;
} else {
hi = _root.aFireLength;
}
}
onClipEvent (enterFrame) {
if (!_root.paused) {
if (_root.killBubbles) {
removeMovieClip(this);
}
if (_root.hscene.hittest(this._x, this._y, true)) {
hi = 0;
}
this._x = this._x + hi;
hi = hi * 0.8;
if (this._x < 40) {
this._x = 41;
}
if (this._x > 397) {
this._x = 396;
}
this._y = this._y - 2;
if (this._y < -10) {
removeMovieClip(this);
_root.bubtot--;
}
if (this.hittest(_root.a) and (!popped)) {
if (this._y > (_root.a._y + 5)) {
_root.jumping = false;
_root.avi = 0;
} else {
popped = true;
this.gotoAndPlay("pop");
_root.ascore = _root.ascore + 10;
}
}
if ((hi > 18) or (hi < -18)) {
i = 1;
while (i < (_root.levelMonsterTot + 1)) {
cname = "c" + i;
if (_root[cname].hittest(this)) {
if (!_root[cname].captured) {
_root[cname].captured = true;
removeMovieClip(this);
}
}
i++;
}
}
}
}
Instance of Symbol 90 MovieClip "c" in Frame 2
onClipEvent (load) {
cdir = 1;
cspeed = 8;
}
onClipEvent (enterFrame) {
if (active and (!_root.paused)) {
if (!captured) {
vi = vi + 4;
if (_root.vscene.hittest(this._x, this._y, true)) {
vi = 0;
this._y = (Math.floor((this._y / 50) + 0.5) * 50) - 10;
}
if (this._y > 410) {
this._y = -10;
}
if (((random(40) == 1) and (vi == 0)) and (this._y > 60)) {
vi = -30;
}
this._y = this._y + vi;
if (vi > 8) {
vi = 8;
}
if (random(50) == 1) {
if (random(2) == 1) {
cdir = 1;
} else {
cdir = -1;
}
}
this._x = this._x + (cdir * cspeed);
if (_root.hscene.hittest(this._x, this._y, true)) {
if (cdir == -1) {
cdir = 1;
} else {
cdir = -1;
}
}
if (this._x < 40) {
cdir = 1;
}
if (this._x > 380) {
cdir = -1;
}
if (cdir == 1) {
this.gotoAndStop(1);
} else {
this.gotoAndStop(2);
}
} else {
if (!caughtAlready) {
caughtAlready = true;
this.c.gotoAndPlay("caught");
} else {
caughtTimer++;
if (caughtTimer > 200) {
caughtVisDelay++;
}
if (caughtVisDelay > 2) {
this._visible = 0;
}
if (caughtVisDelay > 3) {
this._visible = 1;
caughtVisDelay = 0;
}
if (caughtTimer > 250) {
this._visible = 1;
caughtTimer = 0;
caughtVisDelay = 0;
caughtAlready = false;
active = true;
captured = false;
this.c.gotoAndStop(1);
cspeed = 16;
}
}
this._y = this._y - 1;
if (this._y < 50) {
this._y = this._y + 1;
}
}
if (this.hittest(_root.afeet)) {
if (!captured) {
if ((!_root.afroze) and (!_root.ainvin)) {
_root.aDie();
}
} else {
_root.spawnPrize(this._x, this._y);
_root.killMonster();
removeMovieClip(this);
}
}
}
}
Instance of Symbol 98 MovieClip "prize" in Frame 2
onClipEvent (load) {
if (random(2) == 1) {
hi = 1;
} else {
hi = -1;
}
if (random(2) == 1) {
vi = 1;
} else {
vi = -1;
}
}
onClipEvent (enterFrame) {
if (active and (!_root.paused)) {
lifeCounter++;
if (lifeCounter > 10) {
active = false;
this.gotoAndStop(random(9) + 2);
} else {
this._x = this._x + (hi * 35);
this._y = this._y + (vi * 35);
if ((this._x > 360) or (this._x < 40)) {
hi = hi * -1;
}
if ((this._y < 40) or (this._y > 315)) {
vi = vi * -1;
}
}
} else if (!_root.paused) {
fruitLifeCounter++;
if ((fruitLifeCounter > 100) or _root.killPrizes) {
removeMovieClip(this);
}
if (_root.a.hittest(this) and (!scoreShown)) {
scoreShown = true;
this.gotoAndPlay("score");
}
}
}
Instance of Symbol 117 MovieClip "extendBub" in Frame 2
onClipEvent (load) {
thisLetter = random(6);
gotoAndStop(thisLetter + 1 +1);
}
onClipEvent (enterFrame) {
if (active and (!_root.paused)) {
this._y = this._y - 4;
if (_root.a.hittest(this)) {
_root.addExtend(thisLetter);
removeMovieClip(this);
}
if (this._y < -20) {
removeMovieClip(this);
}
}
}
Instance of Symbol 162 MovieClip "gift" in Frame 2
onClipEvent (enterFrame) {
if (active) {
if (this.hittest(_root.a)) {
this._x = -50;
this._y = -50;
this.active = false;
if (giftType == 1) {
_root.aFireSpeed = 2;
} else if (giftType == 2) {
_root.aFireLength = 50;
} else if (giftType == 3) {
_root.bigLightening.play();
} else if (giftType == 4) {
_root.aInvin = true;
} else if (giftType == 5) {
}
}
}
}
Instance of Symbol 169 MovieClip "baron" in Frame 2
onClipEvent (enterFrame) {
if (active and (!_root.paused)) {
baronTimer++;
if (this.hittest(_root.a)) {
_root.aDie();
}
if (baronTimer > 20) {
baronTimer = 0;
if (baronDir == 1) {
baronDir = 2;
if (this._x > _root.a._x) {
this._x = this._x - baronSpeed;
} else {
this._x = this._x + baronSpeed;
}
} else {
baronDir = 1;
if (this._y > _root.a._y) {
this._y = this._y - baronSpeed;
} else {
this._y = this._y + baronSpeed;
}
}
}
}
}
onClipEvent (load) {
baronSpeed = 60;
}
Instance of Symbol 175 MovieClip "diamond" in Frame 2
onClipEvent (enterFrame) {
if (this.hittest(_root.a)) {
this.play();
}
}
Frame 3
stop();
scoreDisplay = _root.score;
Symbol 8 Button
on (release) {
play();
}
Symbol 18 MovieClip Frame 1
if (this.sessionstarted != 1) {
this.arcade = new LoadVars();
this.sessionvars = new LoadVars();
this.arcade.gamename = "bbobble";
this.arcade.sessdo = "sessionstart";
this.arcade.sendAndLoad("arcade.php", sessionvars, "POST");
if (this.sessionvars.sessiontype != 2) {
_root.is_a_challenge = 0;
} else {
_root.is_a_challenge = 1;
}
this.sessionstarted = 1;
}
if (_root.gameover == 1) {
if ((this.askpermission != 1) && (this.sessionvars.connStatus == 1)) {
this.prequestvars = new LoadVars();
this.pranswer = new LoadVars();
this.prequestvars.gametime = this.sessionvars.gametime;
this.prequestvars.fakekey = this.sessionvars.initbar;
_root.score = int(Number(_root.score));
if (_root.score != 0) {
this.prequestvars.score = _root.score;
} else {
this.prequestvars.score = -1;
}
this.prequestvars.id = this.sessionvars.lastid;
this.prequestvars.sessdo = "permrequest";
this.prequestvars.note = (this.prequestvars.id * this.prequestvars.score) * this.prequestvars.fakekey;
this.prequestvars.sendAndLoad("./arcade.php", this.pranswer, "POST");
this.askpermission = 1;
}
if ((this.pranswer.validate == 1) && (this.finalsent != 1)) {
this.burnscore = new LoadVars();
this.burnscore.microone = this.pranswer.microone;
this.burnscore.gametime = this.prequestvars.gametime;
this.burnscore.id = this.prequestvars.id;
if (_root.score == 0) {
this.burnscore.noscore = 1;
}
this.burnscore.sessdo = "burn";
this.burnscore.send("./arcade.php", "_self", "POST");
this.finalsent = 1;
}
}
Symbol 22 MovieClip Frame 1
stop();
Symbol 52 MovieClip Frame 1
stop();
Symbol 70 Button
on (release) {
play();
}
Symbol 77 MovieClip Frame 1
stop();
Symbol 77 MovieClip Frame 6
gotoAndStop (1);
Symbol 77 MovieClip Frame 20
gotoAndStop (1);
_root.aReborn();
Symbol 76 MovieClip Frame 1
stop();
Symbol 85 MovieClip Frame 1
stop();
Symbol 85 MovieClip Frame 16
_root.bubtot--;
removeMovieClip(this);
Symbol 91 MovieClip Frame 1
stop();
Symbol 91 MovieClip Frame 16
gotoAndPlay (5);
Symbol 90 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 20
_root.ascore = _root.ascore + 100;
Symbol 98 MovieClip Frame 27
removeMovieClip(this);
Symbol 117 MovieClip Frame 1
stop();
Symbol 138 MovieClip Frame 1
stop();
Symbol 162 MovieClip Frame 1
stop();
Symbol 169 MovieClip Frame 1
stop();
Symbol 172 MovieClip Frame 1
stop();
Symbol 172 MovieClip Frame 16
_root.killAllMonsters(true);
_root.endThisLevel();
Symbol 175 MovieClip Frame 1
stop();
Symbol 175 MovieClip Frame 2
_root.ascore = _root.ascore + 500;
Symbol 175 MovieClip Frame 8
removeMovieClip(this);
Symbol 180 Button
on (release) {
_root.gameover = 1;
}
Symbol 184 Button
on (release) {
gotoAndStop (1);
}
Symbol 191 Button
on (release) {
_root.gameover = 1;
}
Symbol 192 Button
on (release) {
gotoAndStop (1);
}