Frame 1
var CPMStarContentSpotID = "6285Q47A5CB7C";
System.security.allowDomain("server.cpmstar.com");
adBox.loadMovie("http://server.cpmstar.com/adviewas2.swf?contentspotid=" + CPMStarContentSpotID);
function initAwal() {
cursorke = 0;
upgradePoint = 50;
mapKe = 1;
tryKe = 0;
upgradeLife = 1;
upgradeSpeed = 1;
upgradeDamage = 1;
suaraNyala = true;
upgradeDouble = false;
upgradeBomb = false;
upgradeTrap = false;
upgradeNet = false;
upgradeTank = false;
}
function simpanData() {
Cookies = SharedObject.getLocal("chainSoldierData");
i = 1;
while (i <= simpanSemua.length) {
Cookies.data["chainSoldier" + i] = eval (simpanSemua[i]);
i++;
}
Cookies.flush();
}
function loadData() {
Cookies = SharedObject.getLocal("chainSoldierData");
i = 1;
while (i <= simpanSemua.length) {
_root[simpanSemua[i]] = Cookies.data["chainSoldier" + i];
i++;
}
}
function backNormal() {
myMusic.stop();
myMusic = new Sound(zmusik);
myMusic.attachSound("backNormal");
myMusic.start(0, 2);
myMusic.setVolume(volume1);
myMusic.onSoundComplete = backNormal;
}
function backKacau() {
myMusic.stop();
myMusic = new Sound(zmusik);
myMusic.attachSound("backKacau");
myMusic.start(0, 2);
myMusic.setVolume(volume1);
myMusic.onSoundComplete = backNormal;
}
function backGold() {
mySound = new Sound(zsound);
mySound.attachSound("backGold");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
function backMati() {
mySound = new Sound(zsound);
mySound.attachSound("backMati");
mySound.start(0, 1);
mySound.setVolume(volume2);
}
stop();
fscommand ("showmenu", false);
fscommand ("fullscreen", false);
fscommand ("allowscale", true);
Stage.showMenu = false;
play_btn.enabled = false;
this.onEnterFrame = function () {
persen = Math.round((_root.getBytesLoaded() / _root.getBytesTotal()) * 100);
xpersen = persen + " %";
bar_mc.gotoAndStop(persen);
if (persen >= 100) {
gotoAndStop ("completed");
delete this.onEnterFrame;
}
};
zmusik = attachMovie("xsound", "zmusik", 2);
zsound = attachMovie("xsound", "zsound", 3);
qualityGame = 1;
_quality = "HIGH";
volume1 = 100;
volume2 = 50;
simpanSemua = new Array("", "cursorke", "upgradePoint", "mapKe", "tryKe", "upgradeLife", "upgradeSpeed", "upgradeDamage", "upgradeDouble", "upgradeBomb", "upgradeTrap", "upgradeNet", "upgradeTank", "suaraNyala");
loadData();
if (mapKe == undefined) {
initAwal();
simpanData();
}
Frame 20
stop();
enter_btn.onRelease = function () {
_urlStart = _url.indexOf("://") + 3;
_urlEnd = _url.indexOf("/", _urlStart);
domain = _url.substring(_urlStart, _urlEnd);
LastDot = domain.lastIndexOf(".") - 1;
domEnd = domain.lastIndexOf(".", LastDot) + 1;
domain = domain.substring(domEnd, domain.length);
if (domain == "belugerinstudios.com") {
play_btn.enabled = false;
gotoAndPlay (31);
} else {
play_btn.enabled = false;
gotoAndPlay (31);
}
removeMovieClip(adBox);
};
Frame 21
prevFrame();
gotoAndStop;
Frame 31
play();
Frame 215
backNormal();
gotoAndStop (216);
Frame 216
function init() {
_quality = "LOW";
pasukanKe = 1000;
bykGold = 750;
bykPeluru = 600;
bykEfek = 100;
if (mapKe == 1) {
nyawaLevel = Math.ceil((mapKe - 1) * 1.5);
} else if (mapKe == 2) {
nyawaLevel = Math.ceil((mapKe - 1) * 1.75);
} else if (mapKe == 3) {
nyawaLevel = Math.ceil((mapKe - 1) * 2);
} else if (mapKe == 4) {
nyawaLevel = Math.ceil((mapKe - 1) * 2.25);
} else if (mapKe == 5) {
nyawaLevel = Math.ceil((mapKe - 1) * 2.5);
} else if (mapKe == 6) {
nyawaLevel = Math.ceil((mapKe - 1) * 2.75);
} else if (mapKe == 7) {
nyawaLevel = Math.ceil((mapKe - 1) * 3);
} else if (mapKe == 8) {
nyawaLevel = Math.ceil((mapKe - 1) * 3.5);
} else if (mapKe == 9) {
nyawaLevel = Math.ceil((mapKe - 1) * 4.5);
} else if (mapKe == 11) {
nyawaLevel = Math.ceil((mapKe - 1) * 5);
} else if (mapKe == 12) {
nyawaLevel = Math.ceil((mapKe - 1) * 10);
}
sudahInfect = false;
sudahInfect2 = false;
sudahBomb = false;
sudahTrap = false;
sudahSelesai = false;
sudahDuaKaliKlik = false;
if (mapKe <= 3) {
maxPasukan = 5 * mapKe;
batasKiri = 350;
batasAtas = 200;
batasKanan = 500;
batasBawah = 350;
scalePasukan = 85;
} else if (mapKe <= 6) {
maxPasukan = 10 * mapKe;
batasKiri = 250;
batasAtas = 200;
batasKanan = 600;
batasBawah = 450;
scalePasukan = 75;
} else if (mapKe <= 9) {
maxPasukan = 20 * mapKe;
batasKiri = 150;
batasAtas = 125;
batasKanan = 675;
batasBawah = 500;
scalePasukan = 65;
} else if (mapKe >= 10) {
maxPasukan = 200;
batasKiri = 50;
batasAtas = 50;
batasKanan = 750;
batasBawah = 550;
scalePasukan = 55;
}
}
function buatArea() {
if (mapKe <= 3) {
xmapKe = 1;
} else if (mapKe <= 6) {
xmapKe = 2;
} else if (mapKe <= 9) {
xmapKe = 3;
} else {
xmapKe = 4;
}
pohon = attachMovie("pohonAtas" + xmapKe, "pohon1", 970);
pohon._x = 0;
pohon._y = 0;
pohon2 = attachMovie("xpohonBawah" + xmapKe, "pohon2", 1770);
pohon2._x = 0;
pohon2._y = 0;
}
function buatPasukan() {
i = 1000;
while (i <= (1000 + maxPasukan)) {
randHealer = random(100);
if (mapKe <= 3) {
maxHealer = 5;
} else if (mapKe <= 6) {
maxHealer = 20;
} else if (mapKe <= 9) {
maxHealer = 35;
} else {
maxHealer = 50;
}
if (upgradeTank == true) {
pertengahan = 1000 + (maxPasukan / 2);
} else {
pertengahan = 0;
}
if (i == pertengahan) {
randHealer = 1000;
}
if (randHealer <= maxHealer) {
pasukan = attachMovie("healer1", "pasukan_mc" + pasukanKe, pasukanKe);
pasukan.tipe = 1;
pasukan.jenis = "heal";
} else {
if (mapKe <= 2) {
jenisPasukan = 1;
} else if (mapKe <= 4) {
jenisPasukan = random(2) + 1;
} else if (mapKe <= 6) {
jenisPasukan = random(3) + 1;
} else if (mapKe <= 8) {
jenisPasukan = random(4) + 1;
} else {
jenisPasukan = random(5) + 1;
}
if (i == pertengahan) {
jenisPasukan = 6;
pasukan = attachMovie("pasukan6", "pasukan_mc" + pasukanKe, pasukanKe);
} else {
pasukan = attachMovie("pasukan" + jenisPasukan, "pasukan_mc" + pasukanKe, pasukanKe);
}
pasukan.tipe = jenisPasukan;
pasukan.jenis = "soldier";
}
if (((pasukan.tipe == 1) || (pasukan.tipe == 3)) || (pasukan.tipe == 5)) {
pasukan.serangDekat = true;
} else {
pasukan.serangDekat = false;
}
if (pasukan.tipe == 3) {
pasukan.pengali1 = 1.5;
} else {
pasukan.pengali1 = 0.5;
}
pasukan._x = (batasKiri + 1) + random((batasKanan - batasKiri) - 1);
pasukan._y = (batasAtas + 1) + random((batasBawah - batasAtas) - 1);
pasukan.speedX = 1.5 * pasukan.pengali1;
pasukan.speedY = 1.5 * pasukan.pengali1;
pasukan._xscale = (pasukan._yscale = scalePasukan);
pasukan.gotoAndStop(random(4) + 1);
pasukan.xdelay = random(2);
pasukan.maxDelay = 15 + random(2);
pasukan.xdelay2 = 0;
pasukan.maxDelay2 = 15;
pasukan.xdelay3 = 0;
pasukan.maxDelay3 = 150;
pasukan.delayMati = 0;
if (pasukan.tipe == 6) {
pasukan.xdelay2 = 0;
pasukan.maxDelay2 = 2;
pasukan.matiMax = 1000 + (upgradeLife * 5);
} else {
pasukan.matiMax = 50 + (upgradeLife * 5);
}
pasukan.nator = false;
pasukan.bykNyawa = nyawaLevel;
pasukan.awalMaxdelay = pasukan.maxDelay;
randomPosisiPasukan(pasukan);
pasukan.onEnterFrame = enterPasukan;
pasukanKe++;
i++;
}
}
function randomPosisiPasukan(indi) {
randX = random(4);
if (randX == 0) {
indi.gerakAtasKanan = true;
indi.gerakBawahKanan = false;
indi.gerakBawahKiri = false;
indi.gerakAtasKiri = false;
} else if (randX == 1) {
indi.gerakAtasKanan = false;
indi.gerakBawahKanan = true;
indi.gerakBawahKiri = false;
indi.gerakAtasKiri = false;
} else if (randX == 2) {
indi.gerakAtasKanan = false;
indi.gerakBawahKanan = false;
indi.gerakBawahKiri = true;
indi.gerakAtasKiri = false;
} else if (randX == 3) {
indi.gerakAtasKanan = false;
indi.gerakBawahKanan = false;
indi.gerakBawahKiri = false;
indi.gerakAtasKiri = true;
}
}
function enterPasukan() {
this.xdelay++;
if (this.xdelay >= this.maxDelay) {
this.xdelay = 0;
randomPosisiPasukan(this);
}
if (this._x < (batasKiri + 1)) {
this._x = batasKiri + 1;
}
if (this._x > (batasKanan - 1)) {
this._x = batasKanan - 1;
}
if (this._y < (batasAtas + 1)) {
this._y = batasAtas + 1;
}
if (this._y > (batasBawah - 1)) {
this._y = batasBawah - 1;
}
if (this.gerakAtasKanan == true) {
this.gotoAndStop(1);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x + this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y - this.speedY;
}
} else if (this.gerakBawahKanan == true) {
this.gotoAndStop(2);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x + this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y + this.speedY;
}
} else if (this.gerakBawahKiri == true) {
this.gotoAndStop(3);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x - this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y + this.speedY;
}
} else if (this.gerakAtasKiri == true) {
this.gotoAndStop(4);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x - this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y - this.speedY;
}
}
if (this.sudahMati == true) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
buatGold(this);
removeMovieClip(this);
}
}
}
function clearSemua() {
clearInterval(idLanjut);
removeMovieClip(net_mc);
removeMovieClip(nator_mc);
removeMovieClip(bomb_mc);
removeMovieClip(trap_mc);
removeMovieClip(mainmenu);
removeMovieClip(pohon1);
removeMovieClip(pohon2);
removeMovieClip(_root["pohonAtas" + xmapKe]);
removeMovieClip(_root["pohonBawah" + xmapKe]);
i = 1000;
while (i <= (1000 + maxPasukan)) {
removeMovieClip(_root["pasukan_mc" + i]);
i++;
}
i = 600;
while (i <= 700) {
removeMovieClip(_root["peluru_mc" + i]);
i++;
}
i = 750;
while (i <= 950) {
removeMovieClip(_root["gold_mc" + i]);
i++;
}
i = 100;
while (i <= 500) {
removeMovieClip(_root["efek_mc" + i]);
i++;
}
}
stop();
mainmenu = attachMovie("mainmenu", "mainmenu", 1000000);
mainmenu._x = 400;
mainmenu._y = 400;
mainmenu.new_btn.onRelease = function () {
initAwal();
simpanData();
clearSemua();
gotoAndStop (217);
};
if (mapKe == 1) {
mainmenu.continue_btn.enabled = false;
} else {
mainmenu.continue_btn.enabled = true;
}
mainmenu.continue_btn.onRelease = function () {
loadData();
clearSemua();
gotoAndStop (218);
};
mainmenu.more_btn.onRelease = function () {
getURL ("http://www.belugerinstudios.com", "_blank");
};
cursorke = 0;
upgradePoint = 50;
mapKe = 10;
tryKe = 0;
upgradeLife = 1;
upgradeSpeed = 1;
upgradeDamage = 1;
upgradeDouble = false;
upgradeBomb = false;
upgradeTrap = false;
upgradeNet = false;
upgradeTank = false;
init();
buatArea();
buatPasukan();
Frame 217
stop();
continue_btn.onRelease = function () {
gotoAndStop (218);
};
Frame 218
function init() {
_quality = "LOW";
pasukanKe = 1000;
bykGold = 750;
bykPeluru = 600;
bykEfek = 100;
if (mapKe == 1) {
nyawaLevel = Math.ceil((mapKe - 1) * 1.25);
} else if (mapKe == 2) {
nyawaLevel = Math.ceil((mapKe - 1) * 1.5);
} else if (mapKe == 3) {
nyawaLevel = Math.ceil((mapKe - 1) * 1.75);
} else if (mapKe == 4) {
nyawaLevel = Math.ceil((mapKe - 1) * 2);
} else if (mapKe == 5) {
nyawaLevel = Math.ceil((mapKe - 1) * 2.25);
} else if (mapKe == 6) {
nyawaLevel = Math.ceil((mapKe - 1) * 2.5);
} else if (mapKe == 7) {
nyawaLevel = Math.ceil((mapKe - 1) * 2.75);
} else if (mapKe == 8) {
nyawaLevel = Math.ceil((mapKe - 1) * 3);
} else if (mapKe == 9) {
nyawaLevel = Math.ceil((mapKe - 1) * 3.25);
} else if (mapKe == 10) {
nyawaLevel = Math.ceil((mapKe - 1) * 3.5);
} else if (mapKe == 11) {
nyawaLevel = Math.ceil((mapKe - 1) * 3.75);
} else if (mapKe == 12) {
nyawaLevel = Math.ceil((mapKe - 1) * 11.25);
}
sudahInfect = false;
sudahInfect2 = false;
sudahBomb = false;
sudahTrap = false;
sudahSelesai = false;
sudahDuaKaliKlik = false;
if (mapKe <= 3) {
maxPasukan = 5 * mapKe;
batasKiri = 350;
batasAtas = 200;
batasKanan = 500;
batasBawah = 350;
scalePasukan = 85;
} else if (mapKe <= 6) {
maxPasukan = 10 * mapKe;
batasKiri = 250;
batasAtas = 200;
batasKanan = 600;
batasBawah = 450;
scalePasukan = 75;
} else if (mapKe <= 9) {
maxPasukan = 15 * mapKe;
batasKiri = 150;
batasAtas = 125;
batasKanan = 675;
batasBawah = 500;
scalePasukan = 65;
} else if (mapKe <= 11) {
maxPasukan = 20 * mapKe;
batasKiri = 50;
batasAtas = 50;
batasKanan = 750;
batasBawah = 550;
scalePasukan = 60;
} else if (mapKe == 12) {
maxPasukan = 200;
batasKiri = 50;
batasAtas = 50;
batasKanan = 750;
batasBawah = 550;
scalePasukan = 55;
}
}
function buatNator() {
nator = attachMovie("nator_mc", "nator_mc", 5000);
if ((cursorke == 1) || (cursorke == 3)) {
nator.gotoAndStop(2);
} else if ((cursorke == 2) || (cursorke == 4)) {
nator.gotoAndStop(3);
} else {
nator.gotoAndStop(1);
}
nator._x = _root._xmouse;
nator._y = _root._ymouse;
nator.startDrag(true);
nator.onRelease = klikNator;
}
function buatBomb() {
bomb = attachMovie("bomb_mc", "nator_mc", 5000);
bomb._x = _root._xmouse;
bomb._y = _root._ymouse;
bomb.startDrag(true);
bomb.onRelease = klikbuatBomb;
}
function buatTrap() {
bomb = attachMovie("trap_mc", "nator_mc", 5000);
bomb._x = _root._xmouse;
bomb._y = _root._ymouse;
bomb.startDrag(true);
bomb.onRelease = klikbuatTrap;
}
function buatNet() {
nator = attachMovie("net_mc", "net_mc", 5000);
nator._x = _root._xmouse;
nator._y = _root._ymouse;
nator.startDrag(true);
}
function buatArea() {
if (mapKe <= 3) {
xmapKe = 1;
} else if (mapKe <= 6) {
xmapKe = 2;
} else if (mapKe <= 9) {
xmapKe = 3;
} else {
xmapKe = 4;
}
pohon = attachMovie("pohonAtas" + xmapKe, "pohon1", 970);
pohon._x = 0;
pohon._y = 0;
pohon2 = attachMovie("pohonBawah" + xmapKe, "pohon2", 1770);
pohon2._x = 0;
pohon2._y = 0;
pohon2.levelKe = "Level " + mapKe;
pohon2.tryKe = "Try " + tryKe;
if (suaraNyala == true) {
pohon2.sound_mc.gotoAndStop(1);
} else {
pohon2.sound_mc.gotoAndStop(2);
}
pohon2.sound_mc.onRelease = function () {
if (suaraNyala == true) {
volume1 = 0;
volume2 = 0;
myMusic.setVolume(volume1);
this.gotoAndStop(2);
suaraNyala = false;
} else {
volume1 = 100;
volume2 = 50;
myMusic.setVolume(volume1);
this.gotoAndStop(1);
suaraNyala = true;
}
};
}
function klikbuatBomb() {
sudahBomb = true;
i = 1000;
while (i <= (1000 + maxPasukan)) {
if (this.hitTest(_root["pasukan_mc" + i])) {
if (_root["pasukan_mc" + i].jenis == "heal") {
cekEfek(2, _root["pasukan_mc" + i]);
cekEfek(1, _root["pasukan_mc" + i]);
_root["pasukan_mc" + i].sudahMati = true;
_root["pasukan_mc" + i].onEnterFrame = cekMati;
}
}
i++;
}
removeMovieClip(this);
if (upgradeDouble == false) {
if (sudahInfect == true) {
if (upgradeNet == true) {
buatNet();
}
} else {
buatNator();
}
} else if (sudahDuaKaliKlik == true) {
if (sudahInfect == true) {
if (upgradeNet == true) {
buatNet();
}
} else {
buatNator();
}
} else {
buatNator();
}
}
function klikbuatTrap() {
sudahTrap = true;
i = 1000;
while (i <= (1000 + maxPasukan)) {
if (this.hitTest(_root["pasukan_mc" + i])) {
if (_root["pasukan_mc" + i].nator == true) {
_root["pasukan_mc" + i]._xscale = _root["pasukan_mc" + i]._xscale * 1.5;
_root["pasukan_mc" + i]._yscale = _root["pasukan_mc" + i]._yscale * 1.5;
_root["pasukan_mc" + i].kuat = true;
_root["pasukan_mc" + i].matiMax = 200 + (upgradeLife * 5);
}
}
i++;
}
removeMovieClip(this);
if (upgradeDouble == false) {
if (sudahInfect == true) {
if (upgradeNet == true) {
buatNet();
}
} else {
buatNator();
}
} else if (sudahDuaKaliKlik == true) {
if (sudahInfect == true) {
if (upgradeNet == true) {
buatNet();
}
} else {
buatNator();
}
} else {
buatNator();
}
}
function klikNator() {
if (sudahInfect2 == false) {
backKacau();
sudahInfect2 = true;
}
i = 1000;
while (i <= (1000 + maxPasukan)) {
if (_root["pasukan_mc" + i].nator == false) {
_root["pasukan_mc" + i].speedX = 4 * _root["pasukan_mc" + i].pengali1;
_root["pasukan_mc" + i].speedY = 4 * _root["pasukan_mc" + i].pengali1;
_root["pasukan_mc" + i].maxDelay = 8 + random(2);
}
i++;
}
i = 1000;
while (i <= (1000 + maxPasukan)) {
if (this.hitTest(_root["pasukan_mc" + i])) {
_root["pasukan_mc" + i].gotoAndStop(_root["pasukan_mc" + i]._currentframe + 10);
_root["pasukan_mc" + i].nator = true;
_root["pasukan_mc" + i].awalZombie = true;
delete _root["pasukan_mc" + i].onEnterFrame;
_root["pasukan_mc" + i].speedX = (8 + (upgradeSpeed / 5)) * _root["pasukan_mc" + i].pengali1;
_root["pasukan_mc" + i].speedY = (8 + (upgradeSpeed / 5)) * _root["pasukan_mc" + i].pengali1;
_root["pasukan_mc" + i].maxDelay = 4 + random(2);
_root["pasukan_mc" + i].delay1 = 0;
_root["pasukan_mc" + i].delay2 = 4;
cekEfek(2, _root["pasukan_mc" + i]);
cekEfek(1, _root["pasukan_mc" + i]);
_root["pasukan_mc" + i].onEnterFrame = enterPasukanDelay;
}
i++;
}
if ((cursorke == 3) || (cursorke == 4)) {
buatGun(this);
}
if (upgradeDouble == false) {
sudahInfect = true;
if (upgradeNet == true) {
buatNet();
}
removeMovieClip(this);
} else if (sudahDuaKaliKlik == false) {
sudahDuaKaliKlik = true;
} else {
sudahInfect = true;
if (upgradeNet == true) {
buatNet();
}
removeMovieClip(this);
}
}
function buatGun(indi) {
i = 1;
while (i <= 4) {
panah = attachMovie("gun_mc2", "peluru_mc" + bykPeluru, bykPeluru);
panah._x = indi._x;
panah._y = indi._y;
if (i <= 1) {
panah.gerakAtasKanan = true;
panah.gerakBawahKanan = false;
panah.gerakBawahKiri = false;
panah.gerakAtasKiri = false;
} else if (i <= 2) {
panah.gerakAtasKanan = false;
panah.gerakBawahKanan = true;
panah.gerakBawahKiri = false;
panah.gerakAtasKiri = false;
} else if (i <= 3) {
panah.gerakAtasKanan = false;
panah.gerakBawahKanan = false;
panah.gerakBawahKiri = true;
panah.gerakAtasKiri = false;
} else if (i <= 4) {
panah.gerakAtasKanan = false;
panah.gerakBawahKanan = false;
panah.gerakBawahKiri = false;
panah.gerakAtasKiri = true;
}
panah._xscale = 100;
panah._yscale = 100;
panah.xdelay = 0;
panah.maxDelay = 5;
if (mapKe <= 3) {
panah.speed = 16 + random(6);
} else if (mapKe <= 6) {
panah.speed = 19 + random(9);
} else if (mapKe <= 9) {
panah.speed = 22 + random(12);
} else {
panah.speed = 25 + random(15);
}
panah.onEnterFrame = enterGun2;
bykPeluru++;
if (bykPeluru >= 700) {
bykPeluru = 600;
}
i++;
}
}
function enterPasukanDelay() {
if (this.delay1 >= this.delay2) {
delete this.onEnterFrame;
this.onEnterFrame = enterPasukanZombie;
} else {
this.delay1++;
}
}
function buatPasukan() {
i = 1000;
while (i <= (1000 + maxPasukan)) {
randHealer = random(100);
if (mapKe <= 3) {
maxHealer = 5;
} else if (mapKe <= 6) {
maxHealer = 20;
} else if (mapKe <= 9) {
maxHealer = 35;
} else {
maxHealer = 50;
}
if (upgradeTank == true) {
pertengahan = 1000 + (maxPasukan / 2);
} else {
pertengahan = 0;
}
if (i == pertengahan) {
randHealer = 1000;
}
if (randHealer <= maxHealer) {
pasukan = attachMovie("healer1", "pasukan_mc" + pasukanKe, pasukanKe);
pasukan.tipe = 1;
pasukan.jenis = "heal";
} else {
if (mapKe <= 2) {
jenisPasukan = 1;
} else if (mapKe <= 4) {
jenisPasukan = random(2) + 1;
} else if (mapKe <= 6) {
jenisPasukan = random(3) + 1;
} else if (mapKe <= 8) {
jenisPasukan = random(4) + 1;
} else {
jenisPasukan = random(5) + 1;
}
if (i == pertengahan) {
jenisPasukan = 6;
pasukan = attachMovie("pasukan6", "pasukan_mc" + pasukanKe, pasukanKe);
} else {
pasukan = attachMovie("pasukan" + jenisPasukan, "pasukan_mc" + pasukanKe, pasukanKe);
}
pasukan.tipe = jenisPasukan;
pasukan.jenis = "soldier";
}
if (((pasukan.tipe == 1) || (pasukan.tipe == 3)) || (pasukan.tipe == 5)) {
pasukan.serangDekat = true;
} else {
pasukan.serangDekat = false;
}
if (pasukan.tipe == 3) {
pasukan.pengali1 = 1.5;
} else {
pasukan.pengali1 = 0.5;
}
pasukan._x = (batasKiri + 1) + random((batasKanan - batasKiri) - 1);
pasukan._y = (batasAtas + 1) + random((batasBawah - batasAtas) - 1);
pasukan.speedX = 1.5 * pasukan.pengali1;
pasukan.speedY = 1.5 * pasukan.pengali1;
pasukan._xscale = (pasukan._yscale = scalePasukan);
pasukan.gotoAndStop(random(4) + 1);
pasukan.xdelay = random(2);
pasukan.maxDelay = 15 + random(2);
pasukan.xdelay2 = 0;
pasukan.maxDelay2 = 15;
pasukan.xdelay3 = 0;
pasukan.maxDelay3 = 150;
pasukan.delayMati = 0;
if (pasukan.tipe == 6) {
pasukan.xdelay2 = 0;
pasukan.maxDelay2 = 2;
pasukan.matiMax = 1000 + (upgradeLife * 5);
} else {
pasukan.matiMax = 50 + (upgradeLife * 5);
}
pasukan.nator = false;
pasukan.bykNyawa = nyawaLevel;
pasukan.awalMaxdelay = pasukan.maxDelay;
randomPosisiPasukan(pasukan);
pasukan.onEnterFrame = enterPasukan;
pasukanKe++;
i++;
}
}
function randomPosisiPasukan(indi) {
randX = random(4);
if (randX == 0) {
indi.gerakAtasKanan = true;
indi.gerakBawahKanan = false;
indi.gerakBawahKiri = false;
indi.gerakAtasKiri = false;
} else if (randX == 1) {
indi.gerakAtasKanan = false;
indi.gerakBawahKanan = true;
indi.gerakBawahKiri = false;
indi.gerakAtasKiri = false;
} else if (randX == 2) {
indi.gerakAtasKanan = false;
indi.gerakBawahKanan = false;
indi.gerakBawahKiri = true;
indi.gerakAtasKiri = false;
} else if (randX == 3) {
indi.gerakAtasKanan = false;
indi.gerakBawahKanan = false;
indi.gerakBawahKiri = false;
indi.gerakAtasKiri = true;
}
}
function enterPasukan() {
this.xdelay++;
if (this.xdelay >= this.maxDelay) {
this.xdelay = 0;
randomPosisiPasukan(this);
}
if (this._x < (batasKiri + 1)) {
this._x = batasKiri + 1;
}
if (this._x > (batasKanan - 1)) {
this._x = batasKanan - 1;
}
if (this._y < (batasAtas + 1)) {
this._y = batasAtas + 1;
}
if (this._y > (batasBawah - 1)) {
this._y = batasBawah - 1;
}
if (this.gerakAtasKanan == true) {
this.gotoAndStop(1);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x + this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y - this.speedY;
}
} else if (this.gerakBawahKanan == true) {
this.gotoAndStop(2);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x + this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y + this.speedY;
}
} else if (this.gerakBawahKiri == true) {
this.gotoAndStop(3);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x - this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y + this.speedY;
}
} else if (this.gerakAtasKiri == true) {
this.gotoAndStop(4);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x - this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y - this.speedY;
}
}
if (this.sudahMati == true) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
buatGold(this);
removeMovieClip(this);
}
}
}
function cekPanah(indi) {
panah = attachMovie("panah_mc", "peluru_mc" + bykPeluru, bykPeluru);
panah._x = indi._x;
panah._y = indi._y;
panah.gerakAtasKanan = indi.gerakAtasKanan;
panah.gerakBawahKanan = indi.gerakBawahKanan;
panah.gerakBawahKiri = indi.gerakBawahKiri;
panah.gerakAtasKiri = indi.gerakAtasKiri;
panah._xscale = indi._xscale;
panah._yscale = indi._yscale;
panah.xdelay = 0;
panah.maxDelay = 50;
panah.speed = 20;
panah.onEnterFrame = enterPanah;
bykPeluru++;
if (bykPeluru >= 700) {
bykPeluru = 600;
}
}
function cekGun(indi) {
panah = attachMovie("gun_mc", "peluru_mc" + bykPeluru, bykPeluru);
panah._x = indi._x;
panah._y = indi._y;
panah.gerakAtasKanan = indi.gerakAtasKanan;
panah.gerakBawahKanan = indi.gerakBawahKanan;
panah.gerakBawahKiri = indi.gerakBawahKiri;
panah.gerakAtasKiri = indi.gerakAtasKiri;
panah._xscale = indi._xscale;
panah._yscale = indi._yscale;
panah.xdelay = 0;
panah.maxDelay = 50;
panah.speed = 30;
panah.onEnterFrame = enterGun;
bykPeluru++;
if (bykPeluru >= 700) {
bykPeluru = 600;
}
}
function enterGun() {
if (this.gerakAtasKanan == true) {
this.gotoAndStop(1);
this._x = this._x + this.speed;
this._y = this._y - this.speed;
} else if (this.gerakBawahKanan == true) {
this.gotoAndStop(2);
this._x = this._x + this.speed;
this._y = this._y + this.speed;
} else if (this.gerakBawahKiri == true) {
this.gotoAndStop(3);
this._x = this._x - this.speed;
this._y = this._y + this.speed;
} else if (this.gerakAtasKiri == true) {
this.gotoAndStop(4);
this._x = this._x - this.speed;
this._y = this._y - this.speed;
}
i = 1000;
while (i <= (1000 + maxPasukan)) {
if (_root["pasukan_mc" + i] != undefined) {
if (_root["pasukan_mc" + i].nator == false) {
if (this.hitTest(_root["pasukan_mc" + i])) {
_root["pasukan_mc" + i].bykNyawa = _root["pasukan_mc" + i].bykNyawa - upgradeDamage;
if (_root["pasukan_mc" + i].bykNyawa <= 0) {
backMati();
_root["pasukan_mc" + i].gotoAndStop(_root["pasukan_mc" + i]._currentframe + 10);
_root["pasukan_mc" + i].nator = true;
delete _root["pasukan_mc" + i].onEnterFrame;
_root["pasukan_mc" + i].speedX = (8 + (upgradeSpeed / 5)) * _root["pasukan_mc" + i].pengali1;
_root["pasukan_mc" + i].speedY = (8 + (upgradeSpeed / 5)) * _root["pasukan_mc" + i].pengali1;
_root["pasukan_mc" + i].maxDelay = 4 + random(2);
randomPosisiPasukan(_root["pasukan_mc" + i]);
cekEfek(2, _root["pasukan_mc" + i]);
cekEfek(3, _root["pasukan_mc" + i]);
_root["pasukan_mc" + i].onEnterFrame = enterPasukanZombie;
removeMovieClip(this);
}
}
}
}
i++;
}
this.xdelay++;
if (this.xdelay >= this.maxDelay) {
removeMovieClip(this);
}
}
function enterGun2() {
if (this.gerakAtasKanan == true) {
this.gotoAndStop(1);
this._x = this._x + this.speed;
this._y = this._y - this.speed;
} else if (this.gerakBawahKanan == true) {
this.gotoAndStop(2);
this._x = this._x + this.speed;
this._y = this._y + this.speed;
} else if (this.gerakBawahKiri == true) {
this.gotoAndStop(3);
this._x = this._x - this.speed;
this._y = this._y + this.speed;
} else if (this.gerakAtasKiri == true) {
this.gotoAndStop(4);
this._x = this._x - this.speed;
this._y = this._y - this.speed;
}
this.xdelay++;
if (this.xdelay >= this.maxDelay) {
i = 1000;
while (i <= (1000 + maxPasukan)) {
if (_root["pasukan_mc" + i] != undefined) {
if (_root["pasukan_mc" + i].nator == false) {
if (this.hitTest(_root["pasukan_mc" + i])) {
_root["pasukan_mc" + i].bykNyawa = _root["pasukan_mc" + i].bykNyawa - (upgradeDamage * 4);
if (_root["pasukan_mc" + i].bykNyawa <= 0) {
backMati();
_root["pasukan_mc" + i].gotoAndStop(_root["pasukan_mc" + i]._currentframe + 10);
_root["pasukan_mc" + i].nator = true;
delete _root["pasukan_mc" + i].onEnterFrame;
_root["pasukan_mc" + i].speedX = (8 + (upgradeSpeed / 5)) * _root["pasukan_mc" + i].pengali1;
_root["pasukan_mc" + i].speedY = (8 + (upgradeSpeed / 5)) * _root["pasukan_mc" + i].pengali1;
_root["pasukan_mc" + i].maxDelay = 4 + random(2);
randomPosisiPasukan(_root["pasukan_mc" + i]);
cekEfek(2, _root["pasukan_mc" + i]);
cekEfek(3, _root["pasukan_mc" + i]);
_root["pasukan_mc" + i].onEnterFrame = enterPasukanZombie;
}
}
}
}
i++;
}
removeMovieClip(this);
}
}
function enterPanah() {
if (this.gerakAtasKanan == true) {
this.gotoAndStop(1);
this._x = this._x + this.speed;
this._y = this._y - this.speed;
} else if (this.gerakBawahKanan == true) {
this.gotoAndStop(2);
this._x = this._x + this.speed;
this._y = this._y + this.speed;
} else if (this.gerakBawahKiri == true) {
this.gotoAndStop(3);
this._x = this._x - this.speed;
this._y = this._y + this.speed;
} else if (this.gerakAtasKiri == true) {
this.gotoAndStop(4);
this._x = this._x - this.speed;
this._y = this._y - this.speed;
}
i = 1000;
while (i <= (1000 + maxPasukan)) {
if (_root["pasukan_mc" + i] != undefined) {
if (_root["pasukan_mc" + i].nator == false) {
if (this.hitTest(_root["pasukan_mc" + i])) {
if (_root["pasukan_mc" + i].bykNyawa <= 0) {
backMati();
_root["pasukan_mc" + i].gotoAndStop(_root["pasukan_mc" + i]._currentframe + 10);
_root["pasukan_mc" + i].nator = true;
delete _root["pasukan_mc" + i].onEnterFrame;
_root["pasukan_mc" + i].speedX = (8 + (upgradeSpeed / 5)) * _root["pasukan_mc" + i].pengali1;
_root["pasukan_mc" + i].speedY = (8 + (upgradeSpeed / 5)) * _root["pasukan_mc" + i].pengali1;
_root["pasukan_mc" + i].maxDelay = 4 + random(2);
randomPosisiPasukan(_root["pasukan_mc" + i]);
cekEfek(2, _root["pasukan_mc" + i]);
cekEfek(1, _root["pasukan_mc" + i]);
_root["pasukan_mc" + i].onEnterFrame = enterPasukanZombie;
removeMovieClip(this);
} else {
_root["pasukan_mc" + i].bykNyawa = _root["pasukan_mc" + i].bykNyawa - upgradeDamage;
}
}
}
}
i++;
}
this.xdelay++;
if (this.xdelay >= this.maxDelay) {
removeMovieClip(this);
}
}
function enterPasukan2() {
this.xdelay++;
if (this.xdelay >= this.maxDelay) {
this.xdelay = 0;
randomPosisiPasukan(this);
}
if (this._x < (batasKiri + 1)) {
this._x = batasKiri + 1;
}
if (this._x > (batasKanan - 1)) {
this._x = batasKanan - 1;
}
if (this._y < (batasAtas + 1)) {
this._y = batasAtas + 1;
}
if (this._y > (batasBawah - 1)) {
this._y = batasBawah - 1;
}
if (this.gerakAtasKanan == true) {
this.gotoAndStop(1);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x + this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y - this.speedY;
}
} else if (this.gerakBawahKanan == true) {
this.gotoAndStop(2);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x + this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y + this.speedY;
}
} else if (this.gerakBawahKiri == true) {
this.gotoAndStop(3);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x - this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y + this.speedY;
}
} else if (this.gerakAtasKiri == true) {
this.gotoAndStop(4);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x - this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y - this.speedY;
}
}
if (this.sudahMati == true) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
buatGold(this);
removeMovieClip(this);
}
}
}
function enterPasukanZombie() {
this.xdelay++;
if (this.xdelay >= this.maxDelay) {
this.xdelay = 0;
randomPosisiPasukan(this);
}
this.xdelay2++;
this.xdelay3++;
if (this.awalZombie == true) {
if (this.xdelay2 >= this.maxDelay2) {
this.xdelay2 = 0;
if (this.tipe == 2) {
cekPanah(this);
} else if ((this.tipe == 4) || (this.tipe == 6)) {
cekGun(this);
}
}
} else if (this.xdelay3 >= this.maxDelay3) {
this.xdelay3 = 0;
if (this.tipe == 2) {
cekPanah(this);
} else if ((this.tipe == 4) || (this.tipe == 6)) {
cekGun(this);
}
}
if (this._x < (batasKiri + 1)) {
this._x = batasKiri + 1;
}
if (this._x > (batasKanan - 1)) {
this._x = batasKanan - 1;
}
if (this._y < (batasAtas + 1)) {
this._y = batasAtas + 1;
}
if (this._y > (batasBawah - 1)) {
this._y = batasBawah - 1;
}
if (this.gerakAtasKanan == true) {
this.gotoAndStop(11);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x + this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y - this.speedY;
}
} else if (this.gerakBawahKanan == true) {
this.gotoAndStop(12);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x + this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y + this.speedY;
}
} else if (this.gerakBawahKiri == true) {
this.gotoAndStop(13);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x - this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y + this.speedY;
}
} else if (this.gerakAtasKiri == true) {
this.gotoAndStop(14);
if ((this._x > batasKiri) && (this._x < batasKanan)) {
this._x = this._x - this.speedX;
}
if ((this._y > batasAtas) && (this._y < batasBawah)) {
this._y = this._y - this.speedY;
}
}
i = 1000;
while (i <= (1000 + maxPasukan)) {
if (_root["pasukan_mc" + i] != undefined) {
if (_root["pasukan_mc" + i].nator == false) {
if ((this.hitTest(_root["pasukan_mc" + i]) && (_root["pasukan_mc" + i].sudahMati != true)) && (this.sudahMati != true)) {
if (_root["pasukan_mc" + i].jenis == "heal") {
if (this.tipe != 6) {
if (this.kuat != true) {
this.gotoAndStop(this._currentframe - 10);
this.nator = false;
this.speedX = 1.5 * this.pengali1;
this.speedY = 1.5 * this.pengali1;
delete this.onEnterFrame;
randomPosisiPasukan(this);
cekEfek(2, this);
cekEfek(1, this);
this.onEnterFrame = enterPasukan;
_root["pasukan_mc" + i].sudahMati = true;
_root["pasukan_mc" + i].onEnterFrame = cekMati;
}
}
} else if (this.serangDekat == true) {
if (_root["pasukan_mc" + i].bykNyawa <= 0) {
backMati();
_root["pasukan_mc" + i].gotoAndStop(_root["pasukan_mc" + i]._currentframe + 10);
_root["pasukan_mc" + i].nator = true;
delete _root["pasukan_mc" + i].onEnterFrame;
_root["pasukan_mc" + i].speedX = (8 + (upgradeSpeed / 5)) * _root["pasukan_mc" + i].pengali1;
_root["pasukan_mc" + i].speedY = (8 + (upgradeSpeed / 5)) * _root["pasukan_mc" + i].pengali1;
_root["pasukan_mc" + i].maxDelay = 4 + random(2);
randomPosisiPasukan(_root["pasukan_mc" + i]);
if (this.tipe == 5) {
cekEfek(3, _root["pasukan_mc" + i]);
} else {
cekEfek(2, _root["pasukan_mc" + i]);
}
cekEfek(1, _root["pasukan_mc" + i]);
_root["pasukan_mc" + i].onEnterFrame = enterPasukanZombie;
this.sudahMati = true;
this.onEnterFrame = cekMati;
} else {
_root["pasukan_mc" + i].bykNyawa = _root["pasukan_mc" + i].bykNyawa - upgradeDamage;
}
}
}
}
}
i++;
}
if (this.delayMati >= this.matiMax) {
this.sudahMati = true;
this.onEnterFrame = cekMati;
} else {
this.delayMati++;
}
if (this.sudahMati == true) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
buatGold(this);
removeMovieClip(this);
}
}
}
function cekMati() {
if (this.sudahMati == true) {
this._alpha = this._alpha - 50;
if (this._alpha <= 0) {
buatGold(this);
removeMovieClip(this);
}
}
}
function buatGold(indi) {
gold = attachMovie("gold_mc", "gold_mc" + bykGold, bykGold);
gold._x = indi._x;
gold._y = indi._y;
gold.onEnterFrame = enterGold;
bykGold++;
if (bykEfek >= 950) {
bykEfek = 750;
}
}
function enterGold() {
if (upgradeNet == true) {
if (this.hitTest(net_mc)) {
backGold();
upgradePoint = upgradePoint + mapKe;
removeMovieClip(this);
}
} else if (this.hitTest(_root._xmouse, _root._ymouse)) {
backGold();
upgradePoint = upgradePoint + mapKe;
removeMovieClip(this);
}
}
function cekEfek(indi, indi2) {
if (indi == 1) {
efek = attachMovie("darah2_mc", "efek_mc" + bykEfek, bykEfek);
efek._x = indi2._x;
efek._y = indi2._y;
efek._rotation = random(360);
efek._alpha = random(10) + 10;
bykEfek++;
if (bykEfek >= 500) {
bykEfek = 100;
}
} else if (indi == 2) {
efek = attachMovie("darah_mc", "efek_mc" + bykEfek, bykEfek);
efek._x = indi2._x;
efek._y = indi2._y - 25;
bykEfek++;
if (bykEfek >= 500) {
bykEfek = 100;
}
} else if (indi == 3) {
efek = attachMovie("meledak_mc", "efek_mc" + bykEfek, bykEfek);
efek._x = indi2._x;
efek._y = indi2._y;
efek._xscale = (efek._yscale = 100);
efek.onEnterFrame = enterEfek;
bykEfek++;
if (bykEfek >= 500) {
bykEfek = 100;
}
}
}
function enterEfek() {
if (this._currentframe == 3) {
i = 1000;
while (i <= (1000 + maxPasukan)) {
if (_root["pasukan_mc" + i] != undefined) {
if (_root["pasukan_mc" + i].nator == false) {
if (this.hitTest(_root["pasukan_mc" + i])) {
_root["pasukan_mc" + i].gotoAndStop(_root["pasukan_mc" + i]._currentframe + 10);
_root["pasukan_mc" + i].nator = true;
delete _root["pasukan_mc" + i].onEnterFrame;
_root["pasukan_mc" + i].speedX = (8 + (upgradeSpeed / 5)) * _root["pasukan_mc" + i].pengali1;
_root["pasukan_mc" + i].speedY = (8 + (upgradeSpeed / 5)) * _root["pasukan_mc" + i].pengali1;
_root["pasukan_mc" + i].maxDelay = 4 + random(2);
randomPosisiPasukan(_root["pasukan_mc" + i]);
_root["pasukan_mc" + i].onEnterFrame = enterPasukanZombie;
}
}
}
i++;
}
}
}
function clearSemua() {
clearInterval(idLanjut);
removeMovieClip(net_mc);
removeMovieClip(nator_mc);
removeMovieClip(bomb_mc);
removeMovieClip(trap_mc);
removeMovieClip(pohon1);
removeMovieClip(pohon2);
removeMovieClip(_root["pohonAtas" + xmapKe]);
removeMovieClip(_root["pohonBawah" + xmapKe]);
i = 1000;
while (i <= (1000 + maxPasukan)) {
removeMovieClip(_root["pasukan_mc" + i]);
i++;
}
i = 600;
while (i <= 700) {
removeMovieClip(_root["peluru_mc" + i]);
i++;
}
i = 750;
while (i <= 950) {
removeMovieClip(_root["gold_mc" + i]);
i++;
}
i = 100;
while (i <= 500) {
removeMovieClip(_root["efek_mc" + i]);
i++;
}
}
function cekSelesai(indi) {
if (sudahSelesai == false) {
volume1 = 25;
myMusic.setVolume(volume1);
sudahSelesai = true;
if (indi == "menang") {
idLanjut = setInterval(lanjutLevel, 2000, indi);
} else {
idLanjut = setInterval(lanjutLevel, 3000, indi);
}
}
}
function lanjutLevel(indi) {
_quality = "HIGH";
if (suaraNyala == true) {
volume1 = 25;
} else {
volume1 = 0;
}
backNormal();
clearSemua();
frame = attachMovie("frame_mc", "frame_mc", 100000);
frame._x = 400;
frame._y = 300;
frame.save_mc._visible = false;
tryKe++;
if (indi == "menang") {
mapKe++;
upgradePoint = upgradePoint + (25 * (mapKe - 1));
frame.namaLevel = "Level Completed";
} else {
frame.namaLevel = "Level Failed";
}
costPoint = 0;
if (mapKe == 13) {
frame.levelKe = "";
} else {
frame.levelKe = "Level " + mapKe;
}
frame.tryKe = "Try: " + tryKe;
cekUpgrades();
frame.save_btn.onRelease = function () {
simpanData();
frame.save_mc._visible = true;
frame.save_mc.okay_btn.onRelease = function () {
frame.save_mc._visible = false;
};
};
frame.more_btn.onRelease = function () {
getURL ("http://www.belugerinstudios.com/", "_blank");
};
frame.continue_btn.onRelease = function () {
if (suaraNyala == true) {
volume1 = 100;
} else {
volume1 = 0;
}
myMusic.setVolume(volume1);
removeMovieClip(frame);
if (mapKe == 13) {
gotoAndStop (220);
} else {
ulangLevel();
}
};
}
function cekUpgrades() {
i = 1;
while (i <= 30) {
frame["life" + i].gotoAndStop(1);
frame["speed" + i].gotoAndStop(1);
frame["power" + i].gotoAndStop(1);
i++;
}
i = 1;
while (i <= upgradeLife) {
frame["life" + i].gotoAndStop(2);
i++;
}
i = 1;
while (i <= upgradeSpeed) {
frame["speed" + i].gotoAndStop(2);
i++;
}
i = 1;
while (i <= upgradeDamage) {
frame["power" + i].gotoAndStop(2);
i++;
}
frame.life_btn.onRelease = klikLife;
frame.life_btn.onRollOver = overLife;
frame.life_btn.onRollOut = outLife;
frame.speed_btn.onRelease = klikSpeed;
frame.speed_btn.onRollOver = overSpeed;
frame.speed_btn.onRollOut = outSpeed;
frame.power_btn.onRelease = klikPower;
frame.power_btn.onRollOver = overPower;
frame.power_btn.onRollOut = outPower;
if (upgradeLife >= 30) {
frame.life_btn.enabled = false;
}
if (upgradeSpeed >= 30) {
frame.speed_btn.enabled = false;
}
if (upgradeDamage >= 30) {
frame.power_btn.enabled = false;
}
i = 1;
while (i <= 4) {
frame["cursor" + i].gotoAndStop(1);
i++;
}
i = 1;
while (i <= cursorke) {
frame["cursor" + i].gotoAndStop(2);
i++;
}
frame["cursor" + (cursorke + 1)].onRelease = klikCursor;
frame["cursor" + (cursorke + 1)].onRollOver = overCursor;
frame["cursor" + (cursorke + 1)].onRollOut = outCursor;
if (upgradeDouble == true) {
frame.double_btn.gotoAndStop(2);
frame.double_btn.enabled = false;
} else {
frame.double_btn.gotoAndStop(1);
}
if (upgradeBomb == true) {
frame.bomb_mc.gotoAndStop(2);
frame.bomb_mc.enabled = false;
} else {
frame.bomb_mc.gotoAndStop(1);
}
if (upgradeTrap == true) {
frame.trap_mc.gotoAndStop(2);
frame.trap_mc.enabled = false;
} else {
frame.trap_mc.gotoAndStop(1);
}
if (upgradeNet == true) {
frame.net_mc.gotoAndStop(2);
frame.net_mc.enabled = false;
} else {
frame.net_mc.gotoAndStop(1);
}
fullUpgrade = 0;
if (upgradeLife >= 30) {
fullUpgrade++;
}
if (upgradeSpeed >= 30) {
fullUpgrade++;
}
if (upgradeDamage >= 30) {
fullUpgrade++;
}
if (cursorke >= 4) {
fullUpgrade++;
}
if (upgradeDouble == true) {
fullUpgrade++;
}
if (upgradeBomb == true) {
fullUpgrade++;
}
if (upgradeTrap == true) {
fullUpgrade++;
}
if (upgradeNet == true) {
fullUpgrade++;
}
if (fullUpgrade >= 8) {
frame.tank_txt._visible = true;
frame.tank_btn._visible = true;
} else {
frame.tank_txt._visible = false;
frame.tank_btn._visible = false;
}
if (upgradeTank == true) {
frame.tank_btn.gotoAndStop(2);
frame.tank_btn.enabled = false;
} else {
frame.tank_btn.gotoAndStop(1);
}
frame.double_btn.onRelease = klikDouble;
frame.double_btn.onRollOver = overDouble;
frame.double_btn.onRollOut = outDouble;
frame.bomb_mc.onRelease = klikBomb;
frame.bomb_mc.onRollOver = overBomb;
frame.bomb_mc.onRollOut = outBomb;
frame.trap_mc.onRelease = klikTrap;
frame.trap_mc.onRollOver = overTrap;
frame.trap_mc.onRollOut = outTrap;
frame.net_mc.onRelease = klikNet;
frame.net_mc.onRollOver = overNet;
frame.net_mc.onRollOut = outNet;
frame.tank_btn.onRelease = klikTank;
frame.tank_btn.onRollOver = overTank;
frame.tank_btn.onRollOut = outTank;
}
function klikTank() {
if (upgradePoint >= costPoint) {
upgradeTank = true;
upgradePoint = upgradePoint - costPoint;
costPoint = 25000;
cekUpgrades();
}
}
function overTank() {
this._alpha = 50;
costPoint = 25000;
}
function outTank() {
this._alpha = 100;
costPoint = 0;
}
function klikDouble() {
if (upgradePoint >= costPoint) {
upgradeDouble = true;
upgradePoint = upgradePoint - costPoint;
costPoint = 5000;
cekUpgrades();
}
}
function overDouble() {
this._alpha = 50;
costPoint = 5000;
}
function outDouble() {
this._alpha = 100;
costPoint = 0;
}
function klikBomb() {
if (upgradePoint >= costPoint) {
upgradeBomb = true;
upgradePoint = upgradePoint - costPoint;
costPoint = 4000;
cekUpgrades();
}
}
function overBomb() {
this._alpha = 50;
costPoint = 4000;
}
function outBomb() {
this._alpha = 100;
costPoint = 0;
}
function klikTrap() {
if (upgradePoint >= costPoint) {
upgradeTrap = true;
upgradePoint = upgradePoint - costPoint;
costPoint = 3000;
cekUpgrades();
}
}
function overTrap() {
this._alpha = 50;
costPoint = 3000;
}
function outTrap() {
this._alpha = 100;
costPoint = 0;
}
function klikNet() {
if (upgradePoint >= costPoint) {
upgradeNet = true;
upgradePoint = upgradePoint - costPoint;
costPoint = 2000;
cekUpgrades();
}
}
function overNet() {
this._alpha = 50;
costPoint = 2000;
}
function outNet() {
this._alpha = 100;
costPoint = 0;
}
function klikCursor() {
if (upgradePoint >= costPoint) {
cursorke++;
upgradePoint = upgradePoint - costPoint;
costPoint = (cursorke + 1) * 100;
cekUpgrades();
}
}
function overCursor() {
this._alpha = 50;
costPoint = (cursorke + 1) * 100;
}
function outCursor() {
this._alpha = 100;
costPoint = 0;
}
function klikPower() {
if (upgradePoint >= costPoint) {
upgradeDamage++;
upgradePoint = upgradePoint - costPoint;
costPoint = upgradeDamage * 25;
cekUpgrades();
}
}
function overPower() {
costPoint = upgradeDamage * 25;
}
function outPower() {
costPoint = 0;
}
function klikSpeed() {
if (upgradePoint >= costPoint) {
upgradeSpeed++;
upgradePoint = upgradePoint - costPoint;
costPoint = upgradeSpeed * 15;
cekUpgrades();
}
}
function overSpeed() {
costPoint = upgradeSpeed * 15;
}
function outSpeed() {
costPoint = 0;
}
function klikLife() {
if (upgradePoint >= costPoint) {
upgradeLife++;
upgradePoint = upgradePoint - costPoint;
costPoint = upgradeLife * 20;
cekUpgrades();
}
}
function overLife() {
costPoint = upgradeLife * 20;
}
function outLife() {
costPoint = 0;
}
function ulangLevel() {
init();
buatNator();
buatArea();
buatPasukan();
}
stop();
init();
buatNator();
buatArea();
buatPasukan();
_root.onEnterFrame = function () {
if (sudahInfect2 == true) {
jumlahMerah = 0;
jumlahHijau = 0;
i = 1000;
while (i <= (1000 + maxPasukan)) {
if (_root["pasukan_mc" + i].nator == true) {
jumlahMerah++;
} else if (_root["pasukan_mc" + i] != undefined) {
jumlahHijau++;
}
i++;
}
if ((jumlahHijau <= 0) && (jumlahMerah <= 0)) {
cekSelesai("menang");
} else if (jumlahMerah <= 0) {
cekSelesai("kalah");
}
}
frame.upgradePoints = "Upgrade Points: " + upgradePoint;
frame.costUpgrades = "Cost Points: " + costPoint;
};
myListener = new Object();
myListener.onKeyDown = function () {
if (Key.getCode() == 49) {
if (sudahInfect == false) {
buatNator();
} else if (upgradeDouble == false) {
if (sudahInfect == true) {
if (upgradeNet == true) {
buatNet();
}
} else {
buatNator();
}
} else if (sudahDuaKaliKlik == true) {
if (sudahInfect == true) {
if (upgradeNet == true) {
buatNet();
}
} else {
buatNator();
}
} else {
buatNator();
}
}
if (Key.getCode() == 50) {
if (upgradeTrap == true) {
if (sudahTrap == false) {
buatTrap();
} else if (upgradeDouble == false) {
if (sudahInfect == true) {
if (upgradeNet == true) {
buatNet();
}
} else {
buatNator();
}
} else if (sudahDuaKaliKlik == true) {
if (sudahInfect == true) {
if (upgradeNet == true) {
buatNet();
}
} else {
buatNator();
}
} else {
buatNator();
}
}
}
if (Key.getCode() == 51) {
if (upgradeBomb == true) {
if (sudahBomb == false) {
buatBomb();
} else if (upgradeDouble == false) {
if (sudahInfect == true) {
if (upgradeNet == true) {
buatNet();
}
} else {
buatNator();
}
} else if (sudahDuaKaliKlik == true) {
if (sudahInfect == true) {
if (upgradeNet == true) {
buatNet();
}
} else {
buatNator();
}
} else {
buatNator();
}
}
}
};
Key.addListener(myListener);
Frame 219
prevFrame();
gotoAndStop;
Frame 220
stop();
playerScore = 0;
maxScore = Math.ceil(1000000 / tryKe);
xmaxScore = maxScore;
player_txt.text = "Chain Fans";
namaPlayer = player_txt.text;
Selection.setFocus(player_txt);
submit_btn.onRelease = function () {
playerScore = maxScore;
namaPlayer = player_txt.text;
getURL (((("http://www.belugerinstudios.com/action.php?act=submitscore&game=FL12015736&name=" + namaPlayer) + "&score=") + playerScore) + "&key=", "_blank");
this.enabled = false;
};
quit_btn.onRelease = function () {
gotoAndStop (216);
};
more_btn.onRelease = function () {
getURL ("http://www.belugerinstudios.com/", "_blank");
};
Symbol 88 MovieClip Frame 1
this.onPress = function () {
getURL ("http://www.belugerinstudios.com/", "_blank");
};
Symbol 99 MovieClip [darah_mc] Frame 8
removeMovieClip(this);
Symbol 101 MovieClip [darah2_mc] Frame 1
play();
Symbol 101 MovieClip [darah2_mc] Frame 54
stop();
Symbol 111 MovieClip Frame 1
stop();
Symbol 124 MovieClip Frame 1
stop();
Symbol 127 MovieClip Frame 1
stop();
Symbol 132 MovieClip Frame 1
stop();
Symbol 135 MovieClip Frame 1
stop();
Symbol 153 MovieClip Frame 1
stop();
Symbol 159 MovieClip Frame 1
stop();
Symbol 161 MovieClip Frame 1
stop();
Symbol 164 MovieClip [nator_mc] Frame 1
stop();
Symbol 166 MovieClip Frame 1
stop();
Symbol 178 MovieClip [pasukan6] Frame 1
stop();
Symbol 179 MovieClip Frame 1
stop();
Symbol 191 MovieClip [gold_mc] Frame 120
removeMovieClip(this);
Symbol 193 MovieClip [gun_mc] Frame 1
stop();
Symbol 195 MovieClip [gun_mc2] Frame 1
stop();
Symbol 212 MovieClip [healer1] Frame 1
stop();
Symbol 237 MovieClip [meledak_mc] Frame 6
stop();
removeMovieClip(this);
Symbol 240 MovieClip [panah_mc] Frame 1
stop();
Symbol 249 MovieClip [pasukan1] Frame 1
stop();
Symbol 266 MovieClip [pasukan2] Frame 1
stop();
Symbol 283 MovieClip [pasukan3] Frame 1
stop();
Symbol 300 MovieClip [pasukan4] Frame 1
stop();
Symbol 317 MovieClip [pasukan5] Frame 1
stop();
Symbol 330 MovieClip Frame 1
stop();
Symbol 350 MovieClip [rumput4_mc] Frame 1
stop();
Symbol 408 MovieClip Frame 175
stop();
Symbol 419 MovieClip Frame 175
stop();
Symbol 428 MovieClip Frame 1
this.onPress = function () {
getURL ("http://www.belugerinstudios.com/", "_blank");
};
Symbol 428 MovieClip Frame 185
stop();