Frame 1
music = new Sound();
music.attachSound("music");
splash = new Sound();
splash.attachSound("splash");
kill = new Sound();
kill.attachSound("shoot");
loselife = new Sound();
loselife.attachSound("babycry");
music_flag = true;
music.start(1, 100);
stop();
Frame 2
function initGame() {
attachMovie("life_gauge", "lfgg", 999991);
attachMovie("level_indicator", "level_indicator", 999992);
attachMovie("time_bar", "time_bar", 999993);
attachMovie("scBoard", "scBoard", 999995);
_root.lfgg._x = 18;
_root.lfgg._y = 35;
_root.level_indicator._x = -21;
_root.level_indicator._y = 67;
_root.time_bar._x = 132;
_root.time_bar._y = 7;
_root.scBoard._x = 434;
_root.scBoard._y = 10;
nextBalloonTime = 0;
nextBalloon = 0;
balloons = [];
numBalloons = 20;
nextBulletTime = 0;
nextBullet = 0;
bullets = [];
bulletTime = 1000;
nextCollectible = 0;
collectibles = [];
score = 0;
level = 1;
pause_var = false;
next_level._visible = false;
life_up._visible = false;
balloonCooldown = 2000;
lives = 3;
undies = 0;
total_undies = 10;
girls_shot = 0;
_root.lfgg.gotoAndPlay(lives);
time_bar.remaining_girls = (("collected " + undies) + " of ") + total_undies;
}
function newBalloon() {
if (nextBalloon < numBalloons) {
if (getTimer() > nextBalloonTime) {
if (Math.Random() < 0.5) {
random_number = Math.Random();
if (random_number < 0.3) {
attachMovie("balloon", "balloon" + nextBalloon, nextBalloon);
} else if (random_number < 0.6) {
attachMovie("balloon2", "balloon" + nextBalloon, nextBalloon);
} else if (random_number < 0.8) {
attachMovie("balloon3", "balloon" + nextBalloon, nextBalloon);
} else {
attachMovie("balloon4", "balloon" + nextBalloon, nextBalloon);
}
_root["balloon" + nextBalloon]._y = 60 + int(Math.Random() * 100);
if (Math.Random() < 0.5) {
_root["balloon" + nextBalloon]._x = -30;
dx = (int(Math.Random() * 3) + 2) + level;
} else {
_root["balloon" + nextBalloon]._x = 580;
dx = ((-int(Math.Random() * 3)) - 2) - level;
}
if (_root["balloon" + nextBalloon]._x == -30) {
_root["balloon" + nextBalloon]._xscale = -_root["balloon" + nextBalloon]._xscale;
}
balloons.push({clip:"balloon" + nextBalloon, d:dx});
_root.time_bar.time_bar_fill._width = (270 * nextBalloon) / numBalloons;
nextBalloon++;
nextBalloonTime = getTimer() + balloonCooldown;
}
}
}
}
function moveBalloons() {
i = balloons.length - 1;
while (i >= 0) {
dx = balloons[i].d;
balloon = _root[balloons[i].clip];
balloon._x = balloon._x + dx;
if ((dx < 0) and (balloon._x < -20)) {
balloon.removeMovieClip();
balloons.splice(i, 1);
} else if ((dx > 0) and (balloon._x > 570)) {
balloon.removeMovieClip();
balloons.splice(i, 1);
}
i--;
}
if (undies != total_undies) {
if ((nextBalloon >= numBalloons) and (balloons.length < 1)) {
if (collectibles.length < 1) {
gotoAndStop ("game over");
}
}
}
}
function loadLevel() {
fox._x = 280.3;
i = balloons.length - 1;
while (i >= 0) {
balloon = _root[balloons[i].clip];
balloon.removeMovieClip();
balloons.splice(i, 1);
i--;
}
pause_var = true;
next_level._visible = true;
if (level == 3) {
life_up._visible = true;
}
girls_shot = 0;
if (level == 2) {
attachMovie("stage2", "stage2", stage1.getDepth());
stage2._x = 275;
stage2._y = 200;
nextBalloon = 0;
numBalloons = 30;
balloonCooldown = 1500;
undies = 0;
total_undies = 15;
}
if (level == 3) {
attachMovie("stage3", "stage3", stage2.getDepth());
stage3._x = 275;
stage3._y = 250;
nextBalloon = 0;
numBalloons = 60;
balloonCooldown = 1000;
undies = 0;
total_undies = 20;
lives++;
_root.lfgg.gotoAndPlay(lives);
}
if (level == 4) {
attachMovie("stage4", "stage4", stage3.getDepth());
stage4._x = 275;
stage4._y = 200;
nextBalloon = 0;
numBalloons = 80;
balloonCooldown = 800;
bulletTime = 300;
undies = 0;
total_undies = 25;
}
if (level == 5) {
attachMovie("stage5", "stage5", stage4.getDepth());
stage5._x = 275;
stage5._y = 200;
nextBalloon = 0;
numBalloons = 90;
balloonCooldown = 500;
bulletTime = 250;
undies = 0;
total_undies = 30;
}
time_bar.remaining_girls = (("collected " + undies) + " of ") + total_undies;
}
function moveFox() {
if (Key.isDown(37)) {
dx = -10;
if (fox._x < 10) {
dx = 0;
}
fox._xscale = Math.abs(fox._xscale);
} else if (Key.isDown(39)) {
dx = 10;
if (fox._x > 540) {
dx = 0;
}
fox._xscale = -Math.abs(fox._xscale);
} else {
dx = 0;
}
fox._x = fox._x + dx;
if ((dx == 0) and (fox._currentFrame != 1)) {
fox.gotoAndStop(1);
} else if ((dx != 0) and (fox._currentFrame == 1)) {
fox.gotoAndPlay(2);
}
}
function shootBullet() {
if (getTimer() > nextBulletTime) {
_root.splash.start(0, 1);
attachMovie("bullet", "bullet" + nextBullet, nextBullet + 9999);
_root["bullet" + nextBullet]._x = fox._x + 2;
_root["bullet" + nextBullet]._y = fox._y - 55;
bullets.push(nextBullet);
nextBullet++;
nextBulletTime = getTimer() + bulletTime;
}
}
function moveBullets() {
i = bullets.length - 1;
while (i >= 0) {
bullet = _root["bullet" + bullets[i]];
bullet._y = bullet._y - 10;
if (bullet._y < 0) {
bullet.removeMovieClip();
bullets.splice(i, 1);
} else if (checkCollision(bullet)) {
kill.start(0, 1);
bullet.removeMovieClip();
bullets.splice(i, 1);
girls_shot++;
time_bar.remaining_girls = (("collected " + undies) + " of ") + total_undies;
}
i--;
}
}
function drops(spawnx, spawny) {
random_number = Math.random();
if (random_number < 0.3) {
attachMovie("collectible1", "collectible" + nextCollectible, nextCollectible + 7999);
} else if (random_number < 0.6) {
attachMovie("collectible2", "collectible" + nextCollectible, nextCollectible + 7999);
} else if (random_number < 0.8) {
attachMovie("collectible3", "collectible" + nextCollectible, nextCollectible + 7999);
} else {
attachMovie("collectible4", "collectible" + nextCollectible, nextCollectible + 7999);
_root["collectible" + nextCollectible].baby = true;
}
_root["collectible" + nextCollectible]._x = spawnx;
_root["collectible" + nextCollectible]._y = spawny;
collectibles.push(nextCollectible);
nextCollectible++;
}
function moveDrops() {
i = collectibles.length - 1;
while (i >= 0) {
collectible = _root["collectible" + collectibles[i]];
collectible._y = collectible._y + 10;
if (collectible._y > 400) {
collectible.removeMovieClip();
collectibles.splice(i, 1);
} else if (distance(collectible, fox) < 70) {
if ((collectible._x > (fox._x - 28)) and (collectible._x < (fox._x + 28))) {
if (collectible.baby == true) {
lives--;
_root.loselife.start(0, 1);
_root.lfgg.gotoAndPlay(lives);
if (!lives) {
_root.gotoAndPlay(4);
}
collectible.removeMovieClip();
collectibles.splice(i, 1);
break;
}
point = attachMovie("p10", "p10" + nextCollectible, getNextHighestDepth());
point._x = collectible._x;
point._y = collectible._y;
collectible.removeMovieClip();
collectibles.splice(i, 1);
_root.score = _root.score + 10;
_root.undies++;
time_bar.remaining_girls = (("collected " + undies) + " of ") + total_undies;
if (undies == total_undies) {
level++;
if (level == 6) {
total = score * lives;
_root.gotoAndPlay(5);
}
loadLevel();
}
}
}
i--;
}
}
function checkCollision(bullet) {
j = balloons.length - 1;
while (j >= 0) {
balloon = _root[balloons[j].clip];
if (distance(bullet, balloon) < 65) {
if (bullet._y >= balloon._y) {
balloon.gotoAndPlay(2);
drops(balloon._x, balloon._y);
balloons.splice(j, 1);
return(true);
}
}
j--;
}
return(false);
}
function distance(clip1, clip2) {
dx = clip1._x - clip2._x;
dy = clip1._y - clip2._y;
return(Math.sqrt((dx * dx) + (dy * dy)));
}
stop();
Instance of Symbol 126 MovieClip "fox" in Frame 2
onClipEvent (load) {
_root.initGame();
}
onClipEvent (enterFrame) {
if (!_root.pause_var) {
_root.moveBalloons();
_root.moveFox();
_root.moveBullets();
_root.moveDrops();
_root.newBalloon();
}
}
Instance of Symbol 139 MovieClip "next_level" in Frame 2
on (release) {
this._visible = false;
_root.life_up._visible = false;
_root.pause_var = false;
}
Frame 3
i = _root.bullets.length - 1;
while (i >= 0) {
bullet = _root["bullet" + bullets[i]];
bullet.removeMovieClip();
i--;
}
i = balloons.length - 1;
while (i >= 0) {
balloon = _root[balloons[i].clip];
balloon.removeMovieClip();
balloons.splice(i, 1);
i--;
}
removeMovieClip("lfgg");
removeMovieClip("level_indicator");
removeMovieClip("time_bar");
removeMovieClip("speaker");
removeMovieClip("scBoard");
stop();
Frame 4
i = _root.bullets.length - 1;
while (i >= 0) {
bullet = _root["bullet" + bullets[i]];
bullet.removeMovieClip();
i--;
}
i = balloons.length - 1;
while (i >= 0) {
balloon = _root[balloons[i].clip];
balloon.removeMovieClip();
balloons.splice(i, 1);
i--;
}
removeMovieClip("lfgg");
removeMovieClip("level_indicator");
removeMovieClip("time_bar");
removeMovieClip("speaker");
removeMovieClip("scBoard");
stop();
Frame 5
i = _root.bullets.length - 1;
while (i >= 0) {
bullet = _root["bullet" + bullets[i]];
bullet.removeMovieClip();
i--;
}
i = balloons.length - 1;
while (i >= 0) {
balloon = _root[balloons[i].clip];
balloon.removeMovieClip();
balloons.splice(i, 1);
i--;
}
removeMovieClip("lfgg");
removeMovieClip("level_indicator");
removeMovieClip("time_bar");
removeMovieClip("speaker");
removeMovieClip("scBoard");
stop();
Symbol 26 MovieClip [balloon2] Frame 1
stop();
Symbol 26 MovieClip [balloon2] Frame 4
this.removeMovieClip();
stop();
Symbol 34 MovieClip [balloon3] Frame 1
stop();
Symbol 34 MovieClip [balloon3] Frame 4
this.removeMovieClip();
stop();
Symbol 43 MovieClip [balloon4] Frame 1
stop();
Symbol 43 MovieClip [balloon4] Frame 4
this.removeMovieClip();
stop();
Symbol 52 MovieClip [p10] Frame 15
this.removeMovieClip();
Symbol 62 MovieClip [life_gauge] Frame 1
stop();
Symbol 62 MovieClip [life_gauge] Frame 2
stop();
Symbol 62 MovieClip [life_gauge] Frame 3
stop();
Symbol 62 MovieClip [life_gauge] Frame 4
stop();
Symbol 94 MovieClip [balloon] Frame 1
stop();
Symbol 94 MovieClip [balloon] Frame 4
this.removeMovieClip();
stop();
Symbol 99 Button [speaker]
on (press) {
music_flag = !music_flag;
if (music_flag) {
music.start(1, 100);
} else {
music.stop();
}
}
Symbol 106 Button
on (press) {
gotoAndPlay ("Play");
}
Symbol 120 Button
on (release) {
getURL ("http://www.blowtoons.com/adult", "_blank");
}
Symbol 124 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 6
gotoAndPlay ("run left");
Symbol 128 Button
on (keyPress "<Space>") {
if (!pause_var) {
_root.shootBullet();
} else {
next_level._visible = false;
life_up._visible = false;
_root.pause_var = false;
}
}
Symbol 130 Button
on (keyPress "p") {
_root.pause_var = !_root.pause_var;
}
Symbol 141 Button
on (press) {
gotoAndPlay (2);
}
Symbol 159 Button
on (press) {
gotoAndPlay (2);
}