Frame 1
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
return(res);
}
var Game = new GameClass();
var NextBlob = new BlobClass();
var MusicOn = true;
var KeyListenerAdded = false;
var InFrame70 = false;
MenuMusic = new Sound(this);
MenuMusic.attachSound("MenuMusic1");
HelpMusic = new Sound(this);
HelpMusic.attachSound("HelpMusic1");
GameMusic = new Sound(this);
GameMusic.attachSound("GameMusic1");
__com_mochibot__("b6dd63de", this, 10301, true);
Frame 2
MochiAd.showPreGameAd({id:"242d55a264b796b5", res:"600x500"});
Frame 10
function StartGame(Diff) {
Game.Difficulty = Diff;
Game.Level = 0;
Game.Silver = 100;
Game.Score = 0;
Game.Lives = 100;
gotoAndPlay (70);
}
HelpMusic.stop();
GameMusic.stop();
if (MusicOn == true) {
MenuMusic.start(0, 99999);
} else {
MenuMusic.stop();
}
stop();
Frame 11
MenuMusic.stop();
if (MusicOn == true) {
HelpMusic.start(0, 99999);
} else {
HelpMusic.stop();
}
stop();
Frame 12
stop();
Frame 13
stop();
Frame 14
stop();
Frame 70
function AddTowerPoint(X, Y) {
TowerPlacesX.push(X);
TowerPlacesY.push(Y);
}
function AutoNextLevel() {
if ((Game.Blobs.length <= 0) && (Game.Level > 0)) {
NextLevel();
}
}
function PauseGame() {
if (Paused == false) {
Paused = true;
} else {
Paused = false;
}
}
function ChangeTarget(Orders) {
if (TowerSelected > -1) {
Game.Towers[TowerSelected].Target = Orders;
}
}
function SellTower() {
var _local3 = new TowerClass();
if (TowerSelected > -1) {
Game.Silver = Game.Silver + Math.round(Game.Towers[TowerSelected].PaidInto * 0.8);
if (TowerSelected == (Game.Towers.length - 1)) {
this["Tower" + TowerSelected].removeMovieClip();
_local3 = Game.Towers.pop();
} else {
this["Tower" + TowerSelected].removeMovieClip();
this["Tower" + (Game.Towers.length - 1)].duplicateMovieClip("Tower" + TowerSelected, _root.getNextHighestDepth(), this["Tower" + (Game.Towers.length - 1)]);
this["Tower" + (Game.Towers.length - 1)].removeMovieClip();
Game.Towers[TowerSelected] = Game.Towers.pop();
}
TowerSelected = -1;
this.SelTower1.removeMovieClip();
}
}
function UpgradeTower(Mode) {
if (TowerSelected > -1) {
if (Game.Silver >= Game.Towers[TowerSelected].UpgradeCost) {
if (Mode == "Damage") {
Game.Towers[TowerSelected].Damage = Game.Towers[TowerSelected].Damage * 2;
Game.Silver = Game.Silver - Game.Towers[TowerSelected].UpgradeCost;
Game.Towers[TowerSelected].PaidInto = Game.Towers[TowerSelected].PaidInto + Game.Towers[TowerSelected].UpgradeCost;
Game.Towers[TowerSelected].UpgradeCost = Game.Towers[TowerSelected].UpgradeCost * 2;
} else if (Mode == "Speed") {
if (Game.Towers[TowerSelected].Speed < 160) {
Game.Towers[TowerSelected].Speed = Game.Towers[TowerSelected].Speed * 2;
Game.Silver = Game.Silver - Game.Towers[TowerSelected].UpgradeCost;
Game.Towers[TowerSelected].PaidInto = Game.Towers[TowerSelected].PaidInto + Game.Towers[TowerSelected].UpgradeCost;
Game.Towers[TowerSelected].UpgradeCost = Game.Towers[TowerSelected].UpgradeCost * 2;
}
} else if (Mode == "Range") {
if (Game.Towers[TowerSelected].Range < 400) {
Game.Towers[TowerSelected].Range = Game.Towers[TowerSelected].Range * 2;
Game.Silver = Game.Silver - Game.Towers[TowerSelected].UpgradeCost;
Game.Towers[TowerSelected].PaidInto = Game.Towers[TowerSelected].PaidInto + Game.Towers[TowerSelected].UpgradeCost;
Game.Towers[TowerSelected].UpgradeCost = Game.Towers[TowerSelected].UpgradeCost * 2;
this.SelTower1._xscale = this.SelTower1._xscale * 2;
this.SelTower1._yscale = this.SelTower1._yscale * 2;
}
} else if (Mode == "Slow") {
if (Game.Towers[TowerSelected].Slow < 0.2) {
Game.Towers[TowerSelected].Slow = Game.Towers[TowerSelected].Slow + 0.04;
Game.Silver = Game.Silver - Game.Towers[TowerSelected].UpgradeCost;
Game.Towers[TowerSelected].PaidInto = Game.Towers[TowerSelected].PaidInto + Game.Towers[TowerSelected].UpgradeCost;
Game.Towers[TowerSelected].UpgradeCost = Game.Towers[TowerSelected].UpgradeCost * 1.5;
}
} else if (Mode == "Rotate") {
if (Game.Towers[TowerSelected].Rotation < 3) {
Game.Towers[TowerSelected].Rotation = Game.Towers[TowerSelected].Rotation + 1;
Game.Silver = Game.Silver - Game.Towers[TowerSelected].UpgradeCost;
Game.Towers[TowerSelected].PaidInto = Game.Towers[TowerSelected].PaidInto + Game.Towers[TowerSelected].UpgradeCost;
Game.Towers[TowerSelected].UpgradeCost = Game.Towers[TowerSelected].UpgradeCost * 1.5;
}
} else if (Mode == "Multifire") {
if (Game.Towers[TowerSelected].Multifire < 8) {
Game.Towers[TowerSelected].Multifire = Game.Towers[TowerSelected].Multifire * 2;
Game.Silver = Game.Silver - Game.Towers[TowerSelected].UpgradeCost;
Game.Towers[TowerSelected].PaidInto = Game.Towers[TowerSelected].PaidInto + Game.Towers[TowerSelected].UpgradeCost;
Game.Towers[TowerSelected].UpgradeCost = Game.Towers[TowerSelected].UpgradeCost * 2;
}
}
}
}
}
function ClearLines() {
var _local3 = 0;
var _local4 = new Object();
_local3 = Lines.length - 1;
while (_local3 >= 0) {
if (Lines[_local3] > 0) {
Lines[_local3] = Lines[_local3] - 1;
} else if (_local3 == (Lines.length - 1)) {
this["Line" + _local3].removeMovieClip();
_local4 = Lines.pop();
} else {
this["Line" + _local3].removeMovieClip();
this["Line" + (Lines.length - 1)].duplicateMovieClip("Line" + _local3, _root.getNextHighestDepth(), this["Line" + (Lines.length - 1)]);
this["Line" + (Lines.length - 1)].removeMovieClip();
Lines[_local3] = Lines.pop();
}
_local3--;
}
}
function BuildTowerMode() {
if (BuildingTower == false) {
BuildingTower = true;
} else if (BuildingTower == true) {
BuildingTower = false;
this.TowerPrev.removeMovieClip();
}
}
function FireTowers() {
var _local1 = 0;
_local1 = 0;
while (_local1 <= (Game.Towers.length - 1)) {
Game.Towers[_local1].FireTick = Game.Towers[_local1].FireTick + Game.Towers[_local1].Speed;
if (Game.Towers[_local1].FireTick >= 1500) {
FireTower(_local1);
Game.Towers[_local1].FireTick = 0;
}
_local1++;
}
}
function FireTower(index) {
var _local2 = 0;
var _local4 = new Array();
_local4 = FindTargets(Game.Towers[index]);
_local2 = 0;
while (_local2 <= (_local4.length - 1)) {
FireTowerAtTarget(index, _local4[_local2]);
_local2++;
}
if (Game.Towers[index].Rotation > 0) {
if (Game.Towers[index].Rotation > 0) {
Game.Towers[index].R = random(255);
}
if (Game.Towers[index].Rotation > 1) {
Game.Towers[index].G = random(255);
}
if (Game.Towers[index].Rotation > 2) {
Game.Towers[index].B = random(255);
}
TColor = new Color(this["Tower" + index]);
TempColor.rb = Game.Towers[index].R;
TempColor.gb = Game.Towers[index].G;
TempColor.bb = Game.Towers[index].B;
TColor.setTransform(TempColor);
}
}
function FireTowerAtTarget(index, Target) {
var _local5 = 0;
var _local9 = 0;
var _local10 = 0;
var _local11 = 5;
var _local3 = new BlobClass();
this["Tower" + index]._rotation = DetermineRotation(Game.Blobs[Target].x - ((((Game.Towers[index].X - 1) * 20) + XYOffset) + 10), Game.Blobs[Target].y - ((((Game.Towers[index].Y - 1) * 20) + XYOffset) + 10));
_local10 = NextLineIndex();
this.createEmptyMovieClip("Line" + _local10, _root.getNextHighestDepth());
if ((Game.Towers[index].Damage >= 10) && (Game.Towers[index].Damage <= 40)) {
_local5 = 1;
_local11 = 5;
} else if ((Game.Towers[index].Damage >= 80) && (Game.Towers[index].Damage <= 320)) {
_local5 = 2;
_local11 = 4;
} else if ((Game.Towers[index].Damage >= 640) && (Game.Towers[index].Damage <= 2560)) {
_local5 = 3;
_local11 = 4;
} else if ((Game.Towers[index].Damage >= 5120) && (Game.Towers[index].Damage <= 20480)) {
_local5 = 4;
_local11 = 3;
} else {
_local5 = 5;
_local11 = 3;
}
this["Line" + _local10].lineStyle(_local5, (("0x" + DecToHex(Game.Towers[index].R)) + DecToHex(Game.Towers[index].G)) + DecToHex(Game.Towers[index].B), 100);
this["Line" + _local10].moveTo((((Game.Towers[index].X - 1) * 20) + XYOffset) + 10, (((Game.Towers[index].Y - 1) * 20) + XYOffset) + 10);
this["Line" + _local10].lineTo(Game.Blobs[Target].x, Game.Blobs[Target].y);
this["Line" + _local10].x = 0;
this["Line" + _local10].y = 0;
Lines.push(_local11);
Damage = Game.Towers[index].Damage * ((0.5 - RGBDiffPercent(Game.Towers[index], Game.Blobs[Target])) * 8);
Game.Blobs[Target].HP = Game.Blobs[Target].HP - Damage;
if (Game.Towers[index].Slow > 0) {
Game.Blobs[Target].SpeedRedux = Game.Blobs[Target].SpeedRedux + (Game.Towers[index].Slow * ((0.5 - RGBDiffPercent(Game.Towers[index], Game.Blobs[Target])) * 8));
if (Game.Blobs[Target].SpeedRedux > 0.9) {
Game.Blobs[Target].SpeedRedux = 0.9;
}
}
if (Game.Difficulty == "Survival") {
_local9 = 3;
} else if (Game.Difficulty == "Challenge") {
_local9 = 2;
} else {
_local9 = 1;
}
if (Game.Blobs[Target].HP <= 0) {
if ((Game.Blobs[Target].Boss == true) && (Game.Blobs[Target].Scale == 250)) {
if (Game.Difficulty == "Survival") {
Game.Silver = Game.Silver + (Game.Blobs[Target].Level * 10);
} else {
Game.Silver = Game.Silver + (Game.Blobs[Target].Level * 15);
if (Game.Difficulty == "Sandbox") {
Game.Silver = Game.Silver + (Game.Blobs[Target].Level * 15);
}
}
Game.Score = Game.Score + 1;
} else if ((Game.Blobs[Target].Boss == false) && (Game.Blobs[Target].Scale == 150)) {
Game.Silver = Game.Silver + Game.Blobs[Target].Level;
if (Game.Difficulty == "Sandbox") {
Game.Silver = Game.Silver + Game.Blobs[Target].Level;
}
Game.Score = Game.Score + 1;
} else {
Game.Silver = Game.Silver + 0.5;
if (Game.Difficulty == "Sandbox") {
Game.Silver = Game.Silver + 0.5;
}
Game.Score = Game.Score + 1;
}
if (Game.Blobs[Target].HPMax >= 40) {
_local5 = 1;
while (_local5 <= _local9) {
_local3 = new BlobClass();
CopyBlobClassValues(Game.Blobs[Target], _local3);
if (Game.Difficulty == "Survival") {
_local3.HPMax = Math.round(_local3.HPMax / 5);
} else {
_local3.HPMax = Math.round(_local3.HPMax / 2);
}
_local3.HP = _local3.HPMax;
_local3.Backwards = random(40) + 40;
_local3.Scale = Math.round(_local3.Scale * 0.95);
if (_local3.Scale <= 10) {
_local3.Scale = 10;
}
if (_local3.Multicolored == true) {
if (Game.Difficulty == "Deep Blue") {
_local3.R = 0;
_local3.G = random(125);
_local3.B = random(125) + 130;
} else {
_local3.R = random(255);
_local3.G = random(255);
_local3.B = random(255);
}
}
Game.Blobs.push(new BlobClass());
Game.Blobs[Game.Blobs.length - 1] = _local3;
CopyBlobClassValues(_local3, Game.Blobs[Game.Blobs.length - 1]);
attachMovie("Blob", "Blob" + (Game.Blobs.length - 1), _root.getNextHighestDepth(), {_x:_local3.x, _y:_local3.y});
this["Blob" + (Game.Blobs.length - 1)]._xscale = _local3.Scale;
this["Blob" + (Game.Blobs.length - 1)]._yscale = _local3.Scale;
TColor = new Color(this["Blob" + (Game.Blobs.length - 1)]);
TempColor.rb = _local3.R;
TempColor.gb = _local3.G;
TempColor.bb = _local3.B;
TColor.setTransform(TempColor);
_local5++;
}
}
if (Target == (Game.Blobs.length - 1)) {
this["Blob" + Target].removeMovieClip();
_local3 = Game.Blobs.pop();
} else {
this["Blob" + Target].removeMovieClip();
this["Blob" + (Game.Blobs.length - 1)].duplicateMovieClip("Blob" + Target, _root.getNextHighestDepth(), this["Blob" + (Game.Blobs.length - 1)]);
this["Blob" + (Game.Blobs.length - 1)].removeMovieClip();
Game.Blobs[Target] = Game.Blobs.pop();
}
}
}
function DecToHex(r) {
r = r.toString(16);
r = ((r.length < 2) ? ("0" + r) : (r));
return(r.toUpperCase());
}
function NextLineIndex() {
return(Lines.length);
}
function DetermineRotation(tX, tY) {
var _local1 = 0;
_local1 = (Math.atan2(tY, tX) * 180) / Math.PI;
_local1 = _local1 + 90;
return(_local1);
}
function FindTargets(Tower) {
var _local1 = 0;
var _local8 = 0;
var _local7 = new Array();
var _local3 = 0;
var _local4 = -1;
var _local5 = 99999 /* 0x01869F */;
var _local6 = -1;
_local8 = 1;
while (_local8 <= Tower.Multifire) {
_local4 = -1;
_local3 = 0;
_local6 = -1;
_local5 = 99999 /* 0x01869F */;
_local1 = 0;
while (_local1 <= (Game.Blobs.length - 1)) {
if ((((BlobWithinRange(Tower, Game.Blobs[_local1]) == true) && (BlobWithinColorRange(Tower, Game.Blobs[_local1]) == true)) && (InTargets(_local1, _local7) == false)) && (BlobInBox(Game.Blobs[_local1]) == true)) {
if (Tower.Target == "Distance") {
if (Game.Blobs[_local1].Distance >= _local3) {
_local3 = Game.Blobs[_local1].Distance;
_local4 = _local1;
}
} else if (Tower.Target == "Healthy") {
if (Game.Blobs[_local1].HP >= _local3) {
_local3 = Game.Blobs[_local1].HP;
_local4 = _local1;
}
} else if (Tower.Target == "Speed") {
if ((Game.Blobs[_local1].Speed * (1 - Game.Blobs[_local1].SpeedRedux)) >= _local3) {
_local3 = Game.Blobs[_local1].Speed * (1 - Game.Blobs[_local1].SpeedRedux);
_local4 = _local1;
}
} else if (Tower.Target == "Weak") {
if (Game.Blobs[_local1].HP <= _local5) {
_local5 = Game.Blobs[_local1].HP;
_local6 = _local1;
}
} else if (Tower.Target == "Spectrum") {
if (RGBDiff(Tower, Game.Blobs[_local1]) <= _local5) {
_local5 = RGBDiff(Tower, Game.Blobs[_local1]);
_local6 = _local1;
}
}
}
_local1++;
}
if (((Tower.Target == "Distance") || (Tower.Target == "Healthy")) || (Tower.Target == "Speed")) {
if (_local4 > -1) {
_local7.push(_local4);
}
} else if ((Tower.Target == "Weak") || (Tower.Target == "Spectrum")) {
if (_local6 > -1) {
_local7.push(_local6);
}
}
_local8++;
}
return(_local7);
}
function BlobInBox(TBlob) {
if ((TBlob.x > XYOffset) && (TBlob.y > XYOffset)) {
if ((TBlob.x < (400 + XYOffset)) && (TBlob.y < (400 + XYOffset))) {
return(true);
}
}
if ((TBlob.x == 0) && (TBlob.y == 0)) {
return(true);
}
return(false);
}
function RGBDiff(Tower, Blob) {
return((Math.abs(Tower.R - Blob.R) + Math.abs(Tower.G - Blob.G)) + Math.abs(Tower.B - Blob.B));
}
function RGBDiffPercent(Tower, Blob) {
return(((Math.abs(Tower.R - Blob.R) + Math.abs(Tower.G - Blob.G)) + Math.abs(Tower.B - Blob.B)) / 765);
}
function BlobWithinRange(Tower, Blob) {
var _local1 = 0;
_local1 = _local1 + Math.abs(((((Tower.X - 1) * 20) + XYOffset) + 10) - Blob.x);
_local1 = _local1 + Math.abs(((((Tower.Y - 1) * 20) + XYOffset) + 10) - Blob.y);
if (_local1 > Tower.Range) {
return(false);
}
return(true);
}
function BlobWithinColorRange(Tower, Blob) {
var _local1 = 0;
_local1 = _local1 + Math.abs(Tower.R - Blob.R);
_local1 = _local1 + Math.abs(Tower.G - Blob.G);
_local1 = _local1 + Math.abs(Tower.B - Blob.B);
if (_local1 >= 350) {
return(false);
}
return(true);
}
function InTargets(Target, Targets) {
var _local1 = 0;
_local1 = 0;
while (_local1 <= (Targets.length - 1)) {
if (Targets[_local1] == Target) {
return(true);
}
_local1++;
}
return(false);
}
function CheckMouse() {
var _local4 = 0;
var _local3 = 0;
if (BuildingTower == true) {
if ((((_root._xmouse > XYOffset) && (_root._ymouse > XYOffset)) && (_root._xmouse < (400 + XYOffset))) && (_root._ymouse < (400 + XYOffset))) {
_local4 = Math.round(((_root._xmouse - XYOffset) + 10) / 20);
_local3 = Math.round(((_root._ymouse - XYOffset) + 10) / 20);
if ((LastMouseX != _local4) || (LastMouseY != _local3)) {
LastMouseX = _local4;
LastMouseY = _local3;
this.TowerPrev.removeMovieClip();
if ((CanBuildHere(_local4, _local3) == false) || (TowerAlreadyPlaced(_local4, _local3) == true)) {
this.TowerPrev.removeMovieClip();
} else {
attachMovie("Tower", "TowerPrev", _root.getNextHighestDepth(), {_x:(((_local4 - 1) * 20) + XYOffset) + 10, _y:(((_local3 - 1) * 20) + XYOffset) + 10});
}
}
}
}
}
function MouseClick(X, Y) {
var _local3 = 0;
var _local6 = 0;
var _local5 = 0;
var _local4 = 0;
if (BuildingTower == true) {
_local5 = Math.round(((_root._xmouse - XYOffset) + 10) / 20);
_local4 = Math.round(((_root._ymouse - XYOffset) + 10) / 20);
if (((CanBuildHere(_local5, _local4) == true) && (TowerAlreadyPlaced(_local5, _local4) == false)) && (Game.Silver >= 10)) {
Game.Towers.push(new TowerClass());
Game.Towers[Game.Towers.length - 1].Target = "Distance";
Game.Towers[Game.Towers.length - 1].R = BuildR;
Game.Towers[Game.Towers.length - 1].G = BuildG;
Game.Towers[Game.Towers.length - 1].B = BuildB;
Game.Towers[Game.Towers.length - 1].X = _local5;
Game.Towers[Game.Towers.length - 1].Y = _local4;
attachMovie("Tower", "Tower" + (Game.Towers.length - 1), _root.getNextHighestDepth(), {_x:(((_local5 - 1) * 20) + XYOffset) + 10, _y:(((_local4 - 1) * 20) + XYOffset) + 10});
TColor = new Color(this["Tower" + (Game.Towers.length - 1)]);
TempColor.rb = BuildR;
TempColor.gb = BuildG;
TempColor.bb = BuildB;
TColor.setTransform(TempColor);
Game.Silver = Game.Silver - 6;
BuildingTower = false;
this.TowerPrev.removeMovieClip();
}
} else {
_local5 = Math.round(((_root._xmouse - XYOffset) + 10) / 20);
_local4 = Math.round(((_root._ymouse - XYOffset) + 10) / 20);
if ((CanBuildHere(_local5, _local4) == true) && (TowerAlreadyPlaced(_local5, _local4) == true)) {
_local6 = -1;
_local3 = 0;
while (_local3 <= (Game.Towers.length - 1)) {
if ((Game.Towers[_local3].X == _local5) && (Game.Towers[_local3].Y == _local4)) {
_local6 = _local3;
break;
}
_local3++;
}
if (_local6 > -1) {
TowerSelected = _local6;
this.SelTower1.removeMovieClip();
attachMovie("SelTower", "SelTower1", _root.getNextHighestDepth(), {_x:(((_local5 - 1) * 20) + XYOffset) + 10, _y:(((_local4 - 1) * 20) + XYOffset) + 10});
this.SelTower1._alpha = 25;
this.SelTower1._xscale = Game.Towers[TowerSelected].Range * 1.65;
this.SelTower1._yscale = Game.Towers[TowerSelected].Range * 1.65;
}
} else if (TowerSelected > -1) {
TowerSelected = -1;
this.SelTower1.removeMovieClip();
}
}
}
function CanBuildHere(X, Y) {
var _local1 = 0;
_local1 = 0;
while (_local1 <= (TowerPlacesX.length - 1)) {
if ((TowerPlacesX[_local1] == X) && (TowerPlacesY[_local1] == Y)) {
return(true);
}
_local1++;
}
return(false);
}
function TowerAlreadyPlaced(X, Y) {
var _local1 = 0;
_local1 = 0;
while (_local1 <= (Game.Towers.length - 1)) {
if ((Game.Towers[_local1].X == X) && (Game.Towers[_local1].Y == Y)) {
return(true);
}
_local1++;
}
return(false);
}
function ShowScore() {
YourSilver.text = Math.round(Game.Silver);
YourSilver.setTextFormat(FMT1);
YourScore.text = Math.round(Game.Score);
YourScore.setTextFormat(FMT1);
CurrentLevel.text = Math.round(Game.Level);
CurrentLevel.setTextFormat(FMT2);
LivesLeft.text = Math.round(Game.Lives);
LivesLeft.setTextFormat(FMT2);
if (TowerSelected > -1) {
CurrentOrder.text = Game.Towers[TowerSelected].Target;
CurrentOrder.setTextFormat(FMT1);
UpgradeCost.text = Game.Towers[TowerSelected].UpgradeCost;
UpgradeCost.setTextFormat(FMT1);
CurrentDamage.text = Game.Towers[TowerSelected].Damage;
CurrentDamage.setTextFormat(FMT2);
CurrentSpeed.text = Game.Towers[TowerSelected].Speed;
CurrentSpeed.setTextFormat(FMT2);
CurrentRange.text = Game.Towers[TowerSelected].Range;
CurrentRange.setTextFormat(FMT2);
CurrentSlow.text = Game.Towers[TowerSelected].Slow;
CurrentSlow.setTextFormat(FMT2);
CurrentRotate.text = Game.Towers[TowerSelected].Rotation;
CurrentRotate.setTextFormat(FMT2);
CurrentMultifire.text = Game.Towers[TowerSelected].Multifire;
CurrentMultifire.setTextFormat(FMT2);
FMT1.color = 0;
PaidInto.text = Math.round(Game.Towers[TowerSelected].PaidInto * 0.8);
PaidInto.setTextFormat(FMT1);
FMT1.color = 16776960 /* 0xFFFF00 */;
} else {
CurrentOrder.text = "";
UpgradeCost.text = "";
CurrentDamage.text = "";
CurrentSpeed.text = "";
CurrentRange.text = "";
CurrentSlow.text = "";
CurrentRotate.text = "";
CurrentMultifire.text = "";
PaidInto.text = "";
}
}
function AdjustTowerColor(Mode) {
if (Mode == "Init") {
BuildR = 125;
BuildG = 125;
BuildB = 125;
}
if (Mode == "R+") {
if ((BuildR + 25) > 255) {
BuildR = 255;
} else {
BuildR = BuildR + 25;
}
}
if (Mode == "G+") {
if ((BuildG + 25) > 255) {
BuildG = 255;
} else {
BuildG = BuildG + 25;
}
}
if (Mode == "B+") {
if ((BuildB + 25) > 255) {
BuildB = 255;
} else {
BuildB = BuildB + 25;
}
}
if (Mode == "R-") {
if ((BuildR - 25) < 0) {
BuildR = 0;
} else {
BuildR = BuildR - 25;
}
}
if (Mode == "G-") {
if ((BuildG - 25) < 0) {
BuildG = 0;
} else {
BuildG = BuildG - 25;
}
}
if (Mode == "B-") {
if ((BuildB - 25) < 0) {
BuildB = 0;
} else {
BuildB = BuildB - 25;
}
}
TColor = new Color(this.RGBPrevBox);
TempColor.rb = BuildR;
TempColor.gb = BuildG;
TempColor.bb = BuildB;
TColor.setTransform(TempColor);
}
function MoveBlobs() {
var _local3 = 0;
var _local4 = new BlobClass();
_local3 = 0;
while (_local3 <= (Game.Blobs.length - 1)) {
if (Game.Blobs[_local3].Backwards > 0) {
if (Game.Blobs[_local3].Backwards > 60) {
Game.Blobs[_local3].x = Game.Blobs[_local3].x - Game.Blobs[_local3].Mx;
Game.Blobs[_local3].y = Game.Blobs[_local3].y - Game.Blobs[_local3].My;
Game.Blobs[_local3].x = Game.Blobs[_local3].x - Game.Blobs[_local3].Mx;
Game.Blobs[_local3].y = Game.Blobs[_local3].y - Game.Blobs[_local3].My;
Game.Blobs[_local3].x = Game.Blobs[_local3].x - Game.Blobs[_local3].Mx;
Game.Blobs[_local3].y = Game.Blobs[_local3].y - Game.Blobs[_local3].My;
Game.Blobs[_local3].Distance = Game.Blobs[_local3].Distance - Game.Blobs[_local3].Speed;
Game.Blobs[_local3].Distance = Game.Blobs[_local3].Distance - Game.Blobs[_local3].Speed;
Game.Blobs[_local3].Distance = Game.Blobs[_local3].Distance - Game.Blobs[_local3].Speed;
} else if (Game.Blobs[_local3].Backwards > 30) {
Game.Blobs[_local3].x = Game.Blobs[_local3].x - Game.Blobs[_local3].Mx;
Game.Blobs[_local3].y = Game.Blobs[_local3].y - Game.Blobs[_local3].My;
Game.Blobs[_local3].x = Game.Blobs[_local3].x - Game.Blobs[_local3].Mx;
Game.Blobs[_local3].y = Game.Blobs[_local3].y - Game.Blobs[_local3].My;
Game.Blobs[_local3].Distance = Game.Blobs[_local3].Distance - Game.Blobs[_local3].Speed;
Game.Blobs[_local3].Distance = Game.Blobs[_local3].Distance - Game.Blobs[_local3].Speed;
} else if (Game.Blobs[_local3].Backwards > 10) {
Game.Blobs[_local3].x = Game.Blobs[_local3].x - Game.Blobs[_local3].Mx;
Game.Blobs[_local3].y = Game.Blobs[_local3].y - Game.Blobs[_local3].My;
Game.Blobs[_local3].Distance = Game.Blobs[_local3].Distance - Game.Blobs[_local3].Speed;
} else {
Game.Blobs[_local3].x = Game.Blobs[_local3].x - (Game.Blobs[_local3].Mx / 2);
Game.Blobs[_local3].y = Game.Blobs[_local3].y - (Game.Blobs[_local3].My / 2);
Game.Blobs[_local3].Distance = Game.Blobs[_local3].Distance - (Game.Blobs[_local3].Speed / 2);
}
Game.Blobs[_local3].Backwards = Game.Blobs[_local3].Backwards - 1;
} else {
Game.Blobs[_local3].x = Game.Blobs[_local3].x + (Game.Blobs[_local3].Mx * (1 - Game.Blobs[_local3].SpeedRedux));
Game.Blobs[_local3].y = Game.Blobs[_local3].y + (Game.Blobs[_local3].My * (1 - Game.Blobs[_local3].SpeedRedux));
Game.Blobs[_local3].Distance = Game.Blobs[_local3].Distance + (Game.Blobs[_local3].Speed * (1 - Game.Blobs[_local3].SpeedRedux));
if ((Game.Blobs[_local3].SpeedRedux > 0) && (Game.Blobs[_local3].Fast == true)) {
Game.Blobs[_local3].SpeedRedux = Game.Blobs[_local3].SpeedRedux - 0.02;
}
if ((Game.Blobs[_local3].SpeedRedux > 0) && (Game.Blobs[_local3].Fast == false)) {
Game.Blobs[_local3].SpeedRedux = Game.Blobs[_local3].SpeedRedux - 0.01;
}
if (Game.Blobs[_local3].SpeedRedux < 0) {
Game.Blobs[_local3].SpeedRedux = 0;
}
}
this["Blob" + _local3]._x = Math.round(Game.Blobs[_local3].x);
this["Blob" + _local3]._y = Math.round(Game.Blobs[_local3].y);
if ((Game.Blobs[_local3].Morphous == true) && (random(10) == 1)) {
if (Game.Difficulty == "Deep Blue") {
Game.Blobs[_local3].R = 0;
Game.Blobs[_local3].G = random(125);
Game.Blobs[_local3].B = random(125) + 130;
} else {
Game.Blobs[_local3].R = random(255);
Game.Blobs[_local3].G = random(255);
Game.Blobs[_local3].B = random(255);
}
TColor = new Color(this["Blob" + _local3]);
TempColor.rb = Game.Blobs[_local3].R;
TempColor.gb = Game.Blobs[_local3].G;
TempColor.bb = Game.Blobs[_local3].B;
TColor.setTransform(TempColor);
}
if ((Math.round(Game.Blobs[_local3].y) == 15) && (Math.round(Game.Blobs[_local3].x) == 395)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed;
} else if ((Math.round(Game.Blobs[_local3].y) == 55) && (Math.round(Game.Blobs[_local3].x) == 395)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed * -1;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 55) && (Math.round(Game.Blobs[_local3].x) == 15)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed;
} else if ((Math.round(Game.Blobs[_local3].y) == 95) && (Math.round(Game.Blobs[_local3].x) == 15)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 95) && (Math.round(Game.Blobs[_local3].x) == 395)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed;
} else if ((Math.round(Game.Blobs[_local3].y) == 135) && (Math.round(Game.Blobs[_local3].x) == 395)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed * -1;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 135) && (Math.round(Game.Blobs[_local3].x) == 295)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed;
} else if ((Math.round(Game.Blobs[_local3].y) == 175) && (Math.round(Game.Blobs[_local3].x) == 295)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 175) && (Math.round(Game.Blobs[_local3].x) == 395)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed;
} else if ((Math.round(Game.Blobs[_local3].y) == 215) && (Math.round(Game.Blobs[_local3].x) == 395)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed * -1;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 215) && (Math.round(Game.Blobs[_local3].x) == 295)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed;
} else if ((Math.round(Game.Blobs[_local3].y) == 255) && (Math.round(Game.Blobs[_local3].x) == 295)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 255) && (Math.round(Game.Blobs[_local3].x) == 395)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed;
} else if ((Math.round(Game.Blobs[_local3].y) == 295) && (Math.round(Game.Blobs[_local3].x) == 395)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed * -1;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 295) && (Math.round(Game.Blobs[_local3].x) == 295)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed;
} else if ((Math.round(Game.Blobs[_local3].y) == 335) && (Math.round(Game.Blobs[_local3].x) == 295)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 335) && (Math.round(Game.Blobs[_local3].x) == 395)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed;
} else if ((Math.round(Game.Blobs[_local3].y) == 395) && (Math.round(Game.Blobs[_local3].x) == 395)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed * -1;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 395) && (Math.round(Game.Blobs[_local3].x) == 235)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed * -1;
} else if ((Math.round(Game.Blobs[_local3].y) == 135) && (Math.round(Game.Blobs[_local3].x) == 235)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed * -1;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 135) && (Math.round(Game.Blobs[_local3].x) == 15)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed;
} else if ((Math.round(Game.Blobs[_local3].y) == 395) && (Math.round(Game.Blobs[_local3].x) == 15)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 395) && (Math.round(Game.Blobs[_local3].x) == 195)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed * -1;
} else if ((Math.round(Game.Blobs[_local3].y) == 175) && (Math.round(Game.Blobs[_local3].x) == 195)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed * -1;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 175) && (Math.round(Game.Blobs[_local3].x) == 55)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed;
} else if ((Math.round(Game.Blobs[_local3].y) == 355) && (Math.round(Game.Blobs[_local3].x) == 55)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 355) && (Math.round(Game.Blobs[_local3].x) == 155)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed * -1;
} else if ((Math.round(Game.Blobs[_local3].y) == 215) && (Math.round(Game.Blobs[_local3].x) == 155)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed * -1;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 215) && (Math.round(Game.Blobs[_local3].x) == 95)) {
Game.Blobs[_local3].Mx = 0;
Game.Blobs[_local3].My = Game.Blobs[_local3].Speed;
} else if ((Math.round(Game.Blobs[_local3].y) == 315) && (Math.round(Game.Blobs[_local3].x) == 95)) {
Game.Blobs[_local3].Mx = Game.Blobs[_local3].Speed;
Game.Blobs[_local3].My = 0;
} else if ((Math.round(Game.Blobs[_local3].y) == 315) && (Math.round(Game.Blobs[_local3].x) == 115)) {
Game.Lives = Game.Lives - 1;
if (_local3 == (Game.Blobs.length - 1)) {
this["Blob" + _local3].removeMovieClip();
_local4 = Game.Blobs.pop();
} else {
this["Blob" + _local3].removeMovieClip();
this["Blob" + (Game.Blobs.length - 1)].duplicateMovieClip("Blob" + _local3, _root.getNextHighestDepth(), this["Blob" + (Game.Blobs.length - 1)]);
this["Blob" + (Game.Blobs.length - 1)].removeMovieClip();
Game.Blobs[_local3] = Game.Blobs.pop();
}
if (Game.Lives <= 0) {
EndGame();
}
}
_local3++;
}
}
function EndGame() {
DestroyGame();
gotoAndPlay (71);
}
function DestroyGame() {
var _local5 = 0;
var _local2 = new Object();
var _local3 = new TowerClass();
var _local4 = new BlobClass();
while (Game.Towers.length > 0) {
this["Tower" + (Game.Towers.length - 1)].removeMovieClip();
_local3 = Game.Towers.pop();
}
while (Game.Blobs.length > 0) {
this["Blob" + (Game.Blobs.length - 1)].removeMovieClip();
_local4 = Game.Blobs.pop();
}
while (Lines.length > 0) {
this["Line" + (Lines.length - 1)].removeMovieClip();
_local2 = Lines.pop();
}
YourSilver.removeTextField();
YourScore.removeTextField();
LivesLeft.removeTextField();
CurrentLevel.removeTextField();
NextMorphous.removeTextField();
NextHP.removeTextField();
NextMulticolored.removeTextField();
NextBoss.removeTextField();
NextFast.removeTextField();
UpgradeCost.removeTextField();
CurrentOrder.removeTextField();
CurrentDamage.removeTextField();
CurrentSpeed.removeTextField();
CurrentRange.removeTextField();
CurrentSlow.removeTextField();
CurrentRotate.removeTextField();
CurrentMultifire.removeTextField();
PaidInto.removeTextField();
this.RGBPrevBox.removeMovieClip();
this.SelTower1.removeMovieClip();
clearInterval(timer);
Key.removeListener(GetKeyTap);
InFrame70 = false;
}
function NextLevel() {
var _local4 = 0;
var _local3 = new BlobClass();
if (NextBlob.Boss == true) {
_local3 = new BlobClass();
CopyBlobClassValues(NextBlob, _local3);
_local3.Speed = (random(10) / 100) + 0.3;
if (_local3.Fast == true) {
_local3.Speed = _local3.Speed * 2;
}
_local3.x = -30;
_local3.y = 15;
_local3.Distance = _local3.x;
_local3.Mx = _local3.Speed;
_local3.My = 0;
_local3.Scale = 250;
Game.Blobs.push(_local3);
attachMovie("Blob", "Blob" + (Game.Blobs.length - 1), _root.getNextHighestDepth(), {_x:_local3.x, _y:_local3.y});
this["Blob" + (Game.Blobs.length - 1)]._xscale = 250;
this["Blob" + (Game.Blobs.length - 1)]._yscale = 250;
TColor = new Color(this["Blob" + (Game.Blobs.length - 1)]);
TempColor.rb = _local3.R;
TempColor.gb = _local3.G;
TempColor.bb = _local3.B;
TColor.setTransform(TempColor);
} else {
_local4 = 1;
while (_local4 <= 10) {
_local3 = new BlobClass();
CopyBlobClassValues(NextBlob, _local3);
_local3.Speed = (random(10) / 100) + 0.3;
if (_local3.Fast == true) {
_local3.Speed = _local3.Speed * 2;
}
if (_local3.Multicolored == true) {
if (Game.Difficulty == "Deep Blue") {
_local3.R = 0;
_local3.G = random(125);
_local3.B = random(125) + 130;
} else {
_local3.R = random(255);
_local3.G = random(255);
_local3.B = random(255);
}
}
_local3.x = _local4 * -20;
_local3.y = 15;
_local3.Distance = _local3.x;
_local3.Mx = _local3.Speed;
_local3.My = 0;
_local3.Scale = 150;
Game.Blobs.push(new BlobClass());
Game.Blobs[Game.Blobs.length - 1] = _local3;
attachMovie("Blob", "Blob" + (Game.Blobs.length - 1), _root.getNextHighestDepth(), {_x:_local3.x, _y:_local3.y});
this["Blob" + (Game.Blobs.length - 1)]._xscale = 150;
this["Blob" + (Game.Blobs.length - 1)]._yscale = 150;
TColor = new Color(this["Blob" + (Game.Blobs.length - 1)]);
TempColor.rb = _local3.R;
TempColor.gb = _local3.G;
TempColor.bb = _local3.B;
TColor.setTransform(TempColor);
_local4++;
}
}
Interest();
Game.Level = Game.Level + 1;
InitNextLevel();
}
function Interest() {
if (Game.Difficulty == "Easy") {
Game.Silver = Math.round(Game.Silver * 1.1);
} else {
Game.Silver = Math.round(Game.Silver * 1.05);
}
}
function CopyBlobClassValues(TBlob, DBlob) {
DBlob.HPMax = TBlob.HPMax;
DBlob.HP = TBlob.HP;
DBlob.Level = TBlob.Level;
DBlob.Morphous = TBlob.Morphous;
DBlob.Multicolored = TBlob.Multicolored;
DBlob.Fast = TBlob.Fast;
DBlob.Boss = TBlob.Boss;
DBlob.Speed = TBlob.Speed;
DBlob.x = TBlob.x;
DBlob.y = TBlob.y;
DBlob.Mx = TBlob.Mx;
DBlob.My = TBlob.My;
DBlob.R = TBlob.R;
DBlob.G = TBlob.G;
DBlob.B = TBlob.B;
DBlob.Backwards = TBlob.Backwards;
DBlob.Distance = TBlob.Distance;
DBlob.Scale = TBlob.Scale;
}
function InitNextLevel() {
NextBlob.HPMax = FigureBlobStartingHP(Game.Level + 1);
NextBlob.HP = NextBlob.HPMax;
NextBlob.Level = Game.Level + 1;
if (((Game.Level + 1) % 7) == 0) {
NextBlob.Fast = true;
} else {
NextBlob.Fast = false;
}
if (Game.Difficulty == "Survival") {
NextBlob.Boss = true;
NextBlob.HPMax = NextBlob.HPMax * 10;
NextBlob.HP = NextBlob.HP * 10;
} else if (((Game.Level + 1) % 10) == 0) {
NextBlob.Boss = true;
NextBlob.HPMax = NextBlob.HPMax * 15;
NextBlob.HP = NextBlob.HP * 15;
} else {
NextBlob.Boss = false;
}
if (((Game.Level + 1) % 5) == 0) {
NextBlob.Multicolored = true;
} else {
NextBlob.Multicolored = false;
}
if (random(100) <= 5) {
NextBlob.Morphous = true;
} else {
NextBlob.Morphous = false;
}
NextBlob.R = random(255);
NextBlob.G = random(255);
NextBlob.B = random(255);
if (Game.Difficulty == "Deep Blue") {
NextBlob.R = 0;
NextBlob.G = random(125);
NextBlob.B = random(125) + 130;
}
NextHP.text = Math.round(NextBlob.HP);
NextHP.setTextFormat(FMT1);
FMT1.size = 14;
FMT2.size = 16;
if (NextBlob.Fast == true) {
NextFast.text = "Fast";
NextFast.setTextFormat(FMT1);
} else {
NextFast.text = "";
}
if (NextBlob.Boss == true) {
NextBoss.text = "Boss";
NextBoss.setTextFormat(FMT2);
} else {
NextBoss.text = "";
}
if (NextBlob.Morphous == true) {
NextMorphous.text = "Morphous";
NextMorphous.setTextFormat(FMT1);
} else {
NextMorphous.text = "";
}
if (NextBlob.Multicolored == true) {
NextMulticolored.text = "Multicolored";
NextMulticolored.setTextFormat(FMT1);
} else {
NextMulticolored.text = "";
}
FMT1.size = 12;
FMT2.size = 14;
}
function FigureBlobStartingHP(Level) {
var _local1 = 0;
_local1 = Math.pow(Level, 2.1);
if (Game.Difficulty == "Hard") {
_local1 = _local1 * 1.5;
}
_local1 = Math.round(_local1);
return(_local1);
}
function GetKeyTap() {
if (InFrame70 == true) {
switch (Key.getCode()) {
case 32 :
NextLevel();
break;
case 66 :
BuildTowerMode();
break;
case 27 :
BuildingTower = false;
TowerSelected = -1;
this.SelTower1.removeMovieClip();
break;
case 68 :
UpgradeTower("Damage");
break;
case 83 :
UpgradeTower("Speed");
break;
case 82 :
UpgradeTower("Range");
break;
case 76 :
UpgradeTower("Slow");
break;
case 84 :
UpgradeTower("Rotate");
break;
case 77 :
UpgradeTower("Multifire");
break;
case 49 :
ChangeTarget("Distance");
break;
case 50 :
ChangeTarget("Speed");
break;
case 51 :
ChangeTarget("Healthy");
break;
case 52 :
ChangeTarget("Weak");
break;
case 53 :
ChangeTarget("Spectrum");
break;
case 80 :
PauseGame();
}
}
}
var TowerPlacesX = new Array();
var TowerPlacesY = new Array();
var XYOffset = 3;
var TowerSelected = -1;
var BuildR = 125;
var BuildG = 125;
var BuildB = 125;
var FMT1 = new TextFormat();
var FMT2 = new TextFormat();
var MoveBlobCount = 0;
var BuildingTower = false;
var Lines = new Array();
var Paused = false;
var TempColor = new Object();
var LastMouseX = 0;
var LastMouseY = 0;
InFrame70 = true;
BuildR = 125;
BuildG = 125;
BuildB = 125;
FMT1.font = "Impact";
FMT1.size = 12;
FMT1.bold = false;
FMT1.color = 16776960 /* 0xFFFF00 */;
FMT1.align = "Center";
FMT2.font = "Impact";
FMT2.size = 14;
FMT2.bold = false;
FMT2.color = 16776960 /* 0xFFFF00 */;
FMT2.align = "Center";
_root.createTextField("YourSilver", _root.getNextHighestDepth(), 410, 14, 100, 20);
YourSilver.type = "input";
YourSilver.border = false;
YourSilver.multiline = false;
YourSilver.wordWrap = false;
YourSilver.selectable = false;
YourSilver.tabEnabled = false;
_root.createTextField("YourScore", _root.getNextHighestDepth(), 510, 14, 80, 20);
YourScore.type = "input";
YourScore.border = false;
YourScore.multiline = false;
YourScore.wordWrap = false;
YourScore.selectable = false;
YourScore.tabEnabled = false;
_root.createTextField("CurrentLevel", _root.getNextHighestDepth(), 530, 39, 66, 20);
CurrentLevel.type = "input";
CurrentLevel.border = false;
CurrentLevel.multiline = false;
CurrentLevel.wordWrap = false;
CurrentLevel.selectable = false;
CurrentLevel.tabEnabled = false;
_root.createTextField("LivesLeft", _root.getNextHighestDepth(), 530, 61, 66, 20);
LivesLeft.type = "input";
LivesLeft.border = false;
LivesLeft.multiline = false;
LivesLeft.wordWrap = false;
LivesLeft.selectable = false;
LivesLeft.tabEnabled = false;
_root.createTextField("NextHP", _root.getNextHighestDepth(), 35, 427, 100, 20);
NextHP.type = "input";
NextHP.border = false;
NextHP.multiline = false;
NextHP.wordWrap = false;
NextHP.selectable = false;
NextHP.tabEnabled = false;
_root.createTextField("NextMorphous", _root.getNextHighestDepth(), 10, 440, 60, 20);
NextMorphous.type = "input";
NextMorphous.border = false;
NextMorphous.multiline = false;
NextMorphous.wordWrap = false;
NextMorphous.selectable = false;
NextMorphous.tabEnabled = false;
_root.createTextField("NextMulticolored", _root.getNextHighestDepth(), 10, 455, 80, 20);
NextMulticolored.type = "input";
NextMulticolored.border = false;
NextMulticolored.multiline = false;
NextMulticolored.wordWrap = false;
NextMulticolored.selectable = false;
NextMulticolored.tabEnabled = false;
_root.createTextField("NextFast", _root.getNextHighestDepth(), 90, 455, 40, 20);
NextFast.type = "input";
NextFast.border = false;
NextFast.multiline = false;
NextFast.wordWrap = false;
NextFast.selectable = false;
NextFast.tabEnabled = false;
_root.createTextField("NextBoss", _root.getNextHighestDepth(), 10, 470, 40, 25);
NextBoss.type = "input";
NextBoss.border = false;
NextBoss.multiline = false;
NextBoss.wordWrap = false;
NextBoss.selectable = false;
NextBoss.tabEnabled = false;
_root.createTextField("CurrentOrder", _root.getNextHighestDepth(), 522, 196, 75, 20);
CurrentOrder.type = "input";
CurrentOrder.border = false;
CurrentOrder.multiline = false;
CurrentOrder.wordWrap = false;
CurrentOrder.selectable = false;
CurrentOrder.tabEnabled = false;
_root.createTextField("UpgradeCost", _root.getNextHighestDepth(), 495, 384, 70, 20);
UpgradeCost.type = "input";
UpgradeCost.border = false;
UpgradeCost.multiline = false;
UpgradeCost.wordWrap = false;
UpgradeCost.selectable = false;
UpgradeCost.tabEnabled = false;
_root.createTextField("CurrentDamage", _root.getNextHighestDepth(), 510, 215, 80, 20);
CurrentDamage.type = "input";
CurrentDamage.border = false;
CurrentDamage.multiline = false;
CurrentDamage.wordWrap = false;
CurrentDamage.selectable = false;
CurrentDamage.tabEnabled = false;
_root.createTextField("CurrentSpeed", _root.getNextHighestDepth(), 510, 232, 80, 20);
CurrentSpeed.type = "input";
CurrentSpeed.border = false;
CurrentSpeed.multiline = false;
CurrentSpeed.wordWrap = false;
CurrentSpeed.selectable = false;
CurrentSpeed.tabEnabled = false;
_root.createTextField("CurrentRange", _root.getNextHighestDepth(), 510, 249, 80, 20);
CurrentRange.type = "input";
CurrentRange.border = false;
CurrentRange.multiline = false;
CurrentRange.wordWrap = false;
CurrentRange.selectable = false;
CurrentRange.tabEnabled = false;
_root.createTextField("CurrentSlow", _root.getNextHighestDepth(), 433, 265, 40, 20);
CurrentSlow.type = "input";
CurrentSlow.border = false;
CurrentSlow.multiline = false;
CurrentSlow.wordWrap = false;
CurrentSlow.selectable = false;
CurrentSlow.tabEnabled = false;
_root.createTextField("CurrentRotate", _root.getNextHighestDepth(), 500, 265, 40, 20);
CurrentRotate.type = "input";
CurrentRotate.border = false;
CurrentRotate.multiline = false;
CurrentRotate.wordWrap = false;
CurrentRotate.selectable = false;
CurrentRotate.tabEnabled = false;
_root.createTextField("CurrentMultifire", _root.getNextHighestDepth(), 563, 265, 40, 20);
CurrentMultifire.type = "input";
CurrentMultifire.border = false;
CurrentMultifire.multiline = false;
CurrentMultifire.wordWrap = false;
CurrentMultifire.selectable = false;
CurrentMultifire.tabEnabled = false;
_root.createTextField("PaidInto", _root.getNextHighestDepth(), 520, 286, 70, 20);
PaidInto.type = "input";
PaidInto.border = false;
PaidInto.multiline = false;
PaidInto.wordWrap = false;
PaidInto.selectable = false;
PaidInto.tabEnabled = false;
attachMovie("RGBPrev", "RGBPrevBox", _root.getNextHighestDepth(), {_x:484, _y:110});
AdjustTowerColor("Init");
var i = 0;
i = 1;
while (i <= 19) {
AddTowerPoint(i, 2);
i++;
}
i = 2;
while (i <= 20) {
AddTowerPoint(i, 4);
i++;
}
i = 1;
while (i <= 19) {
AddTowerPoint(i, 6);
i++;
}
i = 7;
while (i <= 19) {
AddTowerPoint(13, i);
i++;
}
i = 7;
while (i <= 19) {
AddTowerPoint(14, i);
i++;
}
i = 15;
while (i <= 19) {
AddTowerPoint(i, 18);
i++;
}
i = 15;
while (i <= 19) {
AddTowerPoint(i, 19);
i++;
}
i = 16;
while (i <= 20) {
AddTowerPoint(i, 8);
i++;
}
i = 16;
while (i <= 20) {
AddTowerPoint(i, 12);
i++;
}
i = 16;
while (i <= 20) {
AddTowerPoint(i, 16);
i++;
}
i = 15;
while (i <= 19) {
AddTowerPoint(i, 10);
i++;
}
i = 15;
while (i <= 19) {
AddTowerPoint(i, 14);
i++;
}
i = 8;
while (i <= 20) {
AddTowerPoint(11, i);
i++;
}
i = 2;
while (i <= 10) {
AddTowerPoint(i, 8);
i++;
}
i = 9;
while (i <= 19) {
AddTowerPoint(2, i);
i++;
}
i = 3;
while (i <= 9) {
AddTowerPoint(i, 19);
i++;
}
i = 10;
while (i <= 18) {
AddTowerPoint(9, i);
i++;
}
i = 4;
while (i <= 8) {
AddTowerPoint(i, 10);
i++;
}
i = 11;
while (i <= 17) {
AddTowerPoint(4, i);
i++;
}
i = 5;
while (i <= 7) {
AddTowerPoint(i, 17);
i++;
}
i = 12;
while (i <= 15) {
AddTowerPoint(6, i);
i++;
}
i = 12;
while (i <= 16) {
AddTowerPoint(7, i);
i++;
}
NextBlob = new BlobClass();
Game.Level = 0;
Game.Silver = 100;
Game.Lives = 100;
Game.Score = 0;
MenuMusic.stop();
if (MusicOn == true) {
GameMusic.start(0, 99999);
} else {
GameMusic.stop();
}
GameTick = function () {
if (Paused == false) {
CheckMouse();
ClearLines();
FireTowers();
MoveBlobs();
MoveBlobs();
ShowScore();
AutoNextLevel();
}
};
timer = setInterval(GameTick, 10);
InitNextLevel();
if (KeyListenerAdded == false) {
Key.addListener({onKeyDown:GetKeyTap, root:this});
KeyListenerAdded = true;
}
stop();
Frame 71
function SendScore() {
var _local2 = 0;
switch (Game.Difficulty) {
case "Easy" :
_local2 = 1;
break;
case "Normal" :
_local2 = 2;
break;
case "Hard" :
_local2 = 3;
break;
case "Challenge" :
_local2 = 4;
break;
case "Sandbox" :
_local2 = 5;
break;
case "Survival" :
_local2 = 6;
break;
case "Deep Blue" :
_local2 = 7;
}
now = new Date();
_root.diff = _local2;
_root.username = Name.text;
_root.score = Game.Score;
_root.game_id = 15;
_root.chs = ((_root.score * now.getUTCHours()) * now.getUTCDate()) + (now.getUTCFullYear() * 77);
loadVariablesNum ("http://scores.funny-games.biz/scores.php", 0, "POST");
}
_root.createTextField("Name", _root.getNextHighestDepth(), 110, 140, 280, 25);
Name.type = "input";
Name.border = false;
Name.multiline = false;
Name.wordWrap = false;
Name.selectable = true;
Name.tabEnabled = true;
_root.createTextField("Score", _root.getNextHighestDepth(), 110, 163, 150, 25);
Score.type = "input";
Score.border = false;
Score.multiline = false;
Score.wordWrap = false;
Score.selectable = false;
Score.tabEnabled = false;
_root.createTextField("Difficulty", _root.getNextHighestDepth(), 140, 183, 125, 25);
Difficulty.type = "input";
Difficulty.border = false;
Difficulty.multiline = false;
Difficulty.wordWrap = false;
Difficulty.selectable = false;
Difficulty.tabEnabled = false;
GameMusic.stop();
if (MusicOn == true) {
HelpMusic.start(0, 99999);
} else {
HelpMusic.stop();
}
FMT2.size = 18;
Name.text = "Me";
Name.setTextFormat(FMT2);
FMT2.size = 14;
Score.text = Math.round(Game.Score);
Score.setTextFormat(FMT2);
FMT2.size = 18;
Difficulty.text = Game.Difficulty;
Difficulty.setTextFormat(FMT2);
FMT2.size = 14;
stop();
Symbol 305 MovieClip [__Packages.BlobClass] Frame 0
class BlobClass
{
function BlobClass () {
}
var HPMax = 0;
var HP = 0;
var Level = 0;
var Scale = 100;
var Morphous = false;
var Multicolored = false;
var Fast = false;
var Boss = false;
var Speed = 0;
var SpeedRedux = 0;
var x = 0;
var y = 0;
var Mx = 0;
var My = 0;
var R = 0;
var G = 0;
var B = 0;
var Backwards = 0;
var Distance = 0;
}
Symbol 306 MovieClip [__Packages.GameClass] Frame 0
class GameClass
{
function GameClass () {
}
var Score = 0;
var Silver = 0;
var Blobs = new Array();
var Towers = new Array();
var Level = 0;
var Difficulty = "";
var Lives = 0;
}
Symbol 307 MovieClip [__Packages.MochiAd] Frame 0
class MochiAd
{
function MochiAd () {
}
static function getVersion() {
return("2.1");
}
static function showPreGameAd(options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = _getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}
static function showInterLevelAd(options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = _parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = _getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}
static function showTimedAd(options) {
showInterLevelAd(options);
}
static function showPreloaderAd(options) {
showPreGameAd(options);
}
static function _allowDomains(server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}
static function _loadCommunicator(options) {
var _local26 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = _parseOptions(options, _local26);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
_allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local25 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local25);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb_arg) {
var _local8 = parseInt(cb_arg);
var _local4 = this._callbacks[_local8];
if (!_local4) {
return(undefined);
}
delete this._callbacks[_local8];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}
static function fetchHighScores(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}
static function sendHighScore(options, callbackObj, callbackMethod) {
var _local1 = _loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}
static function load(options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = _parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = getVersion();
var _local9 = options.clip;
if (!_isNetworkAvailable()) {
return(null);
}
if (_local9._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local9.createEmptyMovieClip("_mochiad", _local12);
var _local11 = _getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local9._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local7 in options) {
_local4[_local7] = options[_local7];
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = _allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local8 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local8;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local8);
_local6.lc = _local5;
_local4.lc = _local8;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}
static function unload(clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}
static function _isNetworkAvailable() {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}
static function _getRes(options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}
static function _parseOptions(options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}
}
Symbol 308 MovieClip [__Packages.TowerClass] Frame 0
class TowerClass
{
function TowerClass () {
}
var Damage = 10;
var Multifire = 1;
var Speed = 10;
var FireTick = 0;
var Range = 100;
var Target = "";
var Rotation = 0;
var Slow = 0;
var UpgradeCost = 6;
var PaidInto = 6;
var R = 0;
var G = 0;
var B = 0;
var X = 0;
var Y = 0;
}
Symbol 38 Button
on (release) {
StartGame("Sandbox");
}
Symbol 45 Button
on (release) {
StartGame("Easy");
}
Symbol 52 Button
on (release) {
StartGame("Normal");
}
Symbol 59 Button
on (release) {
StartGame("Hard");
}
Symbol 66 Button
on (release) {
StartGame("Challenge");
}
Symbol 74 Button
on (release) {
getURL ("http://www.funny-games.biz/main.html", "_blank");
}
Symbol 76 Button
on (release) {
getURL ("http://scores.funny-games.biz/show.php?game_id=15&difficulty=1", "_blank");
}
Symbol 79 Button
on (release) {
gotoAndPlay (11);
}
Symbol 94 Button
on (release) {
if (MusicOn == false) {
MenuMusic.start(0, 99999);
MusicOn = true;
} else {
MenuMusic.stop();
MusicOn = false;
}
}
Symbol 101 Button
on (release) {
StartGame("Survival");
}
Symbol 111 Button
on (release) {
StartGame("Deep Blue");
}
Symbol 116 Button
on (release) {
getURL ("http://www.funny-games.biz/main.html", "_blank");
}
Symbol 122 Button
on (release) {
gotoAndPlay (12);
}
Symbol 125 Button
on (release) {
gotoAndPlay (10);
}
Symbol 129 Button
on (release) {
gotoAndPlay (13);
}
Symbol 133 Button
on (release) {
gotoAndPlay (14);
}
Symbol 141 Button
on (release) {
MouseClick(_root._xmouse, _root._ymouse);
}
Symbol 148 Button
on (release) {
NextLevel();
}
Symbol 153 Button
on (release) {
AdjustTowerColor("R+");
}
Symbol 158 Button
on (release) {
AdjustTowerColor("G+");
}
Symbol 163 Button
on (release) {
AdjustTowerColor("B+");
}
Symbol 169 Button
on (release) {
AdjustTowerColor("R-");
}
Symbol 174 Button
on (release) {
AdjustTowerColor("G-");
}
Symbol 179 Button
on (release) {
AdjustTowerColor("B-");
}
Symbol 186 Button
on (release) {
BuildTowerMode();
}
Symbol 194 Button
on (release) {
ChangeTarget("Distance");
}
Symbol 199 Button
on (release) {
ChangeTarget("Speed");
}
Symbol 204 Button
on (release) {
ChangeTarget("Healthy");
}
Symbol 209 Button
on (release) {
ChangeTarget("Weak");
}
Symbol 214 Button
on (release) {
ChangeTarget("Spectrum");
}
Symbol 221 Button
on (release) {
UpgradeTower("Damage");
}
Symbol 228 Button
on (release) {
UpgradeTower("Speed");
}
Symbol 235 Button
on (release) {
UpgradeTower("Range");
}
Symbol 242 Button
on (release) {
UpgradeTower("Slow");
}
Symbol 249 Button
on (release) {
UpgradeTower("Rotate");
}
Symbol 256 Button
on (release) {
UpgradeTower("Multifire");
}
Symbol 262 Button
on (release) {
PauseGame();
}
Symbol 268 Button
on (release) {
DestroyGame();
gotoAndPlay (10);
}
Symbol 280 Button
on (release) {
SellTower();
}
Symbol 285 Button
on (release) {
if (MusicOn == false) {
GameMusic.start(0, 99999);
MusicOn = true;
} else {
GameMusic.stop();
MusicOn = false;
}
}
Symbol 299 Button
on (release) {
SendScore();
getURL ("http://scores.funny-games.biz/show.php?game_id=15&difficulty=1", "_blank");
Name.removeTextField();
Score.removeTextField();
Difficulty.removeTextField();
gotoAndPlay (10);
}
Symbol 304 Button
on (release) {
Name.removeTextField();
Score.removeTextField();
Difficulty.removeTextField();
gotoAndPlay (10);
}