Frame 1
stop();
Instance of Symbol 8 MovieClip in Frame 1
onClipEvent (enterFrame) {
_root.percentage = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (_root.getBytesTotal() == _root.getBytesLoaded()) {
_root.gotoAndPlay(2);
}
}
Frame 2
_root.counter = 1;
_root.counter = 1;
_root.cash = 0;
_root.level = 2;
_root.damage = 10;
_root.bulletspeed = 10;
_root.explosion = 100;
_root.reload = 4;
_root.nextlevel = _root.level + 5;
_root.enemylist = new Array();
_root.kaboem1 = new Sound();
_root.kaboem1.attachSound("bang");
_root.kaboem2 = new Sound();
_root.kaboem2.attachSound("bang2");
stop();
Instance of Symbol 14 MovieClip "enemy" in Frame 2
onClipEvent (load) {
this.speed = (1 + Math.round(_root.level / 8)) + (Math.random() * 1);
this.health = 10 + (_root.level * 5);
this.bomb = 1;
}
onClipEvent (enterFrame) {
if (_root._currentFrame != 2) {
removeMovieClip(this);
}
this._x = this._x - this.speed;
if (this._x < 0) {
i = 0;
while (i < _root.enemylist.length) {
if (this._name == _root.enemylist[i]) {
_root.enemylist.splice(i, 1);
}
i++;
}
removeMovieClip(this);
}
}
Instance of Symbol 18 MovieClip in Frame 2
onClipEvent (enterFrame) {
if (_root._currentFrame != 2) {
removeMovieClip(this);
}
_root.wait--;
if (Math.random() < 0.01) {
duplicateMovieClip (_root.enemy, "enemy" + _root.counter, _root.counter);
_root.enemylist.push("enemy" + _root.counter);
eval ("_root.enemy" + _root.counter)._x = 660;
eval ("_root.enemy" + _root.counter)._y = 100 + (Math.random() * 50);
_root.counter++;
}
}
Instance of Symbol 20 MovieClip "bullet" in Frame 2
onClipEvent (enterFrame) {
if (_root._currentFrame != 2) {
removeMovieClip(this);
}
this._x = this._x + (Math.sin(_rotation * (Math.PI/180)) * _root.bulletspeed);
this._y = this._y + (Math.cos(_rotation * (Math.PI/180)) * (-_root.bulletspeed));
this.time = this.time - 10;
if ((0 >= this.time) and (this._name != "bullet")) {
_root.kaboem1.start();
duplicateMovieClip (_root.cloud, "cloud" + _root.counter, _root.counter);
eval ("_root.cloud" + _root.counter)._x = this._x;
eval ("_root.cloud" + _root.counter)._y = this._y;
eval ("_root.cloud" + _root.counter).t = this.t;
_root.counter++;
this.removeMovieClip();
}
}
Instance of Symbol 23 MovieClip "cloud" in Frame 2
onClipEvent (load) {
this._xscale = _root.explosion;
this._yscale = _root.explosion;
this._rotation = Math.round(Math.random() * 360);
i = 0;
while (i < _root.enemylist.length) {
if (this.hitTest("_root." + _root.enemylist[i])) {
eval ("_root." + _root.enemylist[i]).health = eval ("_root." + _root.enemylist[i]).health - _root.damage;
if (0 >= eval ("_root." + _root.enemylist[i]).health) {
_root.nextlevel--;
if (0 >= _root.nextlevel) {
_root.level++;
_root.wait = 200;
_root.nextlevel = _root.level + 5;
}
q = 0;
while (q < 3) {
duplicateMovieClip (_root.debris, "debris" + _root.counter, _root.counter);
eval ("_root.debris" + _root.counter)._x = eval ("_root." + _root.enemylist[i])._x;
eval ("_root.debris" + _root.counter)._y = eval ("_root." + _root.enemylist[i])._y;
_root.counter++;
q++;
}
_root.cash = _root.cash + Math.round(eval ("_root." + _root.enemylist[i])._x);
removeMovieClip("_root." + _root.enemylist[i]);
_root.enemylist.splice(i, 1);
}
}
i++;
}
this._alpha = 100;
}
onClipEvent (enterFrame) {
if (_root._currentFrame != 2) {
removeMovieClip(this);
}
if (this._name != "cloud") {
this._xscale++;
this._yscale++;
this._alpha = this._alpha - 2;
if (10 >= this._alpha) {
this.removeMovieClip();
}
}
}
Instance of Symbol 24 MovieClip "gunpowder" in Frame 2
onClipEvent (load) {
this._xscale = 50;
this._yscale = 50;
this._alpha = 100;
this._x = this._x + (Math.sin(_rotation * (Math.PI/180)) * 22);
this._y = this._y + (Math.cos(_rotation * (Math.PI/180)) * -22);
}
onClipEvent (enterFrame) {
if (_root._currentFrame != 2) {
removeMovieClip(this);
}
if (this._name != "gunpowder") {
this._xscale++;
this._yscale++;
this._alpha = this._alpha - 8;
if (10 >= this._alpha) {
this.removeMovieClip();
}
}
}
Instance of Symbol 26 MovieClip "debris" in Frame 2
onClipEvent (load) {
this._rotation = Math.round(Math.random() * 360);
this.x = (Math.random() - 0.5) * 4;
this.y = (Math.random() * 1) + 1;
this._alpha = 100;
}
onClipEvent (enterFrame) {
if (_root._currentFrame != 2) {
removeMovieClip(this);
}
this._x = this._x + this.x;
this._y = this._y + this.y;
this._alpha = this._alpha - 5;
if (20 >= this._alpha) {
removeMovieClip(this);
}
}
Frame 3
_root.counter = 1;
_root.cash = 0;
_root.level = 1;
_root.damage = 10;
_root.bulletspeed = 10;
_root.explosion = 100;
_root.reload = 20;
_root.nextlevel = _root.level + 5;
_root.enemylist = new Array();
_root.friendlylist = new Array();
_root.towerhealth = 100;
_root.kaboem1 = new Sound();
_root.kaboem1.attachSound("bang");
_root.kaboem2 = new Sound();
_root.kaboem2.attachSound("bang2");
i = 0;
while (i < 0) {
_root.friendlylist.push("friendly" + _root.counter);
duplicateMovieClip (_root.friendly, "friendly" + _root.counter, _root.counter);
eval ("_root.friendly" + _root.counter)._x = 100 + (_root.friendlylist.length * 100);
_root.counter++;
i++;
}
stop();
Instance of Symbol 44 MovieClip "bullet" in Frame 3
onClipEvent (enterFrame) {
this._x = this._x + (Math.sin(_rotation * (Math.PI/180)) * _root.bulletspeed);
this._y = this._y + (Math.cos(_rotation * (Math.PI/180)) * (-_root.bulletspeed));
this.time = this.time - ((10 * _root.bulletspeed) / 10);
if ((0 >= this.time) and (this._name != "bullet")) {
_root.kaboem1.start();
duplicateMovieClip (_root.cloud, "cloud" + _root.counter, _root.counter);
eval ("_root.cloud" + _root.counter)._x = this._x;
eval ("_root.cloud" + _root.counter)._y = this._y;
eval ("_root.cloud" + _root.counter).t = this.t;
_root.counter++;
this.removeMovieClip();
}
}
Instance of Symbol 45 MovieClip "enemy" in Frame 3
onClipEvent (load) {
this.speed = (2 + Math.round(_root.level / 10)) + (Math.random() * 1);
this.health = 10 + (_root.level * 5);
this.bomb = 1;
}
onClipEvent (enterFrame) {
this._x = this._x - this.speed;
if (this._x < 0) {
i = 0;
while (i < _root.enemylist.length) {
if (this._name == _root.enemylist[i]) {
_root.enemylist.splice(i, 1);
}
i++;
}
removeMovieClip(this);
}
if ((this._x < 50) and (this.bomb == 1)) {
this.bomb = 0;
duplicateMovieClip (_root.bomb, "bomb" + _root.counter, _root.counter);
eval ("_root.bomb" + _root.counter)._x = this._x;
eval ("_root.bomb" + _root.counter)._y = this._y;
_root.counter++;
}
}
Instance of Symbol 48 MovieClip "ship" in Frame 3
onClipEvent (enterFrame) {
_root.wait--;
if (((Math.random() < (0.01 + (_root.level / 800))) and (0 >= _root.wait)) and (_root.pause != 1)) {
duplicateMovieClip (_root.enemy, "enemy" + _root.counter, _root.counter);
_root.enemylist.push("enemy" + _root.counter);
eval ("_root.enemy" + _root.counter)._x = 660;
eval ("_root.enemy" + _root.counter)._y = 10 + (Math.random() * 200);
_root.counter++;
}
}
Instance of Symbol 49 MovieClip "cloud" in Frame 3
onClipEvent (load) {
this._xscale = _root.explosion;
this._yscale = _root.explosion;
this._rotation = Math.round(Math.random() * 360);
i = 0;
while (i < _root.enemylist.length) {
if (this.hitTest("_root." + _root.enemylist[i])) {
eval ("_root." + _root.enemylist[i]).health = eval ("_root." + _root.enemylist[i]).health - _root.damage;
if (0 >= eval ("_root." + _root.enemylist[i]).health) {
_root.nextlevel--;
if (0 >= _root.nextlevel) {
_root.level++;
_root.wait = 200;
_root.nextlevel = _root.level + 5;
}
q = 0;
while (q < 3) {
duplicateMovieClip (_root.debris, "debris" + _root.counter, _root.counter);
eval ("_root.debris" + _root.counter)._x = eval ("_root." + _root.enemylist[i])._x;
eval ("_root.debris" + _root.counter)._y = eval ("_root." + _root.enemylist[i])._y;
_root.counter++;
q++;
}
_root.cash = _root.cash + Math.round(eval ("_root." + _root.enemylist[i])._x * _root.gamelevel);
removeMovieClip("_root." + _root.enemylist[i]);
_root.enemylist.splice(i, 1);
}
}
i++;
}
this._alpha = 100;
}
onClipEvent (enterFrame) {
if (this._name != "cloud") {
this._xscale++;
this._yscale++;
this._alpha = this._alpha - 2;
if (10 >= this._alpha) {
this.removeMovieClip();
}
}
}
Instance of Symbol 51 MovieClip "debris" in Frame 3
onClipEvent (load) {
this._rotation = Math.round(Math.random() * 360);
this.x = (Math.random() - 0.5) * 4;
this.y = (Math.random() * 1) + 1;
this._alpha = 100;
}
onClipEvent (enterFrame) {
this._x = this._x + this.x;
this._y = this._y + this.y;
this._alpha = this._alpha - 5;
if (20 >= this._alpha) {
removeMovieClip(this);
}
}
Instance of Symbol 53 MovieClip "bomb" in Frame 3
onClipEvent (enterFrame) {
this._y = this._y + 8;
if (this.hitTest(_root.tower)) {
_root.towerhealth = _root.towerhealth - (10 + _root.level);
duplicateMovieClip (_root.cloud, "cloud" + _root.counter, _root.counter);
eval ("_root.cloud" + _root.counter)._x = this._x;
eval ("_root.cloud" + _root.counter)._y = this._y;
_root.counter++;
if (0 >= _root.towerhealth) {
_root.gotoAndStop(4);
}
removeMovieClip(this);
}
}
Instance of Symbol 57 MovieClip "gunpowder" in Frame 3
onClipEvent (load) {
this._xscale = 50;
this._yscale = 50;
this._alpha = 100;
this._x = this._x + (Math.sin(_rotation * (Math.PI/180)) * 22);
this._y = this._y + (Math.cos(_rotation * (Math.PI/180)) * -22);
}
onClipEvent (enterFrame) {
if (this._name != "gunpowder") {
this._xscale++;
this._yscale++;
this._alpha = this._alpha - 8;
if (10 >= this._alpha) {
this.removeMovieClip();
}
}
}
Frame 4
_root.time = 0;
_root.counter = 1;
_root.cash = 0;
_root.level = 1;
_root.damage = 10;
_root.bulletspeed = 10;
_root.explosion = 100;
_root.reload = 20;
_root.nextlevel = _root.level + 5;
_root.enemylist = new Array();
_root.friendlylist = new Array();
_root.towerhealth = 100;
stop();
Instance of Symbol 84 MovieClip in Frame 4
onClipEvent (enterFrame) {
_root.time++;
if (_root.time >= 200) {
_root.gotoAndStop(1);
}
}
Symbol 16 MovieClip Frame 1
stop();
Instance of Symbol 16 MovieClip "gun" in Symbol 18 MovieClip Frame 1
onClipEvent (load) {
this.bla = this._x;
}
onClipEvent (enterFrame) {
if ((0 < _root.enemylist.length) and (_parent._name != "friendly")) {
myRadians = Math.atan2((this.y - _parent._y) + this._y, (this.x - _parent._x) + this._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
this._rotation = myDegrees + 90;
this._x = this._x + (Math.sin(_rotation * (Math.PI/180)) * 0);
this._y = this._y + (Math.cos(_rotation * (Math.PI/180)) * 0);
this._x = this._x + ((this.bla - this._x) / 3);
this.reload--;
if (0 >= this.reload) {
this._x = this._x - (Math.sin(_rotation * (Math.PI/180)) * 5);
this.gotoAndPlay(2);
this.x = eval ("_root." + _root.enemylist[0])._x - (60 + (Math.random() * 90));
this.y = eval ("_root." + _root.enemylist[0])._y + ((Math.random() - 0.5) * 20);
duplicateMovieClip (_root.gunpowder, "gunpowder" + _root.counter, _root.counter);
eval ("_root.gunpowder" + _root.counter)._x = _parent._x + this._x;
eval ("_root.gunpowder" + _root.counter)._y = _parent._y + this._y;
eval ("_root.gunpowder" + _root.counter)._rotation = this._rotation;
_root.counter++;
_root.kaboem2.start();
duplicateMovieClip (_root.bullet, "bullet" + _root.counter, _root.counter);
eval ("_root.bullet" + _root.counter)._x = _parent._x + this._x;
eval ("_root.bullet" + _root.counter)._y = _parent._y + this._y;
eval ("_root.bullet" + _root.counter).t = this.t;
eval ("_root.bullet" + _root.counter).time = Math.abs(Math.sqrt((((this.y - _parent._y) + this._y) * ((this.y - _parent._y) + this._y)) + (((this.x - _parent._x) + this._x) * ((this.x - _parent._x) + this._x))));
eval ("_root.bullet" + _root.counter)._rotation = this._rotation;
_root.counter++;
this.reload = _root.reload + (Math.random() * 5);
}
}
}
Symbol 23 MovieClip Frame 1
stop();
Symbol 23 MovieClip Frame 2
stop();
Symbol 24 MovieClip Frame 1
stop();
Symbol 24 MovieClip Frame 2
stop();
Symbol 28 Button
on (release) {
if (_root.getBytesTotal() == _root.getBytesLoaded()) {
_root.gamelevel = 1.4;
nextFrame();
gotoAndStop;
}
}
Symbol 31 Button
on (release) {
if (_root.getBytesTotal() == _root.getBytesLoaded()) {
_root.gamelevel = 1.2;
nextFrame();
gotoAndStop;
}
}
Symbol 33 Button
on (release) {
if (_root.getBytesTotal() == _root.getBytesLoaded()) {
_root.gamelevel = 1;
nextFrame();
gotoAndStop;
}
}
Symbol 47 MovieClip Frame 1
stop();
Instance of Symbol 47 MovieClip "gun" in Symbol 48 MovieClip Frame 1
onClipEvent (load) {
this.bla = this._x;
}
onClipEvent (enterFrame) {
myRadians = Math.atan2((_root._ymouse - _parent._y) + this._y, (_root._xmouse - _parent._x) + this._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
this._rotation = myDegrees + 90;
this._x = this._x + (Math.sin(_rotation * (Math.PI/180)) * 0);
this._y = this._y + (Math.cos(_rotation * (Math.PI/180)) * 0);
this._x = this._x + ((this.bla - this._x) / 3);
this.reload--;
if (0 >= this.reload) {
if (Key.isDown(Key.SPACE)) {
this._x = this._x - (Math.sin(_rotation * (Math.PI/180)) * 5);
this.gotoAndPlay(2);
duplicateMovieClip (_root.gunpowder, "gunpowder" + _root.counter, _root.counter);
eval ("_root.gunpowder" + _root.counter)._x = _parent._x + this._x;
eval ("_root.gunpowder" + _root.counter)._y = _parent._y + this._y;
eval ("_root.gunpowder" + _root.counter)._rotation = this._rotation;
_root.counter++;
_root.kaboem2.start();
duplicateMovieClip (_root.bullet, "bullet" + _root.counter, _root.counter);
eval ("_root.bullet" + _root.counter)._x = _parent._x + this._x;
eval ("_root.bullet" + _root.counter)._y = _parent._y + this._y;
eval ("_root.bullet" + _root.counter).t = this.t;
eval ("_root.bullet" + _root.counter).time = Math.abs(Math.sqrt((((_root._ymouse - _parent._y) + this._y) * ((_root._ymouse - _parent._y) + this._y)) + (((_root._xmouse - _parent._x) + this._x) * ((_root._xmouse - _parent._x) + this._x))));
eval ("_root.bullet" + _root.counter)._rotation = this._rotation;
_root.counter++;
}
this.reload = _root.reload;
}
}
Symbol 49 MovieClip Frame 1
stop();
Symbol 49 MovieClip Frame 2
stop();
Instance of Symbol 16 MovieClip "gun" in Symbol 50 MovieClip Frame 1
onClipEvent (load) {
this.bla = this._x;
}
onClipEvent (enterFrame) {
if ((0 < _root.enemylist.length) and (_parent._name != "friendly")) {
myRadians = Math.atan2((this.y - _parent._y) + this._y, (this.x - _parent._x) + this._x);
myDegrees = Math.round((myRadians * 180) / Math.PI);
this._rotation = myDegrees + 90;
this._x = this._x + (Math.sin(_rotation * (Math.PI/180)) * 0);
this._y = this._y + (Math.cos(_rotation * (Math.PI/180)) * 0);
this._x = this._x + ((this.bla - this._x) / 3);
this.reload--;
if (0 >= this.reload) {
this._x = this._x - (Math.sin(_rotation * (Math.PI/180)) * 5);
this.gotoAndPlay(2);
this.x = eval ("_root." + _root.enemylist[0])._x - (60 + (Math.random() * 90));
this.y = eval ("_root." + _root.enemylist[0])._y + ((Math.random() - 0.5) * 20);
duplicateMovieClip (_root.gunpowder, "gunpowder" + _root.counter, _root.counter);
eval ("_root.gunpowder" + _root.counter)._x = _parent._x + this._x;
eval ("_root.gunpowder" + _root.counter)._y = _parent._y + this._y;
eval ("_root.gunpowder" + _root.counter)._rotation = this._rotation;
_root.counter++;
_root.kaboem2.start();
duplicateMovieClip (_root.bullet, "bullet" + _root.counter, _root.counter);
eval ("_root.bullet" + _root.counter)._x = _parent._x + this._x;
eval ("_root.bullet" + _root.counter)._y = _parent._y + this._y;
eval ("_root.bullet" + _root.counter).t = this.t;
eval ("_root.bullet" + _root.counter).time = Math.abs(Math.sqrt((((this.y - _parent._y) + this._y) * ((this.y - _parent._y) + this._y)) + (((this.x - _parent._x) + this._x) * ((this.x - _parent._x) + this._x))));
eval ("_root.bullet" + _root.counter)._rotation = this._rotation;
_root.counter++;
this.reload = _root.reload + (Math.random() * 5);
}
}
}
Symbol 55 MovieClip Frame 1
stop();
Instance of Symbol 55 MovieClip "gun" in Symbol 56 MovieClip Frame 1
onClipEvent (load) {
this.bla = this._x;
}
onClipEvent (enterFrame) {
this.myRadians = Math.atan2((_root._ymouse - _parent._y) + this._y, (_root._xmouse - _parent._x) + this._x);
this.myDegrees = Math.round((this.myRadians * 180) / Math.PI);
this._rotation = this.myDegrees + 90;
this._x = this._x + (Math.sin(_rotation * (Math.PI/180)) * 0);
this._y = this._y + (Math.cos(_rotation * (Math.PI/180)) * 0);
this._x = this._x + ((this.bla - this._x) / 3);
this.reload--;
if (0 >= this.reload) {
if (Key.isDown(Key.SPACE)) {
this._x = this._x - (Math.sin(_rotation * (Math.PI/180)) * 5);
this.gotoAndPlay(2);
_root.kaboem2.start();
duplicateMovieClip (_root.gunpowder, "gunpowder" + _root.counter, _root.counter);
eval ("_root.gunpowder" + _root.counter)._x = _parent._x + this._x;
eval ("_root.gunpowder" + _root.counter)._y = _parent._y + this._y;
eval ("_root.gunpowder" + _root.counter)._rotation = this._rotation;
_root.counter++;
duplicateMovieClip (_root.bullet, "bullet" + _root.counter, _root.counter);
eval ("_root.bullet" + _root.counter)._x = _parent._x + this._x;
eval ("_root.bullet" + _root.counter)._y = _parent._y + this._y;
eval ("_root.bullet" + _root.counter).t = this.t;
eval ("_root.bullet" + _root.counter).time = Math.abs(Math.sqrt((((_root._ymouse - _parent._y) + this._y) * ((_root._ymouse - _parent._y) + this._y)) + (((_root._xmouse - _parent._x) + this._x) * ((_root._xmouse - _parent._x) + this._x))));
eval ("_root.bullet" + _root.counter)._rotation = this._rotation;
_root.counter++;
}
this.reload = (_root.reload + 10) + (Math.random() * 4);
}
}
Symbol 57 MovieClip Frame 1
stop();
Symbol 57 MovieClip Frame 2
stop();
Symbol 61 Button
on (release) {
if (_root.cash >= 6000) {
_root.cash = _root.cash - 6000;
_root.friendlylist.push("friendly" + _root.counter);
duplicateMovieClip (_root.friendly, "friendly" + _root.counter, _root.counter);
eval ("_root.friendly" + _root.counter)._x = (150 + (_root.friendlylist.length * 50)) + Math.round(Math.random() * 20);
eval ("_root.friendly" + _root.counter)._y = eval ("_root.friendly" + _root.counter)._y + Math.round(Math.random() * 6);
_root.counter++;
}
}
Symbol 64 Button
on (release) {
if (_root.cash >= 4000) {
_root.cash = _root.cash - 4000;
_root.damage = Math.round(_root.damage * 1.1);
}
}
Symbol 67 Button
on (release) {
if (_root.cash >= 7000) {
_root.cash = _root.cash - 7000;
_root.reload = Math.round(_root.reload * 0.8);
}
}
Symbol 70 Button
on (release) {
if (_root.cash >= 8000) {
_root.cash = _root.cash - 8000;
_root.explosion = Math.round(_root.explosion * 1.1);
}
}
Symbol 73 Button
on (release) {
if (_root.cash >= 2000) {
_root.cash = _root.cash - 2000;
_root.towerhealth = _root.towerhealth + 10;
}
}
Symbol 76 Button
on (release) {
if (_root.cash >= 5000) {
_root.cash = _root.cash - 5000;
_root.bulletspeed = Math.round(_root.bulletspeed * 1.1);
}
}
Symbol 80 Button
on (release) {
if (_root.kaboem1.getVolume() == 100) {
_root.kaboem1.setVolume(0);
_root.kaboem2.setVolume(0);
} else {
_root.kaboem1.setVolume(100);
_root.kaboem2.setVolume(100);
}
}