Frame 1
Stage.showMenu = false;
stopAllSounds();
_root.xfile = "http://www.eviludy.net/server/highscores/scores.php";
_root.bytesLoaded = _root.getBytesLoaded();
_root.bytesTotal = _root.getBytesTotal();
_root.percentLoaded = Math.round(100 * (_root.bytesLoaded / _root.bytesTotal));
_root.percentLoadedText = _root.percentLoaded + "%";
_root.bar.gotoAndStop(percentLoaded);
Frame 2
if (_root.percentLoaded == 100) {
gotoAndStop (3);
} else {
gotoAndPlay (1);
}
Frame 3
stop();
Frame 4
_root.savegame = false;
mySharedObject = SharedObject.getLocal("Defend_Your_Something_Game_By_EviLudy_Entertainment_And_Armorgames");
_root.savegame = mySharedObject.data.savegame;
if (_root.savegame == true) {
_root.loadBut.enabled = true;
} else {
_root.loadBut.enabled = false;
}
stop();
Instance of Symbol 48 MovieClip in Frame 4
onClipEvent (enterFrame) {
_x = _root._xmouse;
this.swapDepths(15998);
}
Instance of Symbol 50 MovieClip in Frame 4
onClipEvent (enterFrame) {
_y = _root._ymouse;
this.swapDepths(15997);
}
Instance of Symbol 72 MovieClip "enemy0" in Frame 4
onClipEvent (load) {
death = false;
health = _root.arhealth;
damage = _root.ardamage;
sSpeed = _root.arspeed;
_xscale = 75;
_yscale = 75;
_root.enemies++;
}
onClipEvent (enterFrame) {
if ((_y < 244) && (death == false)) {
_y = (_y + 1);
}
if ((_x < -25) && (death == false)) {
if (_y < 350) {
_root.hp = _root.hp - damage;
_root.levelkills++;
}
death = true;
if (_root.level_enemies == _root.levelkills) {
_root.completescreen._visible = true;
}
this.removeMovieClip();
}
if (death == false) {
_x = (_x - sSpeed);
}
}
Instance of Symbol 130 MovieClip in Frame 4
onClipEvent (enterFrame) {
this.swapDepths(16000);
}
Frame 6
scoretable.filename = "scores/defend_your_random_gun_turret.sco";
scoretable.scoresize = 10;
scoretable.action = "INSERT";
scoretable.viewtype = "FLASH";
scoretable.winname = "none";
scoretable.winscore = 0;
System.security.allowDomain("eviludy.net");
scoretable.loadVariables(_root.xfile, "GET");
Frame 7
function duplicatePhantom() {
duplicateMovieClip (_root.enemy0, "enemy" + _root.enemies, 10 + _root.enemies);
_root["enemy" + _root.enemies]._x = 820;
_root["enemy" + _root.enemies]._y = (Math.random() * 150) + 130;
}
function duplicateTank() {
duplicateMovieClip (_root.tank0, "tank" + _root.enemies, 10 + _root.enemies);
_root["tank" + _root.enemies]._x = 950;
_root["tank" + _root.enemies]._y = (Math.random() * 150) + 90;
}
function saveFunction() {
mySharedObject = SharedObject.getLocal("Defend_Your_Something_Game_By_EviLudy_Entertainment_And_Armorgames");
mySharedObject.data.savegame = true;
mySharedObject.data.boughtstuff = _root.boughtstuff;
mySharedObject.data.enemiesspawned = _root.enemiesspawned;
mySharedObject.data.levelkills = _root.levelkills;
mySharedObject.data.level = _root.level;
mySharedObject.data.level_enemies = _root.level_enemies;
mySharedObject.data.level_dupliframes_a = _root.level_dupliframes_a;
mySharedObject.data.level_dupliframes_b = _root.level_dupliframes_b;
mySharedObject.data.score = _root.score;
mySharedObject.data.upgrade1 = _root.upgrade1;
mySharedObject.data.upgrade2 = _root.upgrade2;
mySharedObject.data.upgrade3 = _root.upgrade3;
mySharedObject.data.upgrade4 = _root.upgrade4;
mySharedObject.data.upgrade5 = _root.upgrade5;
mySharedObject.data.upgrade6 = _root.upgrade6;
mySharedObject.data.upgrades1 = _root.upgrades1;
mySharedObject.data.upgrades2 = _root.upgrades2;
mySharedObject.data.upgrades3 = _root.upgrades3;
mySharedObject.data.upgrades4 = _root.upgrades4;
mySharedObject.data.upgrades5 = _root.upgrades5;
mySharedObject.data.upgrades6 = _root.upgrades6;
mySharedObject.data.firerate = _root.firerate;
mySharedObject.data.arhealth = _root.arhealth;
mySharedObject.data.ardamage = _root.ardamage;
mySharedObject.data.arspeed = _root.arspeed;
mySharedObject.data.arhealth2 = _root.arhealth2;
mySharedObject.data.ardamage2 = _root.ardamage2;
mySharedObject.data.arspeed2 = _root.arspeed2;
mySharedObject.data.hp = _root.hp;
mySharedObject.data.maxhp = _root.maxhp;
mySharedObject.data.maxpower = _root.maxpower;
mySharedObject.data.power = _root.power;
mySharedObject.data.powerneed = _root.powerneed;
mySharedObject.data.statusset = _root.statusset;
mySharedObject.data.enemies = _root.enemies;
mySharedObject.data.gunpower = _root.gunpower;
mySharedObject.data.totalprints = _root.totalprints;
mySharedObject.data.axhem = _root.axhem;
mySharedObject.flush();
}
_root.mplay = true;
game = new Sound();
game.attachSound("game");
game.start(0, 60000);
Instance of Symbol 181 MovieClip "gun" in Frame 7
onClipEvent (enterFrame) {
if (_root.hp < 1) {
for (i in _root) {
if (_root[i] instanceof MovieClip) {
_root[i].removeMovieClip();
}
}
stopAllSounds();
_root.gotoAndStop(8);
}
}
Instance of Symbol 72 MovieClip "enemy0" in Frame 7
onClipEvent (load) {
death = false;
health = _root.arhealth;
damage = _root.ardamage;
sSpeed = _root.arspeed;
_xscale = 70;
_yscale = 70;
_root.enemies++;
}
onClipEvent (enterFrame) {
if ((_y < 244) && (death == false)) {
_y = (_y + 1);
}
if ((_x < -25) && (death == false)) {
if (_y < 350) {
_root.hp = _root.hp - damage;
_root.levelkills++;
}
death = true;
if (((_root.level_enemies + 1) == _root.levelkills) && (_root.level == 1)) {
_root.completescreen._visible = true;
}
if ((_root.level_enemies == _root.levelkills) && (_root.level > 1)) {
_root.completescreen._visible = true;
}
this.removeMovieClip();
}
if (death == false) {
_x = (_x - sSpeed);
}
}
Instance of Symbol 202 MovieClip "tank0" in Frame 7
onClipEvent (load) {
death = false;
health = _root.arhealth2;
damage = _root.ardamage2;
sSpeed = _root.arspeed2;
clipname = this._name;
if (clipname != "tank0") {
_root.enemies++;
}
}
onClipEvent (enterFrame) {
if (death == false) {
if (_y < 130) {
_y = (_y + 1);
}
if (_x < 0) {
this.gotoAndStop(4);
} else if (_x > 320) {
_x = (_x - sSpeed);
} else if ((_x <= 320) && (hurting == false)) {
this.gotoAndStop(2);
}
} else if (death == true) {
this.gotoAndStop(4);
}
}
Instance of Symbol 228 MovieClip "completescreen" in Frame 7
onClipEvent (load) {
if (_root.actionx == 1) {
_visible = false;
}
if (_root.actionx == 2) {
_visible = true;
_root.enemy0._visible = false;
_root.enemy0.death = true;
_root.enemy0._x = -500;
}
}
Instance of Symbol 240 MovieClip in Frame 7
onClipEvent (enterFrame) {
this.swapDepths(15999);
_root.xm = _root._xmouse;
_root.ym = _root._ymouse;
if (_root.power <= 0) {
_root.statusset = "WAIT";
}
if ((_root.statusset == "WAIT") && (_root.power == _root.maxpower)) {
_root.statusset = "READY";
}
if (_root.power < _root.maxpower) {
_root.power = _root.power + 1.75;
}
}
Instance of Symbol 242 MovieClip "cursor" in Frame 7
onClipEvent (load) {
counter = 0;
numi = Math.round(Math.random() + 1);
}
onClipEvent (enterFrame) {
_root.level_enemies = Math.floor((Math.pow(_root.level, 2) + 5) + (_root.level * 3));
_root.level_dupliframes_a = 110 - (_root.level * 10);
_root.level_dupliframes_b = 10 + (_root.level * 10);
if (_root.level_dupliframes_a < 25) {
_root.level_dupliframes_a = 25;
}
if (_root.level_dupliframes_b > 150) {
_root.level_dupliframes_b = 150;
}
Mouse.hide();
_x = _root._xmouse;
_y = _root._ymouse;
this.swapDepths(16001);
counter++;
if (numi == 1) {
bwuu = _root.level_dupliframes_a;
} else if (numi == 2) {
bwuu = _root.level_dupliframes_b;
}
if ((counter == bwuu) && (_root.level_enemies > _root.enemiesspawned)) {
_root.totalprints++;
if (_root.totalprints == _root.axhem) {
_root.duplicateTank();
_root.axhem = _root.axhem + 16;
} else {
_root.duplicatePhantom();
}
if (_root.totalprints > 1600) {
_root.totalprints = 0;
}
numi = Math.round(Math.random() + 1);
_root.enemiesspawned++;
counter = 0;
}
}
onClipEvent (mouseDown) {
if (((_root.power > 0) && (busy == false)) && (_root.statusset == "READY")) {
this.play();
_root.gun.play();
_root.power = _root.power - _root.powerneed;
}
}
Frame 8
Mouse.show();
scoretable.filename = "scores/defend_your_random_gun_turret.sco";
scoretable.scoresize = 10;
scoretable.action = "INSERT";
scoretable.viewtype = "FLASH";
scoretable.winname = "none";
scoretable.winscore = 0;
System.security.allowDomain("eviludy.net");
scoretable.loadVariables(_root.xfile, "GET");
_root.totalscore = _root.boughtstuff + _root.score;
_root.mplay = true;
menu = new Sound();
menu.attachSound("menu");
menu.start(0, 60000);
Instance of Symbol 72 MovieClip "enemy0" in Frame 8
onClipEvent (load) {
death = false;
health = _root.arhealth;
damage = _root.ardamage;
sSpeed = _root.arspeed;
_xscale = 75;
_yscale = 75;
_root.enemies++;
}
onClipEvent (enterFrame) {
if ((_y < 244) && (death == false)) {
_y = (_y + 1);
}
if ((_x < -25) && (death == false)) {
if (_y < 350) {
_root.hp = _root.hp - damage;
_root.levelkills++;
}
death = true;
if (_root.level_enemies == _root.levelkills) {
_root.completescreen._visible = true;
}
this.removeMovieClip();
}
if (death == false) {
_x = (_x - sSpeed);
}
}
Instance of Symbol 130 MovieClip in Frame 8
onClipEvent (enterFrame) {
this.swapDepths(16000);
}
Frame 9
scoretable.filename = "scores/defend_your_random_gun_turret.sco";
scoretable.scoresize = 10;
scoretable.action = "INSERT";
scoretable.viewtype = "FLASH";
scoretable.winname = _root.sumbitscore;
scoretable.winscore = _root.totalscore;
System.security.allowDomain("eviludy.net");
scoretable.loadVariables(_root.xfile, "GET");
Instance of Symbol 130 MovieClip in Frame 9
onClipEvent (enterFrame) {
this.swapDepths(16000);
}
Instance of Symbol 6 MovieClip in Symbol 13 MovieClip [explosion] Frame 1
onClipEvent (load) {
_visible = false;
}
onClipEvent (enterFrame) {
i = 0;
while (i < _root.enemies) {
if (this.hitTest(_root["enemy" + i]) && (_root["enemy" + i].death == false)) {
_root["enemy" + i].gotoAndStop(2);
}
if (this.hitTest(_root["tank" + i]) && (_root["tank" + i].death == false)) {
_root["tank" + i].gotoAndStop(3);
}
i++;
}
}
Symbol 13 MovieClip [explosion] Frame 8
stop();
this.removeMovieClip();
Symbol 31 Button
on (release) {
getURL ("http://www.armorgames.com", "blank");
}
Symbol 38 MovieClip Frame 105
_root.mplay = true;
menu = new Sound();
menu.attachSound("menu");
menu.start(0, 60000);
_root.nextFrame();
Symbol 70 MovieClip Frame 13
_parent.gotoAndStop(1);
Symbol 71 MovieClip Frame 40
if (((_root.level_enemies + 1) == _root.levelkills) && (_root.level == 1)) {
_root.completescreen._visible = true;
}
if ((_root.level_enemies == _root.levelkills) && (_root.level > 1)) {
_root.completescreen._visible = true;
}
Symbol 71 MovieClip Frame 41
stop();
_parent._visible = false;
_parent.removeMovieClip();
Symbol 72 MovieClip Frame 1
stop();
Symbol 72 MovieClip Frame 2
health = health - _root.gunpower;
if (health < 1) {
gotoAndStop (3);
}
Symbol 72 MovieClip Frame 3
death = true;
_root.score = _root.score + Math.round((Math.random() * 200) + 50);
_root.levelkills++;
Symbol 81 Button
on (release, keyPress "q") {
if (_quality == "LOW") {
_quality = "MEDIUM";
} else if (_quality == "MEDIUM") {
_quality = "HIGH";
} else if (_quality == "HIGH") {
_quality = "LOW";
}
}
Symbol 84 Button
on (release, keyPress "m") {
if (_root.mplay == true) {
_root.mplay = false;
stopAllSounds();
} else if (_root.mplay == false) {
_root.mplay = true;
menu = new Sound();
menu.attachSound("menu");
menu.start(0, 60000);
}
}
Symbol 99 Button
on (release) {
mySharedObject = SharedObject.getLocal("Defend_Your_Something_Game_By_EviLudy_Entertainment_And_Armorgames");
_root.boughtstuff = mySharedObject.data.boughtstuff;
_root.enemiesspawned = mySharedObject.data.enemiesspawned;
_root.levelkills = mySharedObject.data.levelkills;
_root.level = mySharedObject.data.level;
_root.level_enemies = mySharedObject.data.level_enemies;
_root.level_dupliframes_a = mySharedObject.data.level_dupliframes_a;
_root.level_dupliframes_b = mySharedObject.data.level_dupliframes_b;
_root.score = mySharedObject.data.score;
_root.upgrade1 = mySharedObject.data.upgrade1;
_root.upgrade2 = mySharedObject.data.upgrade2;
_root.upgrade3 = mySharedObject.data.upgrade3;
_root.upgrade4 = mySharedObject.data.upgrade4;
_root.upgrade5 = mySharedObject.data.upgrade5;
_root.upgrade6 = mySharedObject.data.upgrade6;
_root.upgrades1 = mySharedObject.data.upgrades1;
_root.upgrades2 = mySharedObject.data.upgrades2;
_root.upgrades3 = mySharedObject.data.upgrades3;
_root.upgrades4 = mySharedObject.data.upgrades4;
_root.upgrades5 = mySharedObject.data.upgrades5;
_root.arhealth = mySharedObject.data.arhealth;
_root.ardamage = mySharedObject.data.ardamage;
_root.arspeed = mySharedObject.data.arspeed;
_root.arhealth2 = mySharedObject.data.arhealth2;
_root.ardamage2 = mySharedObject.data.ardamage2;
_root.arspeed2 = mySharedObject.data.arspeed2;
_root.hp = mySharedObject.data.hp;
_root.maxhp = mySharedObject.data.maxhp;
_root.maxpower = mySharedObject.data.maxpower;
_root.power = mySharedObject.data.power;
_root.powerneed = mySharedObject.data.powerneed;
_root.statusset = mySharedObject.data.statusset;
_root.enemies = mySharedObject.data.enemies;
_root.gunpower = mySharedObject.data.gunpower;
_root.totalprints = mySharedObject.data.totalprints;
_root.axhem = mySharedObject.data.axhem;
_root.firerate = mySharedObject.data.firerate;
_root.actionx = 2;
stopAllSounds();
gotoAndStop (7);
}
Symbol 116 Button
on (release) {
_root.axhem = 16;
_root.totalprints = 0;
_root.maxhp = 200;
_root.boughtstuff = 0;
_root.score = 0;
_root.hp = 200;
_root.maxpower = 650;
_root.power = 650;
_root.powerneed = 50;
_root.statusset = "READY";
_root.enemies = 0;
_root.gunpower = 1;
_root.levelkills = 0;
_root.enemiesspawned = 0;
_root.level = 1;
_root.upgrade1 = 1000;
_root.upgrade2 = 1000;
_root.upgrade3 = 750;
_root.upgrade4 = 500;
_root.upgrade5 = 50;
_root.upgrade6 = 250;
_root.upgrades1 = 0;
_root.upgrades2 = 0;
_root.upgrades3 = 0;
_root.upgrades4 = 0;
_root.upgrades5 = 0;
_root.firerate = 0;
_root.arhealth = 2;
_root.ardamage = 15;
_root.arspeed = 2;
_root.arhealth2 = 6;
_root.ardamage2 = 10;
_root.arspeed2 = 1;
_root.actionx = 1;
stopAllSounds();
gotoAndStop (7);
}
Symbol 117 Button
on (release) {
gotoAndStop (5);
}
Symbol 118 Button
on (release) {
gotoAndStop (6);
}
Symbol 119 Button
on (release) {
getURL ("http://www.eviludy.net/", "_blank");
}
Symbol 120 Button
on (release) {
getURL ("http://www.armorgames.com/", "_blank");
}
Symbol 127 Button
on (release) {
getURL ("http://www.armorgames.com", "_blank");
}
Symbol 129 Button
on (release) {
getURL ("http://www.eviludy.net", "_blank");
}
Symbol 133 Button
on (release) {
gotoAndStop (4);
}
Symbol 181 MovieClip Frame 1
stop();
Symbol 181 MovieClip Frame 9
if ((_root.explo_y > 115) && (_root.explo_x > 240)) {
explosionsound = new Sound();
explosionsound.attachSound("explosionsound");
explosionsound.start();
_root.attachMovie("explosion", "explosion", 14000);
_root.explosion._x = _root.explo_x;
_root.explosion._y = _root.explo_y;
}
Symbol 181 MovieClip Frame 11
if (_root.firerate >= 5) {
gotoAndStop (1);
}
Symbol 181 MovieClip Frame 14
if (_root.firerate == 4) {
gotoAndStop (1);
}
Symbol 181 MovieClip Frame 17
if (_root.firerate == 3) {
gotoAndStop (1);
}
Symbol 181 MovieClip Frame 20
if (_root.firerate == 2) {
gotoAndStop (1);
}
Symbol 181 MovieClip Frame 25
if (_root.firerate == 1) {
gotoAndStop (1);
}
Symbol 199 MovieClip Frame 4
_root.hp = _root.hp - _parent.damage;
Symbol 200 MovieClip Frame 13
_parent.gotoAndStop(1);
Symbol 201 MovieClip Frame 51
stop();
if (((_root.level_enemies + 1) == _root.levelkills) && (_root.level == 1)) {
_root.completescreen._visible = true;
}
if ((_root.level_enemies == _root.levelkills) && (_root.level > 1)) {
_root.completescreen._visible = true;
}
_parent.removeMovieClip();
Symbol 201 MovieClip Frame 52
prevFrame();
Symbol 202 MovieClip Frame 1
stop();
hurting = false;
Symbol 202 MovieClip Frame 2
hurting = false;
Symbol 202 MovieClip Frame 3
health = health - _root.gunpower;
if (health < 1) {
gotoAndStop (4);
}
hurting = true;
Symbol 202 MovieClip Frame 4
death = true;
hurting = false;
if (clipname != "tank0") {
_root.levelkills++;
_root.score = _root.score + Math.round((Math.random() * 1000) + 350);
}
Symbol 203 Button
on (release, keyPress "m") {
if (_root.mplay == true) {
_root.mplay = false;
stopAllSounds();
} else if (_root.mplay == false) {
_root.mplay = true;
game = new Sound();
game.attachSound("game");
game.start(0, 60000);
}
}
Symbol 215 Button
on (release) {
_root.enemiesspawned = 0;
_root.levelkills = 0;
_root.level++;
_root.level_enemies = Math.floor((Math.pow(_root.level, 2) + 5) + (_root.level * 3));
_root.level_dupliframes_a = 110 - (_root.level * 10);
_root.level_dupliframes_b = 10 + (_root.level * 10);
_root.completescreen._visible = false;
_root.cursor.counter = 0;
if (_root.level == 2) {
_root.ardamage++;
}
if (_root.level == 3) {
_root.arhealth++;
}
if (_root.level == 4) {
_root.ardamage++;
_root.arspeed++;
}
if (_root.level == 5) {
_root.arhealth++;
}
if (_root.level == 6) {
_root.ardamage++;
}
if (_root.level == 8) {
_root.ardamage++;
_root.arhealth++;
_root.arspeed++;
}
if (_root.level == 9) {
_root.ardamage++;
}
if (_root.level == 10) {
_root.ardamage++;
_root.arhealth++;
_root.arspeed++;
}
}
Symbol 222 Button
on (release) {
if ((_root.score > _root.upgrade1) && (_root.upgrades1 < 6)) {
_root.maxhp = _root.maxhp + 50;
_root.boughtstuff = _root.boughtstuff + _root.upgrade1;
_root.score = _root.score - _root.upgrade1;
_root.upgrade1 = _root.upgrade1 * 5;
_root.upgrades1++;
}
}
Symbol 223 Button
on (release) {
if ((_root.score > _root.upgrade2) && (_root.upgrades2 < 6)) {
_root.maxpower = _root.maxpower + 250;
_root.boughtstuff = _root.boughtstuff + _root.upgrade2;
_root.score = _root.score - _root.upgrade2;
_root.upgrade2 = _root.upgrade2 * 5;
_root.upgrades2++;
}
}
Symbol 224 Button
on (release) {
if ((_root.score > _root.upgrade3) && (_root.upgrades3 < 6)) {
_root.gunpower++;
_root.powerneed = _root.powerneed + 5;
_root.boughtstuff = _root.boughtstuff + _root.upgrade3;
_root.score = _root.score - _root.upgrade3;
_root.upgrade3 = _root.upgrade3 * 5;
_root.upgrades3++;
}
}
Symbol 225 Button
on (release) {
if (_root.score > _root.upgrade4) {
_root.hp = _root.maxhp;
_root.boughtstuff = _root.boughtstuff + _root.upgrade4;
_root.score = _root.score - _root.upgrade4;
_root.upgrade4 = _root.upgrade4 + 50;
}
}
Symbol 226 Button
on (release) {
if (_root.score > _root.upgrade5) {
_root.boughtstuff = _root.boughtstuff + _root.upgrade5;
_root.score = _root.score - _root.upgrade5;
_root.upgrade5 = _root.upgrade5 + 50;
_root.saveFunction();
}
}
Symbol 227 Button
on (release) {
if (_root.score > _root.upgrade6) {
_root.firerate++;
_root.powerneed = _root.powerneed + 5;
_root.boughtstuff = _root.boughtstuff + _root.upgrade6;
_root.score = _root.score - _root.upgrade6;
_root.upgrade6 = _root.upgrade6 * 5;
}
}
Instance of Symbol 236 MovieClip in Symbol 240 MovieClip Frame 1
onClipEvent (enterFrame) {
_width = ((_root.hp / _root.maxhp) * 185);
if (_root.hp > _root.maxhp) {
_root.hp = _root.maxhp;
}
_root.hp = Math.round(_root.hp);
}
Instance of Symbol 238 MovieClip in Symbol 240 MovieClip Frame 1
onClipEvent (enterFrame) {
_width = ((_root.power / _root.maxpower) * 185);
if (_root.power > _root.maxpower) {
_root.power = _root.maxpower;
}
_root.power = Math.round(_root.power);
}
Symbol 242 MovieClip Frame 1
stop();
busy = false;
Symbol 242 MovieClip Frame 2
_root.explo_x = _root.cursor._x;
_root.explo_y = _root.cursor._y;
busy = true;
Symbol 242 MovieClip Frame 11
if (_root.firerate >= 5) {
gotoAndStop (1);
}
Symbol 242 MovieClip Frame 14
if (_root.firerate == 4) {
gotoAndStop (1);
}
Symbol 242 MovieClip Frame 17
if (_root.firerate == 3) {
gotoAndStop (1);
}
Symbol 242 MovieClip Frame 20
if (_root.firerate == 2) {
gotoAndStop (1);
}
Symbol 242 MovieClip Frame 25
if (_root.firerate == 1) {
gotoAndStop (1);
}
Symbol 252 Button
on (release) {
gotoAndStop (9);
}