Frame 1
stop();
stop();
stop();
stop();
stop();
stop();
Frame 2
var my_sound = new Sound();
my_sound.attachSound("intro");
var ingame = new Sound();
ingame.attachSound("gamesound");
my_sound.start();
Frame 222
my_sound.stop();
stop();
stop();
visit.onPress = function () {
getURL ("http://geheee.freespaces.com/", "_blank");
};
howto.onPress = function () {
gotoAndPlay (223);
};
play.onPress = function () {
gotoAndPlay (225);
ingame.start();
};
Frame 223
stop();
cont.onPress = function () {
gotoAndStop (224);
};
Frame 224
back.onPress = function () {
gotoAndStop (222);
};
Frame 225
attachMovie("map", "map", this.getNextHighestDepth(), {_x:0, _y:0});
attachMovie("towerstatus", "towerstatus", 8000000, {_x:50, _y:475});
badguys = 0;
newlevel = 1;
level = 1;
escaped = 0;
actualkilled = 0;
killed = 0;
escaped = 0;
var m = 1;
while (m <= 35) {
Set("towertimer" + m, 0);
m++;
}
timer = 0;
gold = 100;
towerselect = 0;
range0 = 0;
towerspeed0 = 0;
damage0 = 0;
towertype0 = 0;
normaltowerattackspeed1 = 30;
normaltowerrange1 = 50;
normaltowerdamage1 = 100;
normaltowercost1 = -10;
normaltowerrefund1 = 7;
normaltowerattackspeed2 = 0;
normaltowerrange2 = 10;
normaltowerdamage2 = 75;
normaltowercost2 = -10;
normaltowerrefund2 = 7;
normaltowerattackspeed3 = -10;
normaltowerrange3 = 10;
normaltowerdamage3 = 50;
normaltowercost3 = -10;
normaltowerrefund3 = 7;
normaltowerattackspeed4 = 0;
normaltowerrange4 = 20;
normaltowerdamage4 = 25;
normaltowercost4 = -10;
normaltowerrefund4 = 5;
normaltowerattackspeed5 = -10;
normaltowerrange5 = 30;
normaltowerdamage5 = 150;
normaltowercost5 = -100;
normaltowerrefund5 = 30;
normaltowerattackspeed6 = "";
normaltowerrange6 = "";
normaltowerdamage6 = "";
normaltowercost6 = "";
normaltowerrefund6 = "";
maxnormallevel = 6;
slowtowerattackspeed1 = 40;
slowtowerrange1 = 100;
slowtowerdamage1 = 50;
slowtowercost1 = -10;
slowtowerrefund1 = 7;
slowtowerattackspeed2 = 0;
slowtowerrange2 = 10;
slowtowerdamage2 = 20;
slowtowercost2 = -10;
slowtowerrefund2 = 7;
slowtowerattackspeed3 = -10;
slowtowerrange3 = 10;
slowtowerdamage3 = 20;
slowtowercost3 = -10;
slowtowerrefund3 = 7;
slowtowerattackspeed4 = 0;
slowtowerrange4 = 10;
slowtowerdamage4 = 20;
slowtowercost4 = -10;
slowtowerrefund4 = 7;
slowtowerattackspeed5 = -10;
slowtowerrange5 = 10;
slowtowerdamage5 = 50;
slowtowercost5 = -100;
slowtowerrefund5 = 50;
slowtowerattackspeed6 = "";
slowtowerrange6 = "";
slowtowerdamage6 = "";
slowtowercost6 = "";
slowtowerrefund6 = "";
maxslowlevel = 6;
poisontowerattackspeed1 = 30;
poisontowerrange1 = 75;
poisontowerdamage1 = 50;
poisontowercost1 = -10;
poisontowerrefund1 = 7;
poisontowerattackspeed2 = -5;
poisontowerrange2 = 5;
poisontowerdamage2 = 25;
poisontowercost2 = -10;
poisontowerrefund2 = 7;
poisontowerattackspeed3 = 0;
poisontowerrange3 = 5;
poisontowerdamage3 = 20;
poisontowercost3 = -10;
poisontowerrefund3 = 7;
poisontowerattackspeed4 = 5;
poisontowerrange4 = 10;
poisontowerdamage4 = 15;
poisontowercost4 = -10;
poisontowerrefund4 = 7;
poisontowerattackspeed5 = 15;
poisontowerrange5 = 30;
poisontowerdamage5 = 50;
poisontowercost5 = -100;
poisontowerrefund5 = 50;
poisontowerattackspeed6 = "";
poisontowerrange6 = "";
poisontowerdamage6 = "";
poisontowercost6 = "";
poisontowerrefund6 = "";
maxpoisonlevel = 6;
monsterspeed1 = 2;
monsterarmour1 = 3;
monsterbounty1 = 1;
monsterspeed2 = 1;
monsterarmour2 = 10;
monsterbounty2 = 2;
monsterspeed3 = 3;
monsterarmour3 = 6;
monsterbounty3 = 3;
monsterspeed4 = 2;
monsterarmour4 = 20;
monsterbounty4 = 4;
monsterspeed5 = 4;
monsterarmour5 = 10;
monsterbounty5 = 5;
Frame 226
var n = 1;
while (n <= badguys) {
var m = 1;
while (m <= 35) {
timercheck = eval ("towertimer" + m);
if (timercheck >= eval ("towerspeed" + m)) {
xpos = eval (("_root.map.tower" + m) + "._x");
ypos = eval (("_root.map.tower" + m) + "._y");
if ((((xpos > (eval (("badguy" add n) add "._x") - eval ("range" + m))) && (xpos < (eval (("badguy" add n) add "._x") + eval ("range" + m)))) && (ypos > (eval (("badguy" add n) add "._y") - eval ("range" + m)))) && (ypos < (eval (("badguy" add n) add "._y") + eval ("range" + m)))) {
setProperty(eval ("bar" add n), _xscale , eval (("bar" add n) add "._xscale") - (eval ("damage" + m) / eval ("armour" + n)));
if (("slow" == eval (("_root.tower" + m) + "type")) && (0 == eval ("slowed" + n))) {
Set("speed" + n, eval ("speed" + n) * 0.7);
Set("slowed" + n, 1);
Set("statustimer" + n, 150);
}
if (("poison" == eval (("_root.tower" + m) + "type")) && (0 == eval ("poisoned" + n))) {
Set("poisoned" + n, 1);
Set("poisontimer" + n, 50);
}
Set("towertimer" + m, 0);
}
}
m++;
}
n++;
}
_root.map.tower1.onPress = function () {
towerselect = 1;
};
_root.map.tower2.onPress = function () {
towerselect = 2;
};
_root.map.tower3.onPress = function () {
towerselect = 3;
};
_root.map.tower4.onPress = function () {
towerselect = 4;
};
_root.map.tower5.onPress = function () {
towerselect = 5;
};
_root.map.tower6.onPress = function () {
towerselect = 6;
};
_root.map.tower7.onPress = function () {
towerselect = 7;
};
_root.map.tower8.onPress = function () {
towerselect = 8;
};
_root.map.tower9.onPress = function () {
towerselect = 9;
};
_root.map.tower10.onPress = function () {
towerselect = 10;
};
_root.map.tower11.onPress = function () {
towerselect = 11;
};
_root.map.tower12.onPress = function () {
towerselect = 12;
};
_root.map.tower13.onPress = function () {
towerselect = 13;
};
_root.map.tower14.onPress = function () {
towerselect = 14;
};
_root.map.tower15.onPress = function () {
towerselect = 15;
};
_root.map.tower16.onPress = function () {
towerselect = 16;
};
_root.map.tower17.onPress = function () {
towerselect = 17;
};
_root.map.tower18.onPress = function () {
towerselect = 18;
};
_root.map.tower19.onPress = function () {
towerselect = 19;
};
_root.map.tower20.onPress = function () {
towerselect = 20;
};
_root.map.tower21.onPress = function () {
towerselect = 21;
};
_root.map.tower22.onPress = function () {
towerselect = 22;
};
_root.map.tower23.onPress = function () {
towerselect = 23;
};
_root.map.tower24.onPress = function () {
towerselect = 24;
};
_root.map.tower25.onPress = function () {
towerselect = 25;
};
_root.map.tower26.onPress = function () {
towerselect = 26;
};
_root.map.tower27.onPress = function () {
towerselect = 27;
};
_root.map.tower28.onPress = function () {
towerselect = 28;
};
_root.map.tower29.onPress = function () {
towerselect = 29;
};
_root.map.tower30.onPress = function () {
towerselect = 30;
};
_root.map.tower31.onPress = function () {
towerselect = 31;
};
_root.map.tower32.onPress = function () {
towerselect = 32;
};
_root.map.tower33.onPress = function () {
towerselect = 33;
};
_root.map.tower34.onPress = function () {
towerselect = 34;
};
_root.map.tower35.onPress = function () {
towerselect = 35;
};
Frame 227
if (killed == badguystotal) {
level = level + 1;
newlevel = 1;
}
if (newlevel == 1) {
if (level == 1) {
monster1total = 15;
monster2total = 0;
monster3total = 0;
monster4total = 0;
monster5total = 0;
monsterspacing = 15;
}
if (level == 2) {
monster1total = 0;
monster2total = 15;
monster3total = 0;
monster4total = 0;
monster5total = 0;
monsterspacing = 20;
}
if (level == 3) {
monster1total = 0;
monster2total = 0;
monster3total = 15;
monster4total = 0;
monster5total = 0;
monsterspacing = 10;
}
if (level == 4) {
monster1total = 10;
monster2total = 10;
monster3total = 10;
monster4total = 0;
monster5total = 0;
monsterspacing = 10;
}
if (level == 5) {
monster1total = 5;
monster2total = 5;
monster3total = 5;
monster4total = 15;
monster5total = 0;
monsterspacing = 15;
}
if (level == 6) {
monster1total = 0;
monster2total = 5;
monster3total = 5;
monster4total = 15;
monster5total = 15;
monsterspacing = 10;
}
if (level == 7) {
monsterspeed1 = 3;
monsterarmour1 = 10;
monsterbounty1 = 5;
monster1total = 15;
monster2total = 0;
monster3total = 0;
monster4total = 15;
monster5total = 15;
monsterspacing = 10;
}
if (level == 8) {
monsterspeed2 = 1.5;
monsterarmour2 = 50;
monsterbounty2 = 5;
monster1total = 15;
monster2total = 15;
monster3total = 0;
monster4total = 10;
monster5total = 10;
monsterspacing = 10;
}
if (level == 9) {
monsterspeed3 = 3.5;
monsterarmour3 = 15;
monsterbounty3 = 4;
monster1total = 15;
monster2total = 15;
monster3total = 20;
monster4total = 0;
monster5total = 10;
monsterspacing = 10;
}
if (level == 10) {
monsterspeed2 = 2.5;
monsterarmour2 = 50;
monsterbounty2 = 2;
monster1total = 15;
monster2total = 15;
monster3total = 15;
monster4total = 20;
monster5total = 10;
monsterspacing = 10;
}
if (level == 11) {
monsterspeed2 = 4.5;
monsterarmour2 = 75;
monsterbounty2 = 3;
monster1total = 15;
monster2total = 15;
monster3total = 15;
monster4total = 20;
monster5total = 25;
monsterspacing = 5;
}
if (level == 12) {
monsterspeed1 = 4;
monsterarmour1 = 75;
monsterbounty1 = 5;
monster1total = 100;
monster2total = 0;
monster3total = 0;
monster4total = 0;
monster5total = 0;
monsterspacing = 10;
}
if (level == 13) {
monsterspeed2 = 3;
monsterarmour2 = 100;
monsterbounty2 = 5;
monster1total = 0;
monster2total = 125;
monster3total = 0;
monster4total = 0;
monster5total = 0;
monsterspacing = 10;
}
if (level == 14) {
monsterspeed3 = 4;
monsterarmour3 = 80;
monsterbounty3 = 7;
monster1total = 25;
monster2total = 25;
monster3total = 100;
monster4total = 10;
monster5total = 10;
monsterspacing = 10;
}
if (level == 15) {
monsterspeed4 = 4.5;
monsterarmour4 = 60;
monsterbounty4 = 9;
monsterspeed5 = 5;
monsterarmour5 = 50;
monsterbounty5 = 8;
monster1total = 20;
monster2total = 20;
monster3total = 20;
monster4total = 20;
monster5total = 20;
monsterspacing = 10;
}
if (level == 16) {
gotoAndStop (229);
}
badguystotal = (((monster1total + monster2total) + monster3total) + monster4total) + monster5total;
monster1 = 0;
monster2 = 0;
monster3 = 0;
monster4 = 0;
monster5 = 0;
newlevel = 0;
killed = 0;
timer = 0;
badguys = 0;
}
if ((badguys < badguystotal) && (timer >= monsterspacing)) {
monstertype = random(5) + 1;
if ((monstertype == 1) && (monster1 < monster1total)) {
badguys = badguys + 1;
attachMovie("badguy1", "badguy" add badguys, 60000 + badguys, {_x:0, _y:72});
attachMovie("bar", "bar" add badguys, 50000 + badguys, {_x:0, _y:55});
Set("speed" + badguys, monsterspeed1);
Set("armour" + badguys, monsterarmour1);
Set("bounty" + badguys, monsterbounty1);
Set("slowed" + badguys, 0);
Set("statustimer" + badguys, 0);
Set("poisoned" + badguys, 0);
Set("poisontimer" + badguys, 0);
Set("killed" + n, 0);
Set("escaped" + n, 0);
monster1 = monster1 + 1;
timer = 0;
}
if ((monstertype == 2) && (monster2 < monster2total)) {
badguys = badguys + 1;
attachMovie("badguy2", "badguy" add badguys, 60000 + badguys, {_x:0, _y:72});
attachMovie("bar", "bar" add badguys, 50000 + badguys, {_x:0, _y:55});
Set("speed" + badguys, monsterspeed2);
Set("armour" + badguys, monsterarmour2);
Set("bounty" + badguys, monsterbounty2);
Set("slowed" + badguys, 0);
Set("statustimer" + badguys, 0);
Set("poisoned" + badguys, 0);
Set("poisontimer" + badguys, 0);
Set("killed" + n, 0);
Set("escaped" + n, 0);
monster2 = monster2 + 1;
timer = 0;
} else if ((monstertype == 3) && (monster3 < monster3total)) {
badguys = badguys + 1;
attachMovie("badguy3", "badguy" add badguys, 60000 + badguys, {_x:0, _y:72});
attachMovie("bar", "bar" add badguys, 50000 + badguys, {_x:0, _y:55});
Set("speed" + badguys, monsterspeed3);
Set("armour" + badguys, monsterarmour3);
Set("bounty" + badguys, monsterbounty3);
Set("slowed" + badguys, 0);
Set("statustimer" + badguys, 0);
Set("poisoned" + badguys, 0);
Set("poisontimer" + badguys, 0);
Set("killed" + n, 0);
Set("escaped" + n, 0);
monster3 = monster3 + 1;
timer = 0;
} else if ((monstertype == 4) && (monster4 < monster4total)) {
badguys = badguys + 1;
attachMovie("badguy4", "badguy" add badguys, 60000 + badguys, {_x:0, _y:72});
attachMovie("bar", "bar" add badguys, 50000 + badguys, {_x:0, _y:55});
Set("speed" + badguys, monsterspeed4);
Set("armour" + badguys, monsterarmour4);
Set("bounty" + badguys, monsterbounty4);
Set("slowed" + badguys, 0);
Set("statustimer" + badguys, 0);
Set("poisoned" + badguys, 0);
Set("poisontimer" + badguys, 0);
Set("killed" + n, 0);
Set("escaped" + n, 0);
monster4 = monster4 + 1;
timer = 0;
} else if ((monstertype == 5) && (monster5 < monster5total)) {
badguys = badguys + 1;
attachMovie("badguy5", "badguy" add badguys, 60000 + badguys, {_x:0, _y:72});
attachMovie("bar", "bar" add badguys, 50000 + badguys, {_x:0, _y:55});
Set("speed" + badguys, monsterspeed5);
Set("armour" + badguys, monsterarmour5);
Set("bounty" + badguys, monsterbounty5);
Set("slowed" + badguys, 0);
Set("statustimer" + badguys, 0);
Set("poisoned" + badguys, 0);
Set("poisontimer" + badguys, 0);
Set("killed" + n, 0);
Set("escaped" + n, 0);
monster5 = monster5 + 1;
timer = 0;
}
}
var n = 1;
while (n <= badguys) {
if ((1 == eval ("poisoned" + n)) && (0 >= eval ("poisontimer" + n))) {
Set("poisoned" + n, 0);
}
Set("poisontimer" + n, eval ("poisontimer" + n) - 1);
if (0 >= eval ("poisontimer" + n)) {
Set("poisontimer" + n, 0);
}
if (1 == eval ("poisoned" + n)) {
setProperty(eval ("bar" add n), _xscale , eval (("bar" add n) add "._xscale") - 0.5);
}
n++;
}
var n = 1;
while (n <= badguys) {
if ((1 == eval ("slowed" + n)) && (0 >= eval ("statustimer" + n))) {
Set("slowed" + n, 0);
Set("speed" + n, eval ("speed" + n) / 0.8);
}
Set("statustimer" + n, eval ("statustimer" + n) - 1);
if (0 >= eval ("statustimer" + n)) {
Set("statustimer" + n, 0);
}
n++;
}
var n = 1;
while (n <= badguys) {
if ((0 >= eval (("bar" + n) + "._xscale")) && (0 == eval ("killed" + n))) {
removeMovieClip("badguy" + n);
removeMovieClip("bar" + n);
killed = killed + 1;
if (0 == eval ("escaped" + n)) {
gold = gold + eval ("bounty" + n);
actualkilled = actualkilled + 1;
}
Set("poisoned" + n, 0);
Set("killed" + n, 1);
}
n++;
}
var n = 1;
while (n <= badguys) {
if ((480 > eval (("badguy" add n) add "._x")) && (72 == eval (("badguy" add n) add "._y"))) {
setProperty(eval ("badguy" add n), _x , eval (("badguy" add n) add "._x") + eval ("speed" + n));
setProperty(eval ("bar" add n), _x , eval (("bar" add n) add "._x") + eval ("speed" + n));
} else if ((480 <= eval (("badguy" add n) add "._x")) && (216 > eval (("badguy" add n) add "._y"))) {
setProperty(eval ("badguy" add n), _rotation , 90);
setProperty(eval ("badguy" add n), _y , eval (("badguy" add n) add "._y") + eval ("speed" + n));
setProperty(eval ("bar" add n), _y , eval (("bar" add n) add "._y") + eval ("speed" + n));
} else if (((72 < eval (("badguy" add n) add "._x")) && (216 <= eval (("badguy" add n) add "._y"))) && (360 > eval (("badguy" add n) add "._y"))) {
setProperty(eval ("badguy" add n), _rotation , 180);
setProperty(eval ("badguy" add n), _x , eval (("badguy" add n) add "._x") - eval ("speed" + n));
setProperty(eval ("bar" add n), _x , eval (("bar" add n) add "._x") - eval ("speed" + n));
} else if ((72 >= eval (("badguy" add n) add "._x")) && (360 > eval (("badguy" add n) add "._y"))) {
setProperty(eval ("badguy" add n), _rotation , 90);
setProperty(eval ("badguy" add n), _y , eval (("badguy" add n) add "._y") + eval ("speed" + n));
setProperty(eval ("bar" add n), _y , eval (("bar" add n) add "._y") + eval ("speed" + n));
} else if ((552 > eval (("badguy" add n) add "._x")) && (360 <= eval (("badguy" add n) add "._y"))) {
setProperty(eval ("badguy" add n), _rotation , 0);
setProperty(eval ("badguy" add n), _x , eval (("badguy" add n) add "._x") + eval ("speed" + n));
setProperty(eval ("bar" add n), _x , eval (("bar" add n) add "._x") + eval ("speed" + n));
} else if (552 <= eval (("badguy" add n) add "._x")) {
removeMovieClip("badguy" + n);
removeMovieClip("bar" + n);
if ((0 == eval ("escaped" + n)) && (0 == eval ("killed" + n))) {
escaped = escaped + 1;
Set("escaped" + n, 1);
}
}
n++;
}
timer = timer + 1;
var m = 1;
while (m <= 35) {
Set("towertimer" + m, eval ("towertimer" + m) + 1);
m++;
}
if (escaped >= 10) {
gotoAndStop (228);
}
ingame.onSoundComplete = function () {
ingame.stop();
ingame.start();
};
gotoAndPlay (226);
Frame 228
stop();
removeMovieClip(map);
var n = 1;
while (n <= badguys) {
removeMovieClip("badguy" + n);
removeMovieClip("bar" + n);
n++;
}
var m = 1;
while (m <= 35) {
removeMovieClip("towerpicture" + m);
m++;
}
var m = 1;
while (m <= 35) {
removeMovieClip("_root.towerstatus.towerpicture" + m);
m++;
}
removeMovieClip(towerstatus);
attachMovie("gameover", "gameover", 9000000, {_x:0, _y:0});
Frame 229
stop();
removeMovieClip(map);
var n = 1;
while (n <= badguys) {
removeMovieClip("badguy" + n);
removeMovieClip("bar" + n);
n++;
}
var m = 1;
while (m <= 35) {
removeMovieClip("towerpicture" + m);
m++;
}
var m = 1;
while (m <= 35) {
removeMovieClip("_root.towerstatus.towerpicture" + m);
m++;
}
removeMovieClip(towerstatus);
attachMovie("win", "win", 9000000, {_x:0, _y:0});
Symbol 23 MovieClip [map] Frame 1
M0 = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
M1 = new Array(0, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0);
M2 = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0);
M3 = new Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0);
M4 = new Array(0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 5, 0, 1, 1, 0, 0);
M5 = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0);
M6 = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 5, 0);
M7 = new Array(0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 5, 0, 1, 1, 0, 0);
M8 = new Array(0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0);
M9 = new Array(0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0);
M10 = new Array(0, 0, 1, 1, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0);
M11 = new Array(0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
M12 = new Array(5, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
M13 = new Array(0, 0, 1, 1, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 5);
M14 = new Array(0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
M15 = new Array(0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
M16 = new Array(0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 0, 0, 5, 0, 5, 0, 5);
M17 = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
M18 = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
towernumber = 1;
n3 = 1;
var n1 = 0;
while (n1 <= 18) {
var n2 = 0;
while (n2 <= 22) {
if (eval ("M" add n1)[n2] == 0) {
attachMovie("trees", (("trees" add n1) add "-") add n2, n3, {_x:n2 * 24, _y:n1 * 24});
}
if (eval ("M" add n1)[n2] == 1) {
attachMovie("path", (("path" add n1) add "-") add n2, n3, {_x:n2 * 24, _y:n1 * 24});
}
if (eval ("M" add n1)[n2] == 5) {
attachMovie("tower", "tower" add towernumber, n3);
attachMovie("tower1", "towerpicture" add towernumber, n3 + 1, {_x:n2 * 24, _y:n1 * 24});
eval ("tower" add towernumber)._x = n2 * 24;
eval ("tower" add towernumber)._y = n1 * 24;
Set(("_root.tower" + towernumber) + "type", 1);
Set("_root.towertimer" + towernumber, 0);
Set("_root.towerspeed" + towernumber, 0);
Set("_root.range" + towernumber, 0);
Set("_root.damage" + towernumber, 0);
Set("_root.buyback" + towernumber, 0);
Set("_root.towerlevel" + towernumber, 0);
towernumber = towernumber + 1;
}
n3 = n3 + 2;
n2++;
}
n2 = 0;
n1++;
}
Symbol 43 MovieClip [towerstatus] Frame 1
nextlevel = eval ("_root.towerlevel" + _root.towerselect) + 1;
if (1 == eval (("_root.tower" + _root.towerselect) + "type")) {
attachMovie("upgrade1", "upgrade1", 6001, {_x:270, _y:0});
attachMovie("upgradeslow", "upgradeslow", 6002, {_x:270, _y:35});
upgrade1._x = 240;
upgrade1._y = 0;
upgradeslow._x = 240;
upgradeslow._y = 35;
attachMovie("upgradepoison", "upgradepoison", 6004, {_x:270, _y:35});
upgradepoison._x = 300;
upgradepoison._y = 35;
removeMovieClip(demolish);
}
if (("normal" == eval (("_root.tower" + _root.towerselect) + "type")) && (nextlevel != _root.maxnormallevel)) {
attachMovie("upgrade1", "upgrade1", 6001, {_x:270, _y:0});
upgrade1._x = 240;
upgrade1._y = 0;
removeMovieClip(upgradepoison);
removeMovieClip(upgradeslow);
attachMovie("demolish", "demolish", 6003, {_x:270, _y:0});
demolish._x = 300;
demolish._y = 0;
}
if (("normal" == eval (("_root.tower" + _root.towerselect) + "type")) && (nextlevel == _root.maxnormallevel)) {
removeMovieClip(upgrade1);
removeMovieClip(upgradepoison);
removeMovieClip(upgradeslow);
attachMovie("demolish", "demolish", 6003, {_x:270, _y:0});
demolish._x = 300;
demolish._y = 0;
}
if (("slow" == eval (("_root.tower" + _root.towerselect) + "type")) && (nextlevel != _root.maxslowlevel)) {
attachMovie("upgradeslow", "upgradeslow", 6002, {_x:270, _y:35});
upgradeslow._x = 240;
upgradeslow._y = 35;
removeMovieClip(upgradepoison);
removeMovieClip(upgrade1);
attachMovie("demolish", "demolish", 6003, {_x:270, _y:0});
demolish._x = 300;
demolish._y = 0;
}
if (("slow" == eval (("_root.tower" + _root.towerselect) + "type")) && (nextlevel == _root.maxslowlevel)) {
removeMovieClip(upgrade1);
removeMovieClip(upgradepoison);
removeMovieClip(upgradeslow);
attachMovie("demolish", "demolish", 6003, {_x:270, _y:0});
demolish._x = 300;
demolish._y = 0;
}
if (("poison" == eval (("_root.tower" + _root.towerselect) + "type")) && (nextlevel != _root.maxpoisonlevel)) {
attachMovie("upgradepoison", "upgradepoison", 6004, {_x:270, _y:35});
upgradepoison._x = 300;
upgradepoison._y = 35;
removeMovieClip(upgradeslow);
removeMovieClip(upgrade1);
attachMovie("demolish", "demolish", 6003, {_x:270, _y:0});
demolish._x = 300;
demolish._y = 0;
}
if (("poison" == eval (("_root.tower" + _root.towerselect) + "type")) && (nextlevel == _root.maxpoisonlevel)) {
removeMovieClip(upgrade1);
removeMovieClip(upgradepoison);
removeMovieClip(upgradeslow);
attachMovie("demolish", "demolish", 6003, {_x:270, _y:0});
demolish._x = 300;
demolish._y = 0;
}
upgrade1.onRollOver = function () {
upspeed = eval ("_root.normaltowerattackspeed" + nextlevel);
updamage = eval ("_root.normaltowerdamage" + nextlevel);
uprange = eval ("_root.normaltowerrange" + nextlevel);
upgold = eval ("_root.normaltowercost" + nextlevel);
if (upspeed > 0) {
upspeed = "+" + upspeed;
}
if (updamage > 0) {
updamage = "+" + updamage;
}
if (uprange > 0) {
uprange = "+" + uprange;
}
};
upgrade1.onRollOut = function () {
upspeed = "";
updamage = "";
uprange = "";
upgold = "";
};
upgrade1.onPress = function () {
if ((_root.gold >= (-1 * eval ("_root.normaltowercost" + nextlevel))) && (_root.maxnormallevel != eval ("_root.towerlevel" + _root.towerselect))) {
xpos = eval (("_root.map.tower" + _root.towerselect) + "._x");
ypos = eval (("_root.map.tower" + _root.towerselect) + "._y");
Set("_root.towerlevel" + _root.towerselect, eval ("_root.towerlevel" + _root.towerselect) + 1);
attachMovie("normal" + eval ("_root.towerlevel" + _root.towerselect), "towerpicture" + _root.towerselect, 800 + _root.towerselect, {_x:xpos - 50, _y:ypos - 475});
Set(("_root.tower" + _root.towerselect) + "type", "normal");
Set("_root.range" + _root.towerselect, eval ("_root.range" + _root.towerselect) + eval ("_root.normaltowerrange" + nextlevel));
Set("_root.towerspeed" + _root.towerselect, eval ("_root.towerspeed" + _root.towerselect) + eval ("_root.normaltowerattackspeed" + nextlevel));
Set("_root.damage" + _root.towerselect, eval ("_root.damage" + _root.towerselect) + eval ("_root.normaltowerdamage" + nextlevel));
Set("_root.buyback" + _root.towerselect, eval ("_root.buyback" + _root.towerselect) + eval ("_root.normaltowerrefund" + nextlevel));
_root.gold = _root.gold + eval ("_root.normaltowercost" + nextlevel);
upspeed = "";
updamage = "";
uprange = "";
upgold = "";
}
};
upgradeslow.onRollOver = function () {
upspeed = eval ("_root.slowtowerattackspeed" + nextlevel);
updamage = eval ("_root.slowtowerdamage" + nextlevel);
uprange = eval ("_root.slowtowerrange" + nextlevel);
upgold = eval ("_root.slowtowercost" + nextlevel);
if (upspeed > 0) {
upspeed = "+" + upspeed;
}
if (updamage > 0) {
updamage = "+" + updamage;
}
if (uprange > 0) {
uprange = "+" + uprange;
}
};
upgradeslow.onRollOut = function () {
upspeed = "";
updamage = "";
uprange = "";
upgold = "";
};
upgradeslow.onPress = function () {
if ((_root.gold >= (-1 * eval ("_root.slowtowercost" + nextlevel))) && (_root.maxslowlevel != eval ("_root.towerlevel" + _root.towerselect))) {
xpos = eval (("_root.map.tower" + _root.towerselect) + "._x");
ypos = eval (("_root.map.tower" + _root.towerselect) + "._y");
Set(("_root.tower" + _root.towerselect) + "type", "slow");
Set("_root.towerlevel" + _root.towerselect, eval ("_root.towerlevel" + _root.towerselect) + 1);
attachMovie("slow" + eval ("_root.towerlevel" + _root.towerselect), "towerpicture" + _root.towerselect, 800 + _root.towerselect, {_x:xpos - 50, _y:ypos - 475});
Set("_root.range" + _root.towerselect, eval ("_root.range" + _root.towerselect) + eval ("_root.slowtowerrange" + nextlevel));
Set("_root.towerspeed" + _root.towerselect, eval ("_root.towerspeed" + _root.towerselect) + eval ("_root.slowtowerattackspeed" + nextlevel));
Set("_root.damage" + _root.towerselect, eval ("_root.damage" + _root.towerselect) + eval ("_root.slowtowerdamage" + nextlevel));
Set("_root.buyback" + _root.towerselect, eval ("_root.buyback" + _root.towerselect) + eval ("_root.slowtowerrefund" + nextlevel));
_root.gold = _root.gold + eval ("_root.slowtowercost" + nextlevel);
upspeed = "";
updamage = "";
uprange = "";
upgold = "";
}
};
upgradepoison.onRollOver = function () {
upspeed = eval ("_root.poisontowerattackspeed" + nextlevel);
updamage = eval ("_root.poisontowerdamage" + nextlevel);
uprange = eval ("_root.poisontowerrange" + nextlevel);
upgold = eval ("_root.poisontowercost" + nextlevel);
if (upspeed > 0) {
upspeed = "+" + upspeed;
}
if (updamage > 0) {
updamage = "+" + updamage;
}
if (uprange > 0) {
uprange = "+" + uprange;
}
};
upgradepoison.onRollOut = function () {
upspeed = "";
updamage = "";
uprange = "";
upgold = "";
};
upgradepoison.onPress = function () {
if ((_root.gold >= (-1 * eval ("_root.poisontowercost" + nextlevel))) && (_root.maxpoisonlevel != eval ("_root.towerlevel" + _root.towerselect))) {
xpos = eval (("_root.map.tower" + _root.towerselect) + "._x");
ypos = eval (("_root.map.tower" + _root.towerselect) + "._y");
Set(("_root.tower" + _root.towerselect) + "type", "poison");
Set("_root.towerlevel" + _root.towerselect, eval ("_root.towerlevel" + _root.towerselect) + 1);
attachMovie("poison" + eval ("_root.towerlevel" + _root.towerselect), "towerpicture" + _root.towerselect, 800 + _root.towerselect, {_x:xpos - 50, _y:ypos - 475});
Set("_root.range" + _root.towerselect, eval ("_root.range" + _root.towerselect) + eval ("_root.poisontowerrange" + nextlevel));
Set("_root.towerspeed" + _root.towerselect, eval ("_root.towerspeed" + _root.towerselect) + eval ("_root.poisontowerattackspeed" + nextlevel));
Set("_root.damage" + _root.towerselect, eval ("_root.damage" + _root.towerselect) + eval ("_root.poisontowerdamage" + nextlevel));
Set("_root.buyback" + _root.towerselect, eval ("_root.buyback" + _root.towerselect) + eval ("_root.poisontowerrefund" + nextlevel));
_root.gold = _root.gold + eval ("_root.poisontowercost" + nextlevel);
}
};
demolish.onRollOver = function () {
upspeed = eval ("_root.towerspeed" + _root.towerselect) * -1;
updamage = eval ("_root.damage" + _root.towerselect) * -1;
uprange = eval ("_root.range" + _root.towerselect) * -1;
upgold = eval ("_root.buyback" + _root.towerselect);
if (upgold > 0) {
upgold = "+" + upgold;
}
};
demolish.onRollOut = function () {
upspeed = "";
updamage = "";
uprange = "";
upgold = "";
};
demolish.onPress = function () {
if (_root.gold >= _root.towercost1) {
xpos = eval (("_root.map.tower" + _root.towerselect) + "._x");
ypos = eval (("_root.map.tower" + _root.towerselect) + "._y");
attachMovie("tower1", "towerpicture" + _root.towerselect, 800 + _root.towerselect, {_x:xpos - 50, _y:ypos - 475});
Set(("_root.tower" + _root.towerselect) + "type", 1);
Set("_root.range" + _root.towerselect, 0);
Set("_root.towerspeed" + _root.towerselect, 0);
Set("_root.damage" + _root.towerselect, 0);
_root.gold = _root.gold + eval ("_root.buyback" + _root.towerselect);
Set("_root.buyback" + _root.towerselect, 0);
Set("_root.towerlevel" + _root.towerselect, 0);
upspeed = "";
updamage = "";
uprange = "";
upgold = "";
}
};
disprange = eval ("_root.range" + _root.towerselect);
dispspeed = eval ("_root.towerspeed" + _root.towerselect);
dispdamage = eval ("_root.damage" + _root.towerselect);
Symbol 43 MovieClip [towerstatus] Frame 2
gotoAndPlay (1);
Symbol 91 MovieClip [gameover] Frame 1
replay.onPress = function () {
removeMovieClip(_root.gameover);
removeMovieClip(gameover);
gotoAndPlay (222);
};
Symbol 136 Button
on (release) {
_root.play();
}
Symbol 137 MovieClip Frame 1
_root.stop();
PercentLoaded = (_root.getBytesLoaded() / _root.getBytesTotal()) * 100;
if (PercentLoaded != 100) {
setProperty(bar, _xscale , PercentLoaded);
} else {
gotoAndStop ("loaded");
}
Symbol 137 MovieClip Frame 2
gotoAndPlay (1);