Frame 1
function nextStage() {
clearPopArea();
currStage++;
messageBox._visible = true;
messageBox.txtMessage.text = eval ("txtStage" + currStage);
if (currStage > stageCount) {
gotoAndPlay ("gameEnd");
currStage = 0;
messageBox.btnGo.txtLabel.text = "New Game";
messageBox.txtMessage.text = "Game over\n\nTotal Score: " + getTotalScore();
}
}
function startNextStage() {
messageBox._visible = false;
gotoAndPlay("stage" + currStage);
}
function clearPopArea() {
for (var _local1 in popArea) {
rdot = popArea[_local1];
rdot.removeMovieClip();
}
}
function getTotalScore() {
var _local1 = 0;
_local1 = _local1 + (scoreArray[0] * 0.65);
_local1 = _local1 - (scoreArray[1] * 1.53);
_local1 = _local1 + (scoreArray[2] * 0.8);
_local1 = _local1 + (scoreArray[3] * 1.85);
_local1 = Math.ceil(_local1);
if (_local1 < 0) {
_local1 = 0;
}
return(_local1);
}
stop();
var scoreArray = new Array();
var currStage = 0;
var stageCount = 4;
var txtStage1 = "Stage 1\n\nMove your mouse over the dots to pop them. Pop as many as you can before time runs out!\n\nWatch out though, it may start getting hard to pop them!";
var txtStage2 = "Stage 2\n\nHow long will it take you to pop 1000 dots? I bet you can't do it under 30 seconds!";
var txtStage3 = "Stage 3\n\nPop as many dots as you can before they all disappear!\n\nEverytime you pop one, two more will appear, but don't let that fool you into thinking it'll be easy!";
var txtStage4 = "Stage 4\n\nChase the dot around, and see how many times you can catch it before time runs out!";
nextStage();
Frame 9
function rand(low, high) {
return(Math.floor(Math.random() * ((high - low) + 1)) + low);
}
stop();
var maxSize = 120;
var minSize = 10;
var maxX = Stage.width;
var maxY = (Stage.height - popArea._y);
var scaleDamp = 0.25;
var alphaDamp = 0.5;
var speed = 20;
var i = 0;
var numPop = 0;
var currLvl = 1;
_root.txtLevel.text = "Level " + currLvl;
var nextLvlDamp = 100;
id = setInterval(function () {
i++;
var ndot = popArea.attachMovie("dot", "ndot" + i, popArea.getNextHighestDepth());
ndot._x = rand(-20, maxX + 20);
ndot._y = rand(-20 + popArea._y, maxY + 20);
ndot._width = (ndot._height = rand(minSize, maxSize));
ndot._alpha = 0;
ndot.useHandCursor = false;
ndot.onRollOver = function () {
ndot.removeMovieClip();
numPop++;
var _local2 = new Sound();
_local2.attachSound("pop");
_local2.setVolume(20);
_local2.start();
if (((numPop % nextLvlDamp) == 0) || (nextLvlDamp < 0)) {
nextLvlDamp = nextLvlDamp / 2;
currLvl++;
_root.txtLevel.text = "Level " + currLvl;
scaleDamp = scaleDamp + 0.05;
alphaDamp = alphaDamp + 0.1;
maxSize = maxSize - 5;
minSize = minSize - 1;
}
};
for (var _local2 in popArea) {
rdot = popArea[_local2];
rdot._alpha = rdot._alpha + alphaDamp;
rdot._width = (rdot._height = rdot._height - scaleDamp);
if (rdot._width <= 1) {
rdot.removeMovieClip();
}
}
if (i >= 20000) {
i = 0;
}
}, speed);
var timer = 60;
id2 = setInterval(function () {
timer--;
if (timer == 0) {
clearInterval(id2);
clearInterval(id);
_root.scoreArray.push(numPop);
_root.nextStage();
}
}, 1000);
Frame 19
function startCount() {
intTimer = setInterval(function () {
timer++;
}, 1000);
}
function rand(low, high) {
return(Math.floor(Math.random() * ((high - low) + 1)) + low);
}
stop();
var count = 1000;
var maxSize = 80;
var minSize = 10;
var maxX = Stage.width;
var maxY = (Stage.height - popArea._y);
var margin = (maxSize / 2);
var i = 0;
var numPop = 0;
var currLvl = 0;
i = 0;
while (i < count) {
var ndot = popArea.attachMovie("dot", "ndot" + i, popArea.getNextHighestDepth());
ndot._x = rand(0 + margin, maxX - margin);
ndot._y = rand((0 + margin) + popArea._y, maxY - margin);
ndot._width = (ndot._height = rand(minSize, maxSize));
ndot._alpha = rand(40, 100);
ndot.useHandCursor = false;
ndot.onRollOver = function () {
var _local3 = new Sound();
_local3.attachSound("pop");
_local3.setVolume(15);
_local3.start();
this.removeMovieClip();
numPop++;
if (numPop == 1) {
startCount();
}
if (numPop == count) {
_root.scoreArray.push(timer);
clearInterval(intTimer);
_root.nextStage();
}
};
ndot.radius = 10 + (Math.random() * 30);
ndot.speed = 5 + (Math.random() * 20);
ndot.xcenter = rand(0 + margin, maxX - margin);
ndot.ycenter = rand(0 + margin, maxY - margin);
ndot.degree = ndot.speed;
i++;
}
var timer = 0;
var intTimer;
Frame 29
function makeDot(n) {
var _local3 = popArea.attachMovie("dot", "ndot" + n, popArea.getNextHighestDepth());
_local3._x = rand(-20, maxX + 20);
_local3._y = rand(-20 + popArea._y, maxY + 20);
_local3._width = (_local3._height = rand(minSize, maxSize));
_local3.useHandCursor = false;
_local3.onRollOver = function () {
this.removeMovieClip();
numPop++;
var _local3 = new Sound();
_local3.attachSound("pop");
_local3.setVolume(20);
_local3.start();
z = 0;
while (z < 2) {
makeDot(i++);
z++;
}
scaleDamp = scaleDamp + 0.0005;
maxSize = maxSize - 0.05;
minSize = minSize - 0.01;
if ((numPop % 100) == 0) {
currLvl++;
_root.txtLevel.text = "Level " + currLvl;
}
};
}
function rand(low, high) {
return(Math.floor(Math.random() * ((high - low) + 1)) + low);
}
stop();
var count = 500;
var maxSize = 120;
var minSize = 10;
var maxX = Stage.width;
var maxY = (Stage.height - popArea._y);
var scaleDamp = 0.25;
var alphaDamp = 0.5;
var speed = 20;
var i = 0;
var numPop = 0;
var currLvl = 1;
_root.txtLevel.text = "Level " + currLvl;
i = 0;
while (i < count) {
makeDot(i);
i++;
}
id = setInterval(function () {
var _local2 = 0;
for (var _local3 in popArea) {
_local2++;
rdot = popArea[_local3];
rdot._width = (rdot._height = rdot._height - scaleDamp);
if (rdot._width <= 1) {
rdot.removeMovieClip();
}
}
if (_local2 == 0) {
_root.scoreArray.push(numPop);
clearInterval(id);
_root.nextStage();
}
}, 10);
Frame 39
function makeDot(n) {
var _local2 = popArea.attachMovie("dot", "ndot" + n, popArea.getNextHighestDepth());
_local2._x = rand(0 + margin, maxX - margin);
_local2._y = rand((0 + margin) + popArea._y, maxY - margin);
_local2._width = (_local2._height = rand(minSize, maxSize));
_local2.useHandCursor = false;
_local2.onRollOver = function () {
this.removeMovieClip();
numPop++;
if (numPop == 1) {
startCount();
}
makeDot(i++);
var _local2 = new Sound();
_local2.attachSound("pop");
_local2.setVolume(20);
_local2.start();
};
}
function startCount() {
intTimer = setInterval(function () {
timer--;
if (timer == 0) {
_root.scoreArray.push(numPop);
clearInterval(intTimer);
_root.nextStage();
}
}, 1000);
}
function rand(low, high) {
return(Math.floor(Math.random() * ((high - low) + 1)) + low);
}
stop();
var maxSize = 50;
var minSize = 5;
var maxX = Stage.width;
var maxY = (Stage.height - popArea._y);
var margin = (maxSize / 2);
var i = 0;
var numPop = 0;
_root.txtLevel.text = "";
makeDot(i);
var timer = 30;
var intTimer;
Frame 49
stop();
var score = "score: ";
for (var n in scoreArray) {
score = score + (scoreArray[n] + ", ");
}
Symbol 16 Button
on (release) {
_root.startNextStage();
}
Symbol 18 MovieClip Frame 1
function rand(low, high) {
return(Math.floor(Math.random() * ((high - low) + 1)) + low);
}
stop();
var maxSize = 120;
var minSize = 10;
var maxX = 300;
var maxY = 95;
var scaleDamp = 1;
var alphaDamp = 0.5;
var speed = 10;
var i = 0;
var numPop = 0;
var currLvl = 1;
_root.txtLevel.text = "Level " + currLvl;
var nextLvlDamp = 100;
id = setInterval(function () {
i++;
var _local1 = popArea.attachMovie("dot", "ndot" + i, popArea.getNextHighestDepth());
_local1._x = rand(-20, maxX + 20);
_local1._y = rand(-20 + popArea._y, maxY + 20);
_local1._width = (_local1._height = rand(minSize, maxSize));
_local1._alpha = 0;
for (var _local2 in popArea) {
rdot = popArea[_local2];
rdot._alpha = rdot._alpha + alphaDamp;
rdot._width = (rdot._height = rdot._height - scaleDamp);
if (rdot._width <= 1) {
rdot.removeMovieClip();
}
}
if (i >= 20000) {
i = 0;
}
}, speed);