Frame 1
Frame 24
_global.highscore = 0;
gotoAndPlay (26);
Frame 26
this.background.gotoAndStop(random(5) + 1);
music = 1;
soundtrack = new Sound();
soundtrack.attachSound("bummblebee");
stopAllSounds();
if (music == 1) {
soundtrack.start(0, 50);
}
level = 1;
score = 0;
killed = 0;
plants = 4;
Instance of Symbol 27 MovieClip in Frame 46
onClipEvent (load) {
dirx = 0;
this.gotoAndPlay(random(6));
}
onClipEvent (enterFrame) {
if (dirx == 0) {
bugspeed = random(30) + 30;
x = this._x;
y = this._y;
tx = random(550);
ty = random(400);
if (tx < x) {
dirx = 1;
xdis = x - tx;
} else {
dirx = 2;
xdis = tx - x;
}
if (ty < y) {
diry = 1;
ydis = y - ty;
} else {
diry = 2;
ydis = ty - y;
}
xstep = xdis / bugspeed;
ystep = math.abs(ydis / bugspeed);
xx = x - tx;
yy = (y - ty) * -1;
angle = Math.atan(yy / xx) / (Math.PI/180);
if (xx < 0) {
angle = angle + 180;
}
if ((xx >= 0) && (yy < 0)) {
angle = angle + 360;
}
angle = math.floor(angle * -1);
this._rotation = angle;
}
x = this._x;
y = this._y;
trace(x);
if (dirx == 1) {
this._x = this._x - xstep;
}
if (dirx == 2) {
this._x = this._x + xstep;
}
if (diry == 1) {
this._y = this._y - ystep;
}
if (diry == 2) {
this._y = this._y + ystep;
}
if ((dirx == 1) && (tx > x)) {
dirx = 0;
}
if ((dirx == 2) && (tx < x)) {
dirx = 0;
}
}
Instance of Symbol 27 MovieClip in Frame 46
onClipEvent (load) {
dirx = 0;
this.gotoAndPlay(random(6));
}
onClipEvent (enterFrame) {
if (dirx == 0) {
bugspeed = random(30) + 30;
x = this._x;
y = this._y;
tx = random(550);
ty = random(400);
if (tx < x) {
dirx = 1;
xdis = x - tx;
} else {
dirx = 2;
xdis = tx - x;
}
if (ty < y) {
diry = 1;
ydis = y - ty;
} else {
diry = 2;
ydis = ty - y;
}
xstep = xdis / bugspeed;
ystep = math.abs(ydis / bugspeed);
xx = x - tx;
yy = (y - ty) * -1;
angle = Math.atan(yy / xx) / (Math.PI/180);
if (xx < 0) {
angle = angle + 180;
}
if ((xx >= 0) && (yy < 0)) {
angle = angle + 360;
}
angle = math.floor(angle * -1);
this._rotation = angle;
}
x = this._x;
y = this._y;
if (dirx == 1) {
this._x = this._x - xstep;
}
if (dirx == 2) {
this._x = this._x + xstep;
}
if (diry == 1) {
this._y = this._y - ystep;
}
if (diry == 2) {
this._y = this._y + ystep;
}
if ((dirx == 1) && (tx > x)) {
dirx = 0;
}
if ((dirx == 2) && (tx < x)) {
dirx = 0;
}
}
Instance of Symbol 27 MovieClip in Frame 46
onClipEvent (load) {
dirx = 0;
this.gotoAndPlay(random(6));
}
onClipEvent (enterFrame) {
if (dirx == 0) {
bugspeed = random(30) + 30;
x = this._x;
y = this._y;
tx = random(550);
ty = random(400);
if (tx < x) {
dirx = 1;
xdis = x - tx;
} else {
dirx = 2;
xdis = tx - x;
}
if (ty < y) {
diry = 1;
ydis = y - ty;
} else {
diry = 2;
ydis = ty - y;
}
xstep = xdis / bugspeed;
ystep = math.abs(ydis / bugspeed);
xx = x - tx;
yy = (y - ty) * -1;
angle = Math.atan(yy / xx) / (Math.PI/180);
if (xx < 0) {
angle = angle + 180;
}
if ((xx >= 0) && (yy < 0)) {
angle = angle + 360;
}
angle = math.floor(angle * -1);
this._rotation = angle;
}
x = this._x;
y = this._y;
if (dirx == 1) {
this._x = this._x - xstep;
}
if (dirx == 2) {
this._x = this._x + xstep;
}
if (diry == 1) {
this._y = this._y - ystep;
}
if (diry == 2) {
this._y = this._y + ystep;
}
if ((dirx == 1) && (tx > x)) {
dirx = 0;
}
if ((dirx == 2) && (tx < x)) {
dirx = 0;
}
}
Instance of Symbol 27 MovieClip in Frame 46
onClipEvent (load) {
dirx = 0;
this.gotoAndPlay(random(6));
}
onClipEvent (enterFrame) {
if (dirx == 0) {
bugspeed = random(30) + 30;
x = this._x;
y = this._y;
tx = random(550);
ty = random(400);
if (tx < x) {
dirx = 1;
xdis = x - tx;
} else {
dirx = 2;
xdis = tx - x;
}
if (ty < y) {
diry = 1;
ydis = y - ty;
} else {
diry = 2;
ydis = ty - y;
}
xstep = xdis / bugspeed;
ystep = math.abs(ydis / bugspeed);
xx = x - tx;
yy = (y - ty) * -1;
angle = Math.atan(yy / xx) / (Math.PI/180);
if (xx < 0) {
angle = angle + 180;
}
if ((xx >= 0) && (yy < 0)) {
angle = angle + 360;
}
angle = math.floor(angle * -1);
this._rotation = angle;
}
x = this._x;
y = this._y;
if (dirx == 1) {
this._x = this._x - xstep;
}
if (dirx == 2) {
this._x = this._x + xstep;
}
if (diry == 1) {
this._y = this._y - ystep;
}
if (diry == 2) {
this._y = this._y + ystep;
}
if ((dirx == 1) && (tx > x)) {
dirx = 0;
}
if ((dirx == 2) && (tx < x)) {
dirx = 0;
}
}
Frame 63
stop();
Frame 64
function fire() {
if ((ammo > 0) && (activemissles < maxmissles)) {
ttx = _xmouse;
tty = _ymouse;
xdis = ttx - 278;
ydis = tty - 327;
xxx = xdis / ammospeed;
yyy = ydis / ammospeed;
ammo--;
activemissles++;
xx = 278 - ttx;
yy = (327 - tty) * -1;
angle = Math.atan(yy / xx) / (Math.PI/180);
if (xx < 0) {
angle = angle + 180;
}
if ((xx >= 0) && (yy < 0)) {
angle = angle + 360;
}
angle = math.floor(angle * -1);
firesound.start();
attachMovie("fire", "fire" + ammo, 500 + ammo);
with (eval ("fire" + ammo)) {
_x = 278;
_y = 327;
fireb.xstep = xxx;
fireb.ystep = yyy;
fireb.targetx = ttx;
fireb._rotation = angle;
}
}
}
function generatespray(x, y) {
activemissles--;
explode++;
attachMovie("sprayshell", "spray" + enum, 400 + enum);
with (eval ("spray" + enum)) {
_x = x;
_y = y;
}
enum++;
if (enum > 10) {
enum = 1;
}
}
firesound = new Sound();
firesound.attachSound("ploop");
eat = new Sound();
eat.attachSound("flowereat");
aliendie = new Sound();
aliendie.attachSound("die");
getufo = new Sound();
getufo.attachSound("ufosound");
totalenemies = 15 + (level * 5);
enemies = 0;
maxenemies = 6;
speed = 180;
totalammo = 20;
ammo = totalammo;
ammospeed = 35;
activemissles = 0;
explode = 0;
enum = 1;
maxmissles = 4;
bugskilledthislevel = 0;
specials = 0;
specc = random(50) + 50;
speca = 0;
Mouse.hide();
attachMovie("sights", "sights", 600);
attachMovie("nozzlecap", "nozzlecap", 599);
attachMovie("nozzle", "nozzle", 598);
nozzlecap._x = 277;
nozzlecap._y = 333;
nozzle._x = 278;
nozzle._y = 340;
Instance of Symbol 91 MovieClip "shield1" in Frame 64
onClipEvent (load) {
state = 3;
}
Instance of Symbol 91 MovieClip "shield2" in Frame 64
onClipEvent (load) {
state = 3;
}
Instance of Symbol 91 MovieClip "shield3" in Frame 64
onClipEvent (load) {
state = 3;
}
Instance of Symbol 91 MovieClip "shield4" in Frame 64
onClipEvent (load) {
state = 3;
}
Frame 65
i = 0;
v = nozzle._x;
w = nozzle._y;
Frame 66
speca++;
if ((speca == specc) && (level > 1)) {
attachMovie("UFO", "UFO", 99);
UFO._x = -10;
UFO._y = random(50) + 100;
}
x = _xmouse;
y = _ymouse;
if (y > 280) {
y = 280;
}
xx = v - x;
yy = (w - y) * -1;
sights._x = x;
sights._y = y;
angle = Math.atan(yy / xx) / (Math.PI/180);
if (xx < 0) {
angle = angle + 180;
}
if ((xx >= 0) && (yy < 0)) {
angle = angle + 360;
}
angle = math.floor(angle * -1);
if (angle < -353) {
angle = -353;
} else if (angle > -188) {
angle = -188;
}
nozzle._rotation = angle;
if (enemies < maxenemies) {
if (totalenemies > 0) {
name = "bug" + totalenemies;
attachMovie("bug", name, 100 + totalenemies);
with (name) {
_y = 0;
}
enemies++;
totalenemies--;
}
}
if (plants == 0) {
gotoAndPlay ("gameover");
}
if ((enemies == 0) && (plants > 0)) {
gotoAndPlay ("change level");
}
Frame 67
gotoAndPlay (66);
Frame 68
Frame 69
Mouse.show();
removeMovieClip("sights");
Frame 81
bonusf = 25 * plants;
bonuss = 50 * specials;
bt = bonuss + bonusf;
score = score + (bonusf + bonuss);
stop();
Frame 82
Mouse.show();
removeMovieClip("sights");
removeMovieClip("nozzlecap");
removeMovieClip("nozzle");
trace(score);
if (score > highscore) {
highscore = score;
}
Frame 110
stop();
Symbol 5 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop ("loaded");
}
Symbol 5 MovieClip Frame 2
gotoAndPlay (1);
Symbol 5 MovieClip Frame 3
setProperty(bar, _xscale , 100);
_root.play();
Symbol 27 MovieClip Frame 1
stop();
Symbol 28 MovieClip [bug] Frame 1
aa = random(4) + 1;
ty = 320;
Symbol 28 MovieClip [bug] Frame 2
if (aa == 1) {
if (_root.shield1.state <= 0) {
gotoAndPlay (1);
}
} else if (aa == 2) {
if (_root.shield2.state <= 0) {
gotoAndPlay (1);
}
} else if (aa == 3) {
if (_root.shield3.state <= 0) {
gotoAndPlay (1);
}
} else if (aa == 4) {
if (_root.shield4.state <= 0) {
gotoAndPlay (1);
}
}
Symbol 28 MovieClip [bug] Frame 3
if (aa == 1) {
tx = 68;
} else if (aa == 2) {
tx = 173;
} else if (aa == 3) {
tx = 384;
} else if (aa == 4) {
tx = 489;
}
choice = aa;
bugspeed = _root.speed + random(100);
bugg.gotoAndStop(random(6));
x = random(550);
this._x = x;
y = this._y;
xdis = tx - x;
ydis = y - ty;
xstep = xdis / bugspeed;
ystep = math.abs(ydis / bugspeed);
xx = x - tx;
yy = (y - ty) * -1;
angle = Math.atan(yy / xx) / (Math.PI/180);
if (xx < 0) {
angle = angle + 180;
}
if ((xx >= 0) && (yy < 0)) {
angle = angle + 360;
}
angle = math.floor(angle * -1);
bugg._rotation = angle;
Instance of Symbol 27 MovieClip "bugg" in Symbol 28 MovieClip [bug] Frame 3
/* no clip actions */
Symbol 28 MovieClip [bug] Frame 4
if (_root.explode > 0) {
i = 1;
while (i < 11) {
if (this.hittest(eval ("_root.spray" + i))) {
gotoAndPlay (6);
}
i++;
}
}
bugg._x = bugg._x + xstep;
bugg._y = bugg._y + ystep;
if (bugg._y > 320) {
_root.eat.start();
if (choice == 1) {
_root.shield1.state = _root.shield1.state - 1;
_root.shield1._alpha = _root.shield1._alpha - 30;
if (_root.shield1.state == 0) {
_root.flower1.gotoAndPlay(2);
}
} else if (choice == 2) {
_root.shield2.state = _root.shield2.state - 1;
_root.shield2._alpha = _root.shield2._alpha - 30;
if (_root.shield2.state == 0) {
_root.flower2.gotoAndPlay(2);
}
} else if (choice == 3) {
_root.shield3.state = _root.shield3.state - 1;
_root.shield3._alpha = _root.shield3._alpha - 30;
if (_root.shield3.state == 0) {
_root.flower3.gotoAndPlay(2);
}
} else if (choice == 4) {
_root.shield4.state = _root.shield4.state - 1;
_root.shield4._alpha = _root.shield4._alpha - 30;
if (_root.shield4.state == 0) {
_root.flower4.gotoAndPlay(2);
}
}
removeMovieClip(this);
enemies--;
}
Symbol 28 MovieClip [bug] Frame 5
gotoAndPlay (4);
Symbol 28 MovieClip [bug] Frame 6
_root.aliendie.start();
size = 100;
Symbol 28 MovieClip [bug] Frame 7
bugg._alpha = size;
bugg._alpha = size;
size = size - 10;
Symbol 28 MovieClip [bug] Frame 8
if (size > 10) {
gotoAndPlay (7);
}
Symbol 28 MovieClip [bug] Frame 9
_root.enemies--;
_root.killed++;
_root.score = _root.score + 10;
_root.bugskilledthislevel++;
removeMovieClip(this);
Symbol 32 MovieClip [fire] Frame 1
if (end == 1) {
gotoAndPlay (3);
}
Instance of Symbol 31 MovieClip "fireb" in Symbol 32 MovieClip [fire] Frame 1
onClipEvent (enterFrame) {
x = _parent._x;
if (((xstep < 0) && (x >= (targetx - xstep))) || ((xstep > 0) && (x <= (targetx - xstep)))) {
_parent._x = _parent._x + xstep;
_parent._y = _parent._y + ystep;
} else {
_parent.end = 1;
}
}
Symbol 32 MovieClip [fire] Frame 2
gotoAndPlay (1);
Symbol 32 MovieClip [fire] Frame 3
x = this._x;
y = this._y;
_root.generatespray(x, y);
Symbol 32 MovieClip [fire] Frame 4
removeMovieClip(this);
Symbol 38 MovieClip Frame 1
stop();
Instance of Symbol 38 MovieClip in Symbol 39 MovieClip [sights] Frame 1
onClipEvent (mouseDown) {
_root.fire();
}
Symbol 47 MovieClip [sprayshell] Frame 12
_root.explode--;
removeMovieClip(this);
Symbol 49 MovieClip Frame 1
stop();
Instance of Symbol 55 MovieClip in Symbol 56 MovieClip [UFO] Frame 1
onClipEvent (enterFrame) {
if (_root.explode > 0) {
i = 1;
while (i < 11) {
if (this.hittest(eval ("_root.spray" + i))) {
_root.getufo.start();
removeMovieClip(_parent);
specials++;
_root.ammo = _root.ammo + 5;
}
i++;
}
}
this._x = this._x + 2;
if (this._x > 555) {
removeMovieClip(_parent);
_root.specc = random(50) + 50;
_root.speca = 0;
}
}
Symbol 57 MovieClip Frame 1
stop();
Symbol 58 MovieClip Frame 1
stop();
Symbol 66 Button
on (press) {
getURL ("mailto:terrypaton1@bigpond.com?subject=Bug Patrol");
}
Symbol 74 Button
on (release) {
gotoAndPlay (64);
}
Symbol 79 Button
on (release) {
if (music == 1) {
music = 2;
stopAllSounds();
onoff.gotoAndStop(2);
} else if (music == 2) {
music = 1;
soundtrack.start(0, 50);
onoff.gotoAndStop(1);
}
}
Symbol 82 MovieClip Frame 1
stop();
Symbol 87 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 1
stop();
Instance of Symbol 87 MovieClip in Symbol 88 MovieClip Frame 1
onClipEvent (load) {
this.gotoAndStop(random(5));
}
Symbol 88 MovieClip Frame 31
_root.plants = _root.plants - 1;
stop();
Symbol 106 Button
on (release) {
level++;
gotoAndPlay (64);
}
Symbol 133 Button
on (release) {
level = 1;
score = 0;
killed = 0;
plants = 4;
gotoAndPlay (64);
}
Symbol 139 Button
on (release) {
gotoAndPlay (26);
}