Frame 1
var total;
var loaded;
var percent;
var submitID;
mcLoaderBar._width = 0;
total = getBytesTotal();
loaded = getBytesLoaded();
percent = Math.round((100 * loaded) / total);
mcLoaderBar._width = (310 * percent) / 100;
dt1.text = percent + "%";
if (percent >= 100) {
gotoAndPlay (10);
}
Frame 2
gotoAndPlay (1);
Frame 10
var bugs = new Array();
var numberOfBugs;
var timeCheckInterval;
var highScore = 0;
stop();
beeSound.stop();
beeSound.tabIndex = 1;
mcStartBanner.btStartButton.onPress = function () {
play();
};
duplicateMovieClip (mcPlayAgainBanner, "playAgainBanner", 400);
playAgainBanner._y = 140;
playAgainBanner._x = 725;
duplicateMovieClip (btPlayAgain, "playAgainButt", 401);
playAgainButt._x = 725;
playAgainButt.onPress = function () {
gotoAndPlay ("start");
};
btBuzzButt.buzzOn = true;
btBuzzButt.onPress = function () {
if (this.buzzOn) {
this.gotoAndStop("buzz off");
this.buzzOn = false;
} else {
this.gotoAndStop("buzz on");
this.buzzOn = true;
}
};
Frame 11
gotoAndPlay ("start");
duplicateMovieClip (mcThumb, "thumbCursor", 300);
onEnterFrame = function () {
thumbCursor._y = _ymouse;
if (_ymouse < 55) {
thumbCursor._y = 55;
} else if (_ymouse > 420) {
thumbCursor._y = 420;
}
thumbCursor._x = _xmouse;
if (_xmouse < 0) {
thumbCursor._x = 0;
} else if (_xmouse > 700) {
thumbCursor._x = 700;
}
};
onMouseDown = function () {
thumbCursor.gotoAndStop(2);
};
onMouseUp = function () {
thumbCursor.gotoAndStop(1);
};
Frame 16
function checkTimer() {
if (mcTimer.timerDone) {
endRound();
clearInterval(timeCheckInterval);
}
}
function makeNewBug(whichBug, whichType) {
this.attachMovie("bug" + whichType, "bug" + whichBug, 200 + whichBug);
bugs[whichBug] = eval ("bug" + whichBug);
numberOfBugs = numberOfBugs + 1;
if (whichType == 2) {
bugs[whichBug].swapDepths(200);
}
bugs[whichBug].tag = whichBug;
bugs[whichBug].live = true;
if (Math.floor(Math.random() * 2) == 0) {
bugs[whichBug]._x = -100;
} else {
bugs[whichBug]._x = 750;
}
bugs[whichBug]._y = Math.floor((Math.random() * ((mcFlyZone._height - mcFlyZone._y) - bugs[whichBug]._height)) + mcFlyZone._y);
bugs[whichBug].onPress = function () {
if (btBuzzButt.buzzOn) {
mcSquishSound.gotoAndPlay(2);
}
this.gotoAndPlay("splat");
clearInterval(bugs[this.tag].bugInterval);
bugs[this.tag].swapDepths(splatDepth);
splatDepth = splatDepth + 1;
bugs[this.tag].live = false;
delete this.onPress;
score = score + bugs[this.tag].points;
dtScore.text = "Score: " + score;
if (score > highScore) {
highScore = score;
}
makeNewBug(numberOfBugs, this.bugType);
};
}
function removeBug(whichBug) {
removeMovieClip(bugs[whichBug]);
}
function endRound() {
count = 0;
while (count < numberOfBugs) {
clearInterval(bugs[count].bugInterval);
delete bugs[count].onEnterFrame;
if (bugs[count].live) {
removeMovieClip(bugs[count]);
}
playAgainBanner.dtHighScore.text = "high score this session: " + highScore;
playAgainBanner.dtScore.text = "score: " + score;
playAgainBanner._x = 95;
thumbCursor._visible = false;
Mouse.show();
beeSound.stop();
btBuzzButt._visible = true;
gotoAndPlay ("finish");
count++;
}
}
Mouse.hide();
thumbCursor._visible = true;
playAgainBanner._x = 725;
playAgainButt._x = 725;
btBuzzButt._visible = false;
if (btBuzzButt.buzzOn) {
beeSound.gotoAndPlay(10);
}
splatDepth = 100;
score = 0;
dtScore.text = "Score: " + score;
count = 0;
while (count < numberOfBugs) {
clearInterval(bugs[count].bugInterval);
removeMovieClip(bugs[count]);
count++;
}
numberOfBugs = 0;
makeNewBug(0, 0);
makeNewBug(1, 0);
makeNewBug(2, 1);
makeNewBug(3, 1);
makeNewBug(4, 2);
mcTimer.timerDone = false;
mcTimer.run(30);
timeCheckInterval = setInterval(checkTimer, 100);
Frame 18
stop();
Frame 59
function buttFade() {
playAgainButt._alpha = playAgainButt._alpha + 5;
if (playAgainButt._alpha >= 100) {
clearInterval(buttFadeInterval);
}
}
var buttFadeInterval;
stop();
playAgainButt._alpha = 0;
playAgainButt._x = 250;
playAgainButt._y = 230;
buttFadeInterval = setInterval(buttFade, 40);
Symbol 6 Button
on (press) {
getURL ("http://zuzugames.com/?smash-the-bugs", "_blank", "POST");
}
Symbol 20 MovieClip Frame 1
function allOff() {
count = 1;
while (count < 5) {
flap[count]._visible = false;
count++;
}
}
var count;
var bob;
var flap = new Array(10);
var blurX;
var whichOne = new Array(5);
blurX = mcBlur._x;
count = 1;
while (count < 5) {
flap[count] = eval ("w" + count);
flap[count]._alpha = 60;
count++;
}
whichOne = [1, 3, 2, 4];
bob = 0;
onEnterFrame = function () {
allOff();
flap[whichOne[bob]]._rotation = (Math.random() * 10) - 5;
flap[whichOne[bob]]._visible = true;
bob = bob + 1;
if (bob == 4) {
bob = 0;
}
mcBlur._x = blurX + Math.floor((Math.random() * 5) - 2);
};
Symbol 33 MovieClip [bug2] Frame 1
function bugBrain() {
if (bugCounter > maxSitTime) {
oldX = thisBug._x;
oldY = thisBug._y;
newX = Math.floor((Math.random() * ((rightLim - leftLim) - thisBug._width)) + leftLim);
newY = Math.floor((Math.random() * ((bottomLim - topLim) - thisBug._height)) + topLim);
xDistance = (newX - oldX) / 5;
yDistance = (newY - oldY) / 5;
bugCounter = Math.floor(Math.random() * (maxSitTime - minSitTime));
}
thisBug._x = thisBug._x + xDistance;
thisBug._y = thisBug._y + yDistance;
if (Math.abs(thisBug._x - newX) < 10) {
xDistance = 0;
}
if (Math.abs(thisBug._y - newY) < 10) {
yDistance = 0;
}
bugCounter = bugCounter + 1;
}
var count;
var slideDelay = 150;
var oldX;
var oldY;
var newX;
var newY;
var xDistance;
var yDistance;
var bugCounter;
var bugInterval;
var thisBug;
var leftLim = -150;
var rightLim = 850;
var topLim = 55;
var bottomLim = 421;
var minSitTime = 8;
var maxSitTime = 15;
var points = 2;
var bugType = 2;
stop();
thisBug = this;
bugCounter = 40;
bugInterval = setInterval(bugBrain, 40);
Symbol 33 MovieClip [bug2] Frame 5
count = 0;
onEnterFrame = function () {
count++;
if (count >= slideDelay) {
gotoAndPlay ("fall1");
delete onEnterFrame;
}
};
Symbol 33 MovieClip [bug2] Frame 30
stop();
Symbol 33 MovieClip [bug2] Frame 56
stop();
Symbol 40 MovieClip Frame 55
stop();
Symbol 41 MovieClip [bug1] Frame 1
function bugBrain() {
if (bugCounter > maxSitTime) {
oldX = thisBug._x;
oldY = thisBug._y;
newX = Math.floor((Math.random() * ((rightLim - leftLim) - thisBug._width)) + leftLim);
newY = Math.floor((Math.random() * ((bottomLim - topLim) - thisBug._height)) + topLim);
xDistance = (newX - oldX) / 5;
yDistance = (newY - oldY) / 5;
bugCounter = Math.floor(Math.random() * (maxSitTime - minSitTime));
}
thisBug._x = thisBug._x + xDistance;
thisBug._y = thisBug._y + yDistance;
if (Math.abs(thisBug._x - newX) < 10) {
xDistance = 0;
}
if (Math.abs(thisBug._y - newY) < 10) {
yDistance = 0;
}
bugCounter = bugCounter + 1;
}
var count;
var slideDelay = 60;
var oldX;
var oldY;
var newX;
var newY;
var xDistance;
var yDistance;
var bugCounter;
var bugInterval;
var thisBug;
var leftLim = -150;
var rightLim = 850;
var topLim = 55;
var bottomLim = 421;
var minSitTime = 20;
var maxSitTime = 30;
var points = 1;
var bugType = 1;
stop();
thisBug = this;
bugCounter = 40;
bugInterval = setInterval(bugBrain, 40);
r = Math.floor(Math.random() * 4);
mcWing1.bob = r;
mcWing2.bob = r;
Symbol 41 MovieClip [bug1] Frame 10
stop();
count = 0;
onEnterFrame = function () {
count++;
if (count >= slideDelay) {
gotoAndPlay ("fall1");
delete onEnterFrame;
}
};
Symbol 41 MovieClip [bug1] Frame 44
stop();
Symbol 43 MovieClip [bug0] Frame 1
function bugBrain() {
if (bugCounter > maxSitTime) {
oldX = thisBug._x;
oldY = thisBug._y;
newX = Math.floor((Math.random() * ((rightLim - leftLim) - thisBug._width)) + leftLim);
newY = Math.floor((Math.random() * ((bottomLim - topLim) - thisBug._height)) + topLim);
xDistance = (newX - oldX) / 5;
yDistance = (newY - oldY) / 5;
bugCounter = Math.floor(Math.random() * (maxSitTime - minSitTime));
}
thisBug._x = thisBug._x + xDistance;
thisBug._y = thisBug._y + yDistance;
if (Math.abs(thisBug._x - newX) < 10) {
xDistance = 0;
}
if (Math.abs(thisBug._y - newY) < 10) {
yDistance = 0;
}
bugCounter = bugCounter + 1;
}
var count;
var slideDelay = 60;
var oldX;
var oldY;
var newX;
var newY;
var xDistance;
var yDistance;
var bugCounter;
var bugInterval;
var thisBug;
var leftLim = -150;
var rightLim = 850;
var topLim = 55;
var bottomLim = 421;
var minSitTime = 20;
var maxSitTime = 30;
var points = 1;
var bugType = 0;
stop();
thisBug = this;
bugCounter = 40;
bugInterval = setInterval(bugBrain, 40);
r = Math.floor(Math.random() * 4);
mcWing1.bob = r;
mcWing2.bob = r;
Symbol 43 MovieClip [bug0] Frame 10
stop();
count = 0;
onEnterFrame = function () {
count++;
if (count >= slideDelay) {
gotoAndPlay ("fall1");
delete onEnterFrame;
}
};
Symbol 43 MovieClip [bug0] Frame 44
stop();
Symbol 54 MovieClip Frame 1
stop();
Symbol 54 MovieClip Frame 10
stop();
Symbol 59 MovieClip Frame 1
stop();
mcClipTag._visible = false;
Symbol 59 MovieClip Frame 4
stop();
Symbol 73 Button
on (press) {
getURL ("http://zuzugames.com/?smash-the-bugs", "_blank", "POST");
}
Symbol 81 MovieClip Frame 1
stop();
Symbol 81 MovieClip Frame 2
stop();
Symbol 88 MovieClip Frame 1
function run(seconds) {
function drawBar() {
var _local1 = new Date();
msecsCur = _local1.getMilliseconds();
msecsInterval = msecsCur - msecsPrev;
if (msecsInterval < 0) {
msecsInterval = msecsInterval + 1000;
}
if (msecsInterval > 0) {
msecsTotal = msecsTotal + msecsInterval;
msecsPrev = msecsCur;
mcBar._width = (fullLength * msecsTotal) / mseconds;
if (mcBar._width > fullLength) {
mcBar._width = fullLength;
timerDone = true;
}
updateAfterEvent();
}
if (msecsTotal >= mseconds) {
clearInterval(barInterval);
timerDone = true;
}
}
var mseconds = (seconds * 1000);
var _local1 = new Date();
msecsCur = _local1.getMilliseconds();
msecsPrev = msecsCur;
msecsTotal = 0;
barInterval = setInterval(drawBar, 40);
}
var fullLength;
var barInterval;
var my_date = new Date();
var msecsCur;
var msecsPrev;
var msecsInterval;
var msecsTotal;
var timerDone = false;
fullLength = mcBar._width;
mcBar._width = 0;
stop();