Frame 1
function stickA() {
this.num = numA;
this.mode = -1;
numA++;
}
_quality = "BEST";
fscommand ("showmenu", "false");
var sound = 1;
var qual = 1;
var ticks = 0;
var ticks2 = 0;
var convertticks = -1;
var converts = 0;
var archers = 0;
var craftsmen = 0;
var wizards = 0;
var temple = 0;
var archeryrange = 0;
var lumbermill = 0;
var manapool = 0;
var score = 0;
var totalscore = 0;
var kills = 0;
var totalkills = 0;
var spendable = 0;
var dispscore = 0;
var dispkills = 0;
var armortotal = 1000;
var armor = armortotal;
var stage = 0;
var stageticks = 600;
var stickmax = 2;
var stickrate = 270;
var stickspeed = 1;
var cloudvel = new Array();
var numA = 0;
var CASTLEGATE = 25;
stickA.prototype.move = function () {
with (eval ("stickA" + this.num)) {
if (this.mode == -1) {
this.xwalk = (((random(10) / 10) + 1.5) - Math.min(wizards * 0.2, 1)) * stickspeed;
if (this.num > 9) {
this.xwalk = (((random(10) / 10) + 0.5) - Math.min(wizards * 0.07, 1)) * stickspeed;
}
this.xvel = 0;
this.yvel = 0;
this.x = -30;
this.y = random(40) + 280;
gotoAndStop(1);
walk.gotoAndPlay(random(10));
_x = this.x;
_y = this.y;
eval ("stickA" + this.num).mynum = this.num;
this.mode = 0;
} else if (this.mode == 0) {
_x = _x + this.xwalk;
if ((_y - _x) < CASTLEGATE) {
_x = _y - 26;
this.mode = 1;
stop();
gotoAndPlay(11);
}
} else if (this.mode == 1) {
if (this.num < 10) {
_parent.armor = _parent.armor - 1;
}
if (this.num >= 10) {
_parent.armor = _parent.armor - 5;
}
} else if (this.mode == 3) {
this.xp = _x;
this.yp = _y;
gotoAndStop(1);
this.mode = 8;
} else if (this.mode == 8) {
this.xp = _x;
this.yp = _y;
} else if (this.mode == 4) {
this.xvel = (_x - this.xp) / 3;
this.yvel = (_y - this.yp) / 3;
if (this.yvel < -10) {
this.yvel = -10;
}
this.mode = 5;
} else if (this.mode == 5) {
this.yvel = this.yvel + 1;
_x = _x + this.xvel;
_y = _y + this.yvel;
if (_x > 550) {
_x = 550;
this.xvel = 0;
}
if (_x < 0) {
_x = 0;
this.xvel = this.xvel / -10;
}
if (_y > this.y) {
_y = this.y;
if (((this.yvel + this.xvel) > 22) && (_y > 200)) {
eval ("_parent.SFXsplatter" + random(3)).gotoAndPlay(2);
_parent.kills = _parent.kills + 1;
_parent.score = _parent.score + 60;
if (this.num > 9) {
_parent.score = _parent.score + 100;
}
this.counter = 0;
this.mode = 9;
gotoAndPlay(32);
} else if ((((_x > 300) && (_x < 520)) && (convertticks == -1)) && (temple == 1)) {
_parent.SFXconvert.gotoAndPlay(2);
beam._visible = 1;
convertticks = ticks + 200;
_parent.score = _parent.score + 300;
_x = -30;
this.counter = 0;
this.mode = 9;
} else {
_parent.SFXfalldown.gotoAndPlay(2);
this.counter = 0;
this.mode = 6;
gotoAndPlay(100);
}
}
} else if (this.mode == 6) {
this.counter++;
if (this.counter > 20) {
gotoAndStop(1);
this.mode = 0;
}
} else if (this.mode == 9) {
this.counter++;
if (this.counter > 100) {
this.mode = -1;
}
} else if (this.mode == 10) {
gotoAndStop(1);
walk.gotoAndPlay(random(10));
this.mode = 11;
} else if (this.mode == 11) {
_x = _x + this.xwalk;
} else if (this.mode == 12) {
_parent.kills = _parent.kills + 1;
if (this.num > 9) {
_parent.score = _parent.score + 100;
}
this.counter = 0;
gotoAndPlay(32);
this.mode = 9;
}
}
};
function point3d(x, y, z) {
this.num = num;
this.x = x;
this.y = y;
this.z = z;
this.scale = 100;
num++;
}
function line(from, to) {
this.num = num;
this.from = from;
this.to = to;
num++;
}
num = 1;
perspective = 270;
XRotation = 0;
YRotation = 0;
ZRotation = 0;
point3d.prototype.draw = function () {
_root.space.attachMovie("point", "point" + this.num, this.num);
with (eval ("_root.space.point" + this.num)) {
_x = this.x * ((this.z / perspective) + 1);
_y = this.y * ((this.z / perspective) + 1);
_xscale = this.scale;
_yscale = this.scale;
}
eval ("_root.space.point" + this.num).mynum = this.num;
};
point3d.prototype.rotate = function (rotX, rotY, rotZ) {
var y1 = ((this.y * Math.cos(rotX)) + (this.z * Math.sin(rotX)));
var z1 = ((this.y * (-Math.sin(rotX))) + (this.z * Math.cos(rotX)));
var x1 = ((this.x * Math.cos(rotY)) + (z1 * (-Math.sin(rotY))));
var z2 = ((this.x * Math.sin(rotY)) + (z1 * Math.cos(rotY)));
var x2 = ((x1 * Math.cos(rotZ)) + (y1 * Math.sin(rotZ)));
var y2 = ((x1 * (-Math.sin(rotZ))) + (y1 * Math.cos(rotZ)));
this.scale = ((this.z / 2) + 100) + ((this.z / _root.perspective) + 1);
this.x = x2;
this.y = y2;
this.z = z2;
};
line.prototype.draw = function () {
fX = eval ("_root.space.point" + this.from)._x;
fY = eval ("_root.space.point" + this.from)._y;
tX = eval ("_root.space.point" + this.to)._x;
tY = eval ("_root.space.point" + this.to)._y;
_root.space.attachMovie("line", "line" + this.num, this.num);
with (eval ("_root.space.line" + this.num)) {
_x = fX;
_y = fY;
_xscale = tX - fX;
_yscale = tY - fY;
}
};
points = new Array();
totalpoints = 8;
points[1] = new point3d(-50, -50, -50);
points[2] = new point3d(-50, 50, -50);
points[3] = new point3d(50, 50, -50);
points[4] = new point3d(50, -50, -50);
points[5] = new point3d(-50, -50, 50);
points[6] = new point3d(-50, 50, 50);
points[7] = new point3d(50, 50, 50);
points[8] = new point3d(50, -50, 50);
lines = new Array();
totallines = 12;
lines[1] = new Line("1", "2");
lines[2] = new Line("6", "5");
lines[3] = new Line("6", "7");
lines[4] = new Line("3", "2");
lines[5] = new Line("1", "4");
lines[6] = new Line("6", "2");
lines[7] = new Line("8", "5");
lines[8] = new Line("8", "7");
lines[9] = new Line("3", "7");
lines[10] = new Line("8", "4");
lines[11] = new Line("1", "5");
lines[12] = new Line("3", "4");
Instance of Symbol 17 MovieClip "space" in Frame 1
onClipEvent (mouseDown) {
_root.pressing = true;
}
onClipEvent (mouseUp) {
_root.pressing = false;
}
Frame 2
gotoAndPlay (4);
Frame 3
gotoAndPlay (2);
Frame 4
percentloaded1 = int((100 / _totalframes) * _framesloaded);
percentloaded = ("(" + percentloaded1) + "%)";
tellTarget ("/loader") {
gotoAndStop(_level0:percentloaded1);
};
ifFrameLoaded (_totalframes) {
gotoAndPlay (10);
}
XRotation = _root.space._ymouse / 1000;
YRotation = _root.space._xmouse / -1000;
if (pressing) {
ZRotation = _root.space._xmouse / 1000;
}
Frame 5
gotoAndPlay (4);
i = 1;
while (i <= 8) {
points[i].rotate(XRotation, YRotation, ZRotation);
points[i].draw();
i++;
}
ii = int((12 / _totalframes) * _framesloaded);
i = 0;
while (i <= ii) {
lines[i].draw();
i++;
}
Frame 12
sticksA = new Array();
var i = 0;
while (i < 15) {
sticksA[i] = new stickA();
i++;
}
Frame 15
stop();
var i = 0;
while (i < 15) {
sticksA[i].mode = -1;
i++;
}
kills = 0;
ticks = 0;
convertticks = -1;
dispscore = score + totalscore;
dispkills = kills + totalkills;
stage++;
stageticks = stageticks + 100;
if (stickmax < 15) {
stickmax = stickmax + 2;
}
stickmax = stickmax + 2;
if (stickrate > 20) {
stickrate = stickrate - 20;
}
if (stage > 9) {
stickspeed = stickspeed + 0.1;
}
Frame 20
stop();
beam._visible = 0;
var i = 1;
while (i < 4) {
if (converts < i) {
eval ("convert" + i)._visible = 0;
}
i++;
}
var i = 1;
while (i < 5) {
eval ("cloud" + i)._x = random(620);
eval ("cloud" + i)._y = random(100);
cloudvel[i] = (random(10) / 20) + 1;
if (i > 2) {
cloudvel[i] = cloudvel[i] / 2;
}
eval ("cloud" + i)._x = eval ("cloud" + i)._x - cloudvel[i];
i++;
}
if (archeryrange == 0) {
archerflag._visible = 0;
}
if (lumbermill == 0) {
craftsmenflag._visible = 0;
}
if (manapool == 0) {
wizardflag._visible = 0;
}
var i = 1;
while (i < 9) {
if (archers < i) {
eval ("archer" + i)._visible = 0;
}
i++;
}
Frame 24
var stagetext = (("STAGE " + stage) + " COMPLETE !");
var killbonus = (kills * 10);
totalkills = totalkills + kills;
var sacarchers = 0;
var saccraftsmen = 0;
var sacwizards = 0;
Frame 27
stop();
Frame 28
if (((sacarchers + saccraftsmen) + sacwizards) == 0) {
sacrifice._visible = 0;
}
Frame 30
armorbar.gotoAndStop(101 - int((armor / armortotal) * 100));
if (temple == 1) {
temple_._visible = 0;
temple__._visible = 1;
} else {
temple__._visible = 0;
}
if (archeryrange == 1) {
archery_._visible = 0;
archery__._visible = 1;
} else {
archery__._visible = 0;
}
Frame 55
stop();
Symbol 9 Button
on (release) {
getURL ("http://www.xgenstudios.com/", "_new");
}
Symbol 14 MovieClip Frame 1
stop();
Symbol 30 MovieClip Frame 230
stop();
_parent.gotoAndStop(13);
Symbol 41 MovieClip Frame 219
stop();
Symbol 43 MovieClip Frame 1
var i = random(5);
Symbol 43 MovieClip Frame 30
gotoAndPlay(random(70) + 30);
Symbol 43 MovieClip Frame 101
gotoAndPlay (2);
Symbol 44 MovieClip Frame 1
var xwalk = 0;
var ywalk = 0;
var xacc = ((10 - (random(2) * 20)) * (random(20) / 100));
var yacc = ((10 - (random(2) * 20)) * (random(20) / 100));
aColor = new Color(SQ1);
aColorTransform = new Object();
aColorTransform.ba = random(255);
aColorTransform.ra = random(255);
aColorTransform.ga = random(255);
aColor.setTransform(aColorTransform);
Symbol 44 MovieClip Frame 2
SQ1._x = SQ1._x + this.xwalk;
SQ1._y = SQ1._y + this.ywalk;
this.xwalk = this.xwalk + this.xacc;
this.ywalk = this.ywalk + this.yacc;
if (this.xwalk > 5) {
this.xacc = -(random(10) / 20);
}
if (this.xwalk < -5) {
this.xacc = random(10) / 20;
}
if (this.ywalk > 5) {
this.yacc = -(random(10) / 20);
}
if (this.ywalk < -5) {
this.yacc = random(10) / 20;
}
if (SQ1._x < -100) {
this.xacc = 0.2;
}
if (SQ1._x > 100) {
this.xacc = -0.2;
}
if (SQ1._y < -100) {
this.yacc = 0.2;
}
if (SQ1._y > 100) {
this.yacc = -0.2;
}
Symbol 44 MovieClip Frame 3
gotoAndPlay (2);
Symbol 49 MovieClip Frame 1
var stagetext = ("STAGE " + _root.stage);
Symbol 49 MovieClip Frame 130
_root.gotoAndPlay(20);
Symbol 60 MovieClip Frame 16
gotoAndPlay(random(12));
Symbol 68 MovieClip Frame 16
gotoAndPlay(random(12));
Symbol 69 Button
on (release) {
if (converts > 0) {
SFXtrain.gotoAndPlay(2);
converts = converts - 1;
var i = 1;
while (i < 4) {
eval ("convert" + i)._visible = 0;
i++;
}
var i = 1;
while (i <= _parent.converts) {
eval ("convert" + i)._visible = 1;
i++;
}
wizards = wizards + 1;
wizardtext.gotoAndPlay(2);
}
}
Symbol 71 Button
on (press) {
_parent.sticksA[mynum].mode = 3;
startDrag ("", true);
}
on (release, releaseOutside) {
_parent.sticksA[mynum].mode = 4;
stopDrag();
}
Symbol 97 MovieClip Frame 1
stop();
Symbol 97 MovieClip Frame 22
gotoAndPlay (11);
Symbol 97 MovieClip Frame 99
stop();
Symbol 97 MovieClip Frame 117
stop();
Symbol 115 MovieClip Frame 1
stop();
Symbol 115 MovieClip Frame 31
gotoAndPlay (11);
Symbol 115 MovieClip Frame 99
stop();
Symbol 115 MovieClip Frame 117
stop();
Symbol 121 MovieClip Frame 1
stop();
Symbol 123 MovieClip Frame 1
stop();
Symbol 125 MovieClip Frame 1
stop();
Symbol 127 MovieClip Frame 1
stop();
Symbol 135 MovieClip Frame 16
gotoAndPlay(random(12));
Symbol 136 Button
on (release) {
if (converts > 0) {
SFXtrain.gotoAndPlay(2);
converts = converts - 1;
var i = 1;
while (i < 4) {
eval ("convert" + i)._visible = 0;
i++;
}
var i = 1;
while (i <= _parent.converts) {
eval ("convert" + i)._visible = 1;
i++;
}
craftsmen = craftsmen + 1;
craftsmantext.gotoAndPlay(2);
}
}
Symbol 142 MovieClip Frame 16
gotoAndPlay(random(12));
Symbol 143 Button
on (release) {
if (converts > 0) {
SFXtrain.gotoAndPlay(2);
converts = converts - 1;
var i = 1;
while (i < 4) {
eval ("convert" + i)._visible = 0;
i++;
}
var i = 1;
while (i <= converts) {
eval ("convert" + i)._visible = 1;
i++;
}
archers = archers + 1;
archertext.gotoAndPlay(2);
if (archers < 9) {
eval ("archer" + archers)._visible = 1;
}
}
}
Symbol 145 MovieClip Frame 1
stop();
Symbol 148 MovieClip Frame 1
stop();
Symbol 151 MovieClip Frame 1
stop();
Symbol 154 MovieClip Frame 1
stop();
Symbol 157 MovieClip Frame 1
stop();
Symbol 160 MovieClip Frame 59
gotoAndPlay(random(5) + 1);
Symbol 163 MovieClip Frame 59
gotoAndPlay(random(5) + 1);
Symbol 173 MovieClip Frame 7
stop();
Symbol 194 MovieClip Frame 1
_parent.ticks = _parent.ticks + 1;
var i = 0;
while (i < Math.min(int(_parent.ticks / _parent.stickrate) + 1, _parent.stickmax)) {
_parent.sticksA[i].move();
i++;
}
_parent.armorbar.gotoAndStop(101 - int((_parent.armor / _parent.armortotal) * 100));
_parent.armor = _parent.armor + _parent.craftsmen;
if (_parent.armor > _parent.armortotal) {
_parent.armor = _parent.armortotal;
}
var i = 1;
while (i <= _parent.archers) {
if (random(20) == 0) {
eval ("_parent.archer" + i).gotoAndPlay(10);
if (random(5) == 0) {
s = random(Math.min(int(_parent.ticks / 100) + 1, _parent.stickmax)) + 1;
if ((_parent.sticksA[s].mode == 0) || (_parent.sticksA[s].mode == 1)) {
_parent.sticksA[s].mode = 12;
}
}
}
i++;
}
if (_parent.ticks == _parent.convertticks) {
_parent.convertticks = -1;
_parent.beam._visible = 0;
_parent.converts = _parent.converts + 1;
_parent.converttext.play();
var i = 1;
while (i < 4) {
eval ("_parent.convert" + i)._visible = 0;
i++;
}
var i = 1;
while (i <= _parent.converts) {
eval ("_parent.convert" + i)._visible = 1;
i++;
}
}
if (_parent.armor <= 0) {
if (_parent.ticks2 == 0) {
var i = 0;
while (i < Math.min(int(_parent.ticks / 100), 15)) {
_parent.sticksA[i].mode = 10;
i++;
}
}
_parent.ticks2 = _parent.ticks2 + 1;
if (_parent.ticks2 > 100) {
_parent.gotoAndStop(50);
}
}
var i = 1;
while (i < 5) {
var x = eval ("_parent.cloud" + i)._x;
if (x < -60) {
eval ("_parent.cloud" + i)._x = 620;
eval ("_parent.cloud" + i)._y = random(100);
_parent.cloudvel[i] = (random(10) / 20) + 1;
if (i > 2) {
_parent.cloudvel[i] = _parent.cloudvel[i] / 2;
}
}
eval ("_parent.cloud" + i)._x = eval ("_parent.cloud" + i)._x - _parent.cloudvel[i];
i++;
}
Symbol 194 MovieClip Frame 2
var i = 0;
while (i < Math.min(int(_parent.ticks / _parent.stickrate) + 1, _parent.stickmax)) {
_parent.sticksA[i].move();
i++;
}
var i = 1;
while (i < 5) {
eval ("_parent.cloud" + i)._x = eval ("_parent.cloud" + i)._x - _parent.cloudvel[i];
i++;
}
if (_parent.ticks == _parent.stageticks) {
_parent.gotoAndPlay(24);
}
_parent.dispscore = _parent.score + _parent.totalscore;
_parent.dispkills = _parent.kills + _parent.totalkills;
Symbol 197 MovieClip Frame 1
stop();
Symbol 210 MovieClip Frame 1
var cscore = _root.score;
var ckillbonus = _root.killbonus;
var cspendable = _root.spendable;
var ctotalscore = _root.totalscore;
var upkeep;
var upkeep = (-(((_root.archers * 200) + (_root.wizards * 200)) + (_root.craftsmen * 50)));
while ((-upkeep) > cspendable) {
if ((_root.archers >= _root.craftsmen) && (_root.archers >= _root.wizards)) {
_root.archers--;
_root.sacarchers++;
} else if ((_root.craftsmen >= _root.wizards) && (_root.craftsmen >= _root.archers)) {
_root.craftsmen--;
_root.saccraftsmen++;
} else if ((_root.wizards >= _root.archers) && (_root.wizards >= _root.craftsmen)) {
_root.wizards--;
_root.sacwizards++;
}
upkeep = -(((_root.archers * 200) + (_root.wizards * 200)) + (_root.craftsmen * 200));
}
Symbol 210 MovieClip Frame 21
if (cscore > 0) {
cscore = cscore - 29;
cspendable = cspendable + 29;
ctotalscore = ctotalscore + 29;
if (cscore < 0) {
cspendable = cspendable + cscore;
ctotalscore = ctotalscore + cscore;
cscore = 0;
}
} else if (ckillbonus > 0) {
ckillbonus = ckillbonus - 29;
cspendable = cspendable + 29;
ctotalscore = ctotalscore + 29;
if (ckillbonus < 0) {
cspendable = cspendable + ckillbonus;
ctotalscore = ctotalscore + ckillbonus;
ckillbonus = 0;
}
} else if (upkeep < 0) {
upkeep = upkeep + 29;
cspendable = cspendable - 29;
if (upkeep > 0) {
cspendable = cspendable - upkeep;
upkeep = 0;
}
}
if (((cscore == 0) && (ckillbonus == 0)) && (upkeep == 0)) {
_root.spendable = cspendable;
_root.totalscore = _root.totalscore + (_root.score + _root.killbonus);
_root.score = 0;
_root.killbonus = 0;
_root.gotoAndStop(28);
} else {
gotoAndPlay (20);
}
Symbol 223 Button
on (release) {
gotoAndStop (30);
}
Symbol 237 Button
on (release) {
gotoAndStop (15);
}
Symbol 248 Button
on (release) {
if (spendable >= 100) {
spendable = spendable - 100;
armor = armor + 50;
if (armor > armortotal) {
armor = armortotal;
}
armorbar.gotoAndStop(101 - int((armor / armortotal) * 100));
}
}
Symbol 254 Button
on (release) {
if (spendable >= 500) {
spendable = spendable - 500;
armor = armor + 250;
if (armor > armortotal) {
armor = armortotal;
}
armorbar.gotoAndStop(101 - int((armor / armortotal) * 100));
}
}
Symbol 260 Button
on (release) {
if (spendable >= 2000) {
spendable = spendable - 2000;
armor = armor + 1000;
if (armor > armortotal) {
armor = armortotal;
}
armorbar.gotoAndStop(101 - int((armor / armortotal) * 100));
}
}
Symbol 266 Button
on (release) {
if (spendable >= 750) {
spendable = spendable - 750;
armortotal = armortotal + 100;
armor = armor + 100;
armorbar.gotoAndStop(101 - int((armor / armortotal) * 100));
}
}
Symbol 271 Button
on (release) {
if (spendable >= 5000) {
spendable = spendable - 5000;
temple = 1;
temple_._visible = 0;
temple__._visible = 1;
}
}
Symbol 276 Button
on (release) {
if (spendable >= 8000) {
spendable = spendable - 8000;
archeryrange = 1;
archery_._visible = 0;
archery__._visible = 1;
}
}