Frame 2
gotoAndPlay (4);
Frame 3
stop();
Frame 7
total = Math.floor(_root.getBytesTotal() / 1024);
loaded = Math.floor(_root.getBytesLoaded() / 1024);
percent = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
loadMsg = ((((percent + "% [") + loaded) + "k of ") + total) + "k]";
bar._xscale = percent;
Frame 8
if (percent < 100) {
gotoAndPlay (7);
}
Frame 29
function fnMenuMsg(txt) {
msg = txt;
}
fscommand ("allowscale", "false");
gDtr = (Math.PI/180);
gFps = 25;
gVP = {w:512, h:384, cx:256, cy:192};
gAR = {l:25, r:gVP.w - 25, t:25, b:gVP.h - 25};
gGame = {playerScore:0, highScore:0, round:0, bugs:0, tenants:0, location:1, bonusMulti:1, maxTenants:100, skill:"Normal", quality:"MEDIUM", music:true};
gSplat = {name:"s", next:0, base:50, max:50};
gBug = {name:"b", next:0, base:100, max:100};
gTenant = {name:"t", next:0, base:200, max:25};
gAward = {name:"a", next:0, base:235, max:15};
gBonus = {max:50, next:0};
gBonus.tracker = new Array(gBonus.max);
i = 0;
while (i < gBonus.max) {
gBonus.tracker[i] = new Object();
i++;
}
Frame 30
function C_Spawner(arc, sweep, speed, rate, interval, count, teams, delay) {
this.angle = Math.round(Math.random() * 360);
this.arc = arc;
this.halfArc = arc / 2;
this.sweep = sweep;
this.teams = teams;
this.teamInterval = true;
this.intervalTime = interval;
this.rate = rate;
this.count = count;
this.counter = count;
this.speed = speed;
this.points = 10 * gGame.bonusMulti;
this.timer = delay;
}
function fnCreateBug(spawner) {
var bug;
var angle;
var x;
var y;
gBug.next = (++gBug.next) % gBug.max;
_root.attachMovie("bug1", gBug.name + gBug.next, gBug.base + gBug.next);
bug = eval (gBug.name + gBug.next);
angle = ((spawner.angle + (Math.random() * spawner.arc)) - spawner.halfArc) % 360;
x = -Math.sin(angle * gDtr);
y = Math.cos(angle * gDtr);
bug._x = gVP.cx + (x * (distance + townRadius));
bug._y = gVP.cy + (y * (distance + townRadius));
bug.time = distance / spawner.speed;
bug.xV = (-(x * distance)) / bug.time;
bug.yV = (-(y * distance)) / bug.time;
bug._rotation = angle;
bug.spawner = spawner;
bug.bonus = spawner.bonus;
spawner.angle = (spawner.angle + spawner.sweep) % 360;
dev2++;
}
function fnIntroNewTenant() {
var human;
var src;
var ang;
var x;
var y;
with (gTenant) {
next = (++next) % max;
src = "tenant" + Math.floor((Math.random() * 3) + 1);
_root.attachMovie(src, name + next, base + next);
human = eval (name + next);
}
ang = Math.random() * 360;
x = -Math.sin(ang * gDtr);
y = Math.cos(ang * gDtr);
human._x = gVP.cx + (x * (distance + townRadius));
human._y = gVP.cy + (y * (distance + townRadius));
human.time = 50;
human.xV = (-(x * distance)) / human.time;
human.yV = (-(y * distance)) / human.time;
human._rotation = ang;
}
function fnSpawner(spawner) {
if (spawner.teamInterval) {
if (0 < spawner.teams) {
if (0 >= (--spawner.timer)) {
spawner.teamInterval = false;
spawner.teams--;
spawner.timer = spawner.rate;
spawner.counter = spawner.count;
spawner.angle = Math.round(Math.random() * 360);
spawner.bonus = (++gBonus.next) % gBonus.max;
gBonus.tracker[spawner.bonus].points = (spawner.points * spawner.count) * gGame.bonusMulti;
gBonus.tracker[spawner.bonus].count = spawner.count;
}
}
} else if (0 >= (--spawner.timer)) {
spawner.timer = spawner.rate;
if ((--spawner.counter) >= 0) {
fnCreateBug(spawner);
} else {
spawner.teamInterval = true;
spawner.timer = spawner.intervalTime;
}
}
}
function fnActivateReticle() {
Mouse.hide();
zapper._visible = true;
attack = true;
}
function fnDeActivateReticle() {
Mouse.show();
zapper._visible = false;
attack = false;
}
function fnInitNewGame() {
with (gGame) {
round = 1;
location = 1;
bonusMulti = 1;
playerScore = 0;
bugs = 0;
tenants = 0;
var s = 110;
if (skill == "Hard") {
s = 100;
}
if (skill == "Easy") {
s = 130;
}
zapper._xscale = s;
zapper._yscale = s;
}
}
function fnCleanupRound() {
var i;
i = 0;
while (i < spawners.length) {
delete spawners[i];
i++;
}
delete spawners;
}
function fnInitRound() {
var i;
var round;
fnCleanUpRound();
spawners = new Array();
var r;
var r3;
var r6;
r = gGame.round;
rm6 = r % 6;
r3 = Math.floor(r / 3);
r6 = Math.floor(r / 6);
if (gGame.skill == "Hard") {
r3++;
r6++;
}
if (rm6 == 1) {
spawners.push(new C_Spawner(10, 3, 4 + r6, 5, 20, 10, 4, 0));
spawners.push(new C_Spawner(10, -3, 4 + r6, 5, 20, 10, 4, 40));
if ((7 < r) and (gGame.skill != "Easy")) {
spawners.push(new C_Spawner(360, 0, 2 + r6, 14, 20, 20, 1, 20));
}
}
if (rm6 == 2) {
spawners.push(new C_Spawner(0, 1 + r3, 3 + r6, 5, 20, 8, 5, 0));
spawners.push(new C_Spawner(0, 2 + r3, 4 + r6, 5, 20, 8, 5, 25));
if (gGame.skill != "Hard") {
spawners.push(new C_Spawner(0, 3 + r3, 5 + r6, 5, 20, 8, 4, 50));
} else {
spawners.push(new C_Spawner(0, -3 - r3, 5 + r6, 5, 20, 8, 4, 50));
}
}
if (rm6 == 3) {
spawners.push(new C_Spawner(30, 10, 4 + r6, 1, 20, 4, 20, 0));
spawners.push(new C_Spawner(30, -10, 3 + r6, 1, 20, 4, 20, 10));
if (14 < r) {
spawners.push(new C_Spawner(30, 0, 2 + r6, 1, 20, 4, 10, 240));
}
if (28 < r) {
spawners.push(new C_Spawner(30, 0, 5 + r6, 1, 20, 4, 5, 360));
}
}
if (rm6 == 4) {
spawners.push(new C_Spawner(10, 3, 4 + r6, 5, 20, 10, 4, 0));
spawners.push(new C_Spawner(10, -3, 4 + r6, 5, 20, 10, 4, 40));
spawners.push(new C_Spawner(5, 0, 7 + r6, 4, 80, 10, 2, 80));
}
if (rm6 == 5) {
spawners.push(new C_Spawner(30, 10, 4 + r6, 1, 20, 4, 30, 0));
spawners.push(new C_Spawner(30, 10, 3 + r6, 1, 20, 4, 30, 10));
if (14 < r) {
spawners.push(new C_Spawner(30, 0, 5 + r6, 1, 20, 4, 20, 240));
}
if (28 < r) {
spawners.push(new C_Spawner(30, 0, 6 + r6, 1, 20, 4, 15, 360));
}
}
if (rm6 == 0) {
if (gGame.skill != "Hard") {
spawners.push(new C_Spawner(360, 0, 2 + r6, 20, 20, 10, 2, 0));
spawners.push(new C_Spawner(20, 3, 5, 4, 50, 20, 4, 0));
spawners.push(new C_Spawner(20, -3, 4 + r6, 4, 20, 20, 4, 50));
} else {
spawners.push(new C_Spawner(360, 0, 2 + r6, 20, 20, 10, 4, 0));
spawners.push(new C_Spawner(20, 3, 5, 4, 50, 20, 8, 0));
spawners.push(new C_Spawner(20, -3, 4 + r6, 4, 20, 20, 8, 150));
}
}
gGame.bugs = 0;
i = 0;
while (i < spawners.length) {
gGame.bugs = gGame.bugs + (spawners[i].teams * spawners[i].count);
i++;
}
with (gBonus) {
i = 0;
while (i < max) {
tracker[i].count = 0;
tracker[i].points = 0;
i++;
}
next = 0;
}
}
function fnMain() {
var i;
i = 0;
while (i < spawners.length) {
fnSpawner(spawners[i]);
i++;
}
}
function fnCreateSplat(bug) {
var splat;
with (gSplat) {
next = (++next) % max;
_root.attachMovie("splat1", name + next, base + next);
splat = eval (name + next);
}
splat._x = bug._x;
splat._y = bug._y;
splat._rotation = Math.random() * 360;
zapper.gotoAndPlay(2);
dev2--;
}
function fnCreateAward(bug) {
var plume;
var points;
with (gAward) {
next = (++next) % max;
_root.attachMovie("award1", name + next, base + next);
plume = eval (name + next);
}
plume._x = bug._x;
plume._y = bug._y;
plume.award.pts = "$" + gBonus.tracker[bug.bonus].points;
with (gAR) {
if (plume._x < l) {
plume._x = l;
}
if (r < plume._x) {
plume._x = r;
}
if (plume._y < t) {
plume._y = t;
}
if (b < plume._y) {
plume._y = b;
}
}
}
function fnCreateLostTenant(bug) {
var human;
var src;
with (gTenant) {
next = (++next) % max;
src = "tenant" + Math.floor((Math.random() * 3) + 1);
_root.attachMovie(src, name + next, base + next);
human = eval (name + next);
}
human._x = gVP.cx;
human._y = gVP.cy;
var x;
var y;
var a;
human.time = 50;
a = bug._rotation % 360;
x = -Math.sin(a * gDtr);
y = Math.cos(a * gDtr);
human.xV = (-(x * 320)) / human.time;
human.yV = (-(y * 320)) / human.time;
human._rotation = a;
_root.sfxScream.nextFrame();
dev2--;
}
function fnBug(bug) {
if (_root.attack and (0 < _root.gGame.tenants)) {
if (zapper.colregion.hitTest(bug._x, bug._y, false)) {
fnCreateSplat(bug);
gGame.bugs--;
gGame.playerScore = gGame.playerScore + bug.spawner.points;
if ((--gBonus.tracker[bug.bonus].count) == 0) {
gGame.playerScore = gGame.playerScore + gBonus.tracker[bug.bonus].points;
fnCreateAward(bug);
}
removeMovieClip(bug);
return(undefined);
}
}
if ((--bug.time) < 0) {
gGame.bugs--;
if (0 < (--gGame.tenants)) {
fnCreateLostTenant(bug);
} else {
gGame.tenants = 0;
}
removeMovieClip(bug);
} else {
bug._x = bug._x + bug.xV;
bug._y = bug._y + bug.yV;
}
}
function fnEvacuate(hume) {
if ((--hume.time) < 0) {
removeMovieClip(hume);
} else {
hume._x = hume._x + hume.xV;
hume._y = hume._y + hume.yV;
}
}
Frame 31
duplicateMovieClip ("SRC_engine", "engine", 252);
SRC_engine._visible = false;
duplicateMovieClip ("SRC_stats", "stats", 251);
SRC_stats._visible = false;
duplicateMovieClip ("SRC_zapper", "zapper", 253);
SRC_zapper._visible = false;
zapper.colregion._visible = false;
zapper.startDrag(true);
fnDeActivateReticle();
duplicateMovieClip ("SRC_town", "town", 225);
SRC_town._visible = false;
town._visible = false;
townRadius = 40;
distance = 320 - townRadius;
Frame 44
timeWait = 150;
bug3.gotoAndPlay(20);
Frame 46
bug1._y = bug1._y + -0.3;
bug2._y = bug2._y + -1;
bug3._y = bug3._y + -1.8;
bug2._rotation = bug2._rotation - 0.1;
bug3._rotation = bug3._rotation + 0.1;
if (0 < (--timeWait)) {
_root.gotoAndPlay(_currentframe - 1);
}
Frame 49
buga.gotoAndPlay(15);
baseMsg = "Welcome to Bugville";
fnMenuMsg(baseMsg);
stop();
Frame 54
baseMsg = "Select your skill level";
fnMenuMsg(baseMsg);
Frame 59
baseMsg = "TIP: If the game runs slowly choose low quality";
fnMenuMsg(baseMsg);
Frame 64
baseMsg = "Instructions";
fnMenuMsg(baseMsg);
Frame 82
_quality = gGame.quality;
fnInit();
Frame 83
engine.gotoAndPlay("newGame");
Frame 91
stop();
Symbol 6 MovieClip [bug1] Frame 1
_root.fnBug(this);
Symbol 6 MovieClip [bug1] Frame 2
gotoAndPlay (1);
Symbol 8 MovieClip [splat1] Frame 30
removeMovieClip(this);
Symbol 13 MovieClip [award1] Frame 25
removeMovieClip(this);
Symbol 17 MovieClip [tenant3] Frame 1
_root.fnEvacuate(this);
Symbol 17 MovieClip [tenant3] Frame 2
gotoAndPlay (1);
Symbol 21 MovieClip [tenant2] Frame 1
_root.fnEvacuate(this);
Symbol 21 MovieClip [tenant2] Frame 2
gotoAndPlay (1);
Symbol 25 MovieClip [tenant1] Frame 1
_root.fnEvacuate(this);
Symbol 25 MovieClip [tenant1] Frame 2
gotoAndPlay (1);
Symbol 48 MovieClip Frame 1
stop();
Symbol 66 MovieClip Frame 1
stop();
Symbol 73 Button
on (press) {
gotoAndPlay (20);
}
Symbol 98 MovieClip Frame 1
Symbol 106 MovieClip Frame 1
stop();
Symbol 106 MovieClip Frame 4
_root.fnInitNewGame();
newTenants = 20;
Symbol 106 MovieClip Frame 12
_root.fnInitRound();
locationName.gotoAndStop(_root.gGame.location);
_root.town.gotoAndStop(_root.gGame.location);
_root.town._visible = true;
_root.gotoAndStop(91);
_root.town._xscale = 200;
_root.town._yscale = 200;
_root.stats._visible = false;
msg1 = _root.gGame.round;
msg2 = "X " + _root.gGame.bonusMulti;
msg3 = "$" + (10 * _root.gGame.bonusMulti);
Symbol 106 MovieClip Frame 13
stop();
Symbol 106 MovieClip Frame 20
_root.gotoAndStop(91 + _root.gGame.location);
_root.town._xscale = 100;
_root.town._yscale = 100;
_root.stats.gotoAndPlay(3);
Symbol 106 MovieClip Frame 21
if ((--newTenants) >= 0) {
_root.fnIntroNewTenant();
_root.gGame.tenants++;
}
Symbol 106 MovieClip Frame 23
if (0 < newTenants) {
gotoAndPlay(_currentframe - 2);
}
Symbol 106 MovieClip Frame 34
_root.fnActivateReticle();
if (_root.gGame.round == 1) {
theBigMessage = 1;
} else {
theBigMessage = 2;
if ((_root.gGame.round % 6) == 5) {
theBigMessage = 6;
}
}
timeBigMessage = 15;
returnFromBigMessage = _currentframe + 1;
gotoAndPlay (99);
Symbol 106 MovieClip Frame 43
if (!_root.gGame.music) {
gotoAndPlay (45);
}
Symbol 106 MovieClip Frame 45
_root.fnMain();
Symbol 106 MovieClip Frame 46
if ((0 < _root.gGame.bugs) and (0 < _root.gGame.tenants)) {
gotoAndPlay (45);
} else {
_root.fnDeActivateReticle();
if (0 >= _root.gGame.tenants) {
gotoAndPlay (138);
}
}
Symbol 106 MovieClip Frame 54
theBigMessage = 3;
timeBigMessage = 25;
returnFromBigMessage = _currentframe + 1;
gotoAndPlay (99);
Symbol 106 MovieClip Frame 55
Symbol 106 MovieClip Frame 60
if ((_root.gGame.round % 7) == 0) {
rent = 1000 * _root.gGame.bonusMulti;
tally = 0;
count = _root.gGame.tenants;
} else {
gotoAndPlay (91);
}
Symbol 106 MovieClip Frame 61
msgRent = "$" + rent;
if (0 < count) {
count--;
tally++;
_root.gGame.playerScore = _root.gGame.playerScore + rent;
}
Symbol 106 MovieClip Frame 62
if (0 < count) {
gotoAndPlay(_currentframe - 1);
}
Symbol 106 MovieClip Frame 84
theBigMessage = 7;
timeBigMessage = 15;
returnFromBigMessage = _currentframe + 1;
gotoAndPlay (99);
Symbol 106 MovieClip Frame 91
with (_root.gGame) {
round++;
if ((round % 7) == 1) {
location++;
bonusMulti++;
if (6 < bonusMulti) {
bonusMulti = 6;
}
}
newTenants = 3 * bonusMulti;
if (maxTenants < (tenants + newTenants)) {
newTenants = maxTenants - tenants;
}
}
if (_root.gGame.round == 9) {
_root.gGame.location = 4;
_root.gGame.bonusMulti = 4;
_root.gGame.round = 23;
with (_root.gGame) {
newTenants = 3 * bonusMulti;
if (maxTenants < (tenants + newTenants)) {
newTenants = maxTenants - tenants;
}
}
theDemoMessage = 1;
timeDemoMessage = 150;
returnFromDemoMessage = _currentframe + 1;
gotoAndPlay (121);
}
if (23 < _root.gGame.round) {
theDemoMessage = 2;
timeDemoMessage = 125;
returnFromDemoMessage = _currentframe + 1;
gotoAndPlay (121);
}
Symbol 106 MovieClip Frame 93
if (23 < _root.gGame.round) {
gotoAndPlay (138);
} else {
gotoAndPlay (12);
}
Symbol 106 MovieClip Frame 99
bigMsg.gotoAndStop(theBigMessage);
Symbol 106 MovieClip Frame 108
if (0 < (--timeBigMessage)) {
gotoAndPlay(_currentframe - 1);
}
Symbol 106 MovieClip Frame 117
gotoAndPlay(returnFromBigMessage);
Symbol 106 MovieClip Frame 121
demoMsg.gotoAndStop(theDemoMessage);
Symbol 106 MovieClip Frame 124
if (0 < (--timeDemoMessage)) {
gotoAndPlay(_currentframe - 1);
}
Symbol 106 MovieClip Frame 125
gotoAndPlay(returnFromDemoMessage);
Symbol 106 MovieClip Frame 139
theBigMessage = 4;
timeBigMessage = 50;
returnFromBigMessage = _currentframe + 1;
gotoAndPlay (99);
Symbol 106 MovieClip Frame 169
_quality = "HIGH";
_root.town._visible = false;
_root.stats.gotoAndStop(6);
_root.gotoAndStop("mMain");
Symbol 111 MovieClip Frame 3
stop();
Symbol 113 MovieClip Frame 1
stop();
Symbol 113 MovieClip Frame 2
_root.attack = false;
impact._rotation = Math.random() * 360;
impact.gotoAndPlay(1);
play();
Symbol 113 MovieClip Frame 5
_root.attack = true;
stop();
Symbol 121 MovieClip Frame 1
this._visible = false;
Symbol 121 MovieClip Frame 2
stop();
Symbol 121 MovieClip Frame 3
this._visible = true;
play();
Symbol 121 MovieClip Frame 4
msg1 = "$" + _root.gGame.playerScore;
msg2 = _root.gGame.tenants;
msg3 = _root.gGame.round;
Symbol 121 MovieClip Frame 5
gotoAndPlay (4);
Symbol 121 MovieClip Frame 6
msg1 = "$" + _root.gGame.playerScore;
Symbol 121 MovieClip Frame 7
gotoAndPlay (6);
Symbol 123 Button
on (release) {
gotoAndStop (49);
}
Symbol 135 Button
on (rollOver) {
fnMenuMsg("Start a new game");
}
on (rollOut) {
fnMenuMsg(baseMsg);
}
on (release) {
gotoAndStop (54);
}
Symbol 137 Button
on (rollOver) {
fnMenuMsg("Instructions and tips on play");
}
on (rollOut) {
fnMenuMsg(baseMsg);
}
on (release) {
gotoAndStop (64);
}
Symbol 139 Button
on (rollOver) {
fnMenuMsg(("Toggle music, and graphics quality (current setting: " + gGame.quality) + ")");
}
on (rollOut) {
fnMenuMsg(baseMsg);
}
on (release) {
gotoAndStop (59);
}
Symbol 144 Button
on (rollOver) {
fnMenuMsg("NOT AVAILABLE IN DEMO");
}
on (rollOut) {
fnMenuMsg(baseMsg);
}
Symbol 146 Button
on (rollOver) {
fnMenuMsg("Normal skill level");
}
on (rollOut) {
fnMenuMsg(baseMsg);
}
on (release) {
gGame.skill = "Normal";
gotoAndPlay (82);
}
Symbol 148 Button
on (rollOver) {
fnMenuMsg("NOT AVAILABLE IN DEMO");
}
on (rollOut) {
fnMenuMsg(baseMsg);
}
Symbol 155 Button
on (rollOver) {
fnMenuMsg("Only for fast PCs (600Mhz+)");
}
on (rollOut) {
fnMenuMsg(baseMsg);
}
on (release) {
gGame.quality = "HIGH";
gotoAndStop (49);
}
Symbol 157 Button
on (rollOver) {
fnMenuMsg("Suitable for mid-range PCs (400-600Mhz)");
}
on (rollOut) {
fnMenuMsg(baseMsg);
}
on (release) {
gGame.quality = "MEDIUM";
gotoAndStop (49);
}
Symbol 159 Button
on (rollOver) {
fnMenuMsg("Best setting for slower PCs (less than 400Mhz)");
}
on (rollOut) {
fnMenuMsg(baseMsg);
}
on (release) {
gGame.quality = "LOW";
gotoAndStop (49);
}
Symbol 161 Button
on (rollOver) {
if (gGame.music) {
fnMenuMsg("Turn game music OFF");
} else {
fnMenuMsg("Turn game music ON");
}
}
on (rollOut) {
fnMenuMsg(baseMsg);
}
on (release) {
if (gGame.music) {
gGame.music = false;
fnMenuMsg("MUSIC OFF");
} else {
gGame.music = true;
fnMenuMsg("MUSIC ON");
}
}
Symbol 164 Button
on (release) {
gotoAndStop (49);
}
Symbol 170 Button
on (release) {
nextFrame();
}
Symbol 177 Button
on (release) {
prevFrame();
}
Symbol 190 MovieClip Frame 1
stop();
Symbol 190 MovieClip Frame 10
gotoAndStop (2);