Frame 1
stop();
satuKaliSaja = true;
this.onEnterFrame = function () {
sedang = _root.getBytesLoaded();
total = _root.getBytesTotal();
xpersen = Math.floor((sedang / total) * 100);
persen = xpersen + " %";
wpersen = Math.floor(xpersen);
bar_mc.gotoAndStop(wpersen);
if (sedang == total) {
delete this.onEnterFrame;
gotoAndStop ("loader");
}
};
Frame 2
function backSound() {
suara = new Sound();
suara.attachSound("backSound");
suara.start(0, 999);
}
function backPindah() {
suara = new Sound();
suara.attachSound("backPindah");
suara.start(0, 1);
}
function backLompat() {
suara = new Sound();
suara.attachSound("backLompat");
suara.start(0, 1);
}
function backSenjata() {
suara = new Sound();
suara.attachSound("backSenjata");
suara.start(0, 1);
}
function backBintang() {
suara = new Sound();
suara.attachSound("backBintang");
suara.start(0, 1);
}
function backRandom() {
suara = new Sound();
suara.attachSound("backRandom");
suara.start(0, 1);
}
function backMusuh() {
suara = new Sound();
suara.attachSound("backMusuh");
suara.start(0, 1);
}
function backKena() {
suara = new Sound();
suara.attachSound("backKena");
suara.start(0, 1);
}
function backDapet() {
suara = new Sound();
suara.attachSound("backDapet");
suara.start(0, 1);
}
function over() {
suara = new Sound();
suara.attachSound("over");
suara.start(0, 1);
}
function klik() {
suara = new Sound();
suara.attachSound("klik");
suara.start(0, 1);
}
stop();
if (satuKaliSaja) {
satuKaliSaja = false;
backSound();
}
enter_btn.onRelease = function () {
gotoAndStop ("main");
};
znama = new Array();
zskor = new Array();
zwarna = new Array();
rand3 = Math.random() * 1000000;
myData3 = new LoadVars();
myData3.load("dataSky.txt?" + rand3, myData3, "POST");
myData3.onLoad = function () {
z = 1;
while (z <= 10) {
znama[z] = eval ("myData3.nama" + String(z));
zskor[z] = eval ("myData3.skor" + String(z));
zwarna[z] = eval ("myData3.warna" + String(z));
if (znama[z] == "") {
znama[z] = "Kosong";
}
if (zskor[z] == "") {
zskor[z] = 0;
}
if (zwarna[z] == "") {
zwarna[z] = 0;
}
z++;
}
};
Frame 3
stop();
clearInterval(idTime);
start_btn.onRollOver = (top_btn.onRollOver = function () {
over();
});
start_btn.onRelease = function () {
klik();
gotoAndStop ("main");
};
top_btn.onRelease = function () {
klik();
gotoAndStop ("top");
};
Frame 4
function semuaFungsi() {
init();
buatMusuh();
buatMon();
buatKotak();
init2();
initMon();
input();
dalemKe++;
_root.attachMovie("menu_mc", "menu_mc", dalemKe);
i = 0;
while (i <= 5) {
menu_mc["life" + i].gotoAndStop(15);
i++;
}
i = 0;
while (i <= lifeKe) {
menu_mc["life" + i].gotoAndStop(1);
i++;
}
if (map <= 5) {
menu_mc.senjata_mc.gotoAndStop(1);
} else if (map <= 10) {
menu_mc.senjata_mc.gotoAndStop(2);
} else {
menu_mc.senjata_mc.gotoAndStop(3);
}
menu_mc._x = 7;
menu_mc._y = 560;
menu_mc.restart_btn.onRelease = function () {
resetSemua();
gotoAndStop ("instruction");
};
menu_mc.pause_btn.onRelease = function () {
if (xpause == "PAUSE") {
xpause = "CONTINUE";
menu_mc.xpause = xpause;
i = 0;
while (i <= keMusuh) {
_root["musuh_mc" + i].tipe.stop();
_root["musuh2_mc" + i].tipe.stop();
i++;
}
clearInterval(idTime);
} else {
xpause = "PAUSE";
menu_mc.xpause = xpause;
i = 0;
while (i <= keMusuh) {
_root["musuh_mc" + i].tipe.play();
_root["musuh2_mc" + i].tipe.play();
i++;
}
idTime = setInterval(waktu, 1000);
}
};
clearInterval(idTime);
idTime = setInterval(waktu, 1000);
}
function initAwal() {
idTime = setInterval(waktu, 1000);
map = 1;
xtime = 0;
score = 0;
lifeKe = 5;
jumlahBintang = 5;
speedMusuh1 = 5;
mapKe = "plus";
mapping1 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 5, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 1, 0, 0],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 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 7, 7, 0, 7, 7], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 7, 0, 7, 7], [0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 7, 7, 20, 7, 7], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12]];
mapping7 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 8, 8, 8, 8, 8, 8], [0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 0, 0, 0, 0, 0, 0], [4, 0, 0, 0, 0, 0, 0, 8, 8, 8, 0, 0, 0, 10, 0, 0], [12, 12, 12, 0, 0, 0, 0, 0, 0, 12, 12, 12, 12, 12, 0, 0], [0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0], [0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0], [0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 3], [0, 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 12, 12, 12, 12, 12], [0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0], [8, 0, 8, 0, 8, 18, 8, 0, 8, 0, 8, 21, 8, 10, 8, 20], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12]];
mapping8 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [21, 0, 0, 2, 5, 6, 7, 2, 8, 7, 6, 2, 0, 0, 9, 0], [0, 0, 0, 2, 5, 6, 7, 2, 8, 7, 6, 2, 0, 0, 0, 0], [0, 0, 0, 2, 5, 6, 7, 2, 8, 7, 6, 2, 0, 0, 0, 0], [0, 0, 0, 2, 5, 6, 7, 2, 8, 7, 6, 2, 0, 0, 0, 0], [0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0], [4, 0, 0, 2, 0, 0, 0, 2, 0, 0, 10, 2, 0, 11, 0, 0], [12, 12, 12, 2, 12, 12, 12, 2, 12, 12, 12, 2, 12, 12, 12, 12], [0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0], [0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0], [0, 0, 0, 2, 0, 10, 0, 2, 0, 0, 0, 2, 0, 0, 20, 3], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12]];
mapping9 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0], [0, 0, 0, 5, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3], [12, 0, 0, 0, 0, 0, 0, 0, 5, 0, 5, 0, 12, 12, 12, 12], [12, 0, 0, 12, 12, 12, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0], [0, 0, 0, 6, 0, 6, 0, 0, 6, 0, 6, 0, 0, 0, 0, 12], [0, 0, 0, 12, 12, 12, 0, 19, 12, 12, 12, 0, 0, 0, 0, 0], [12, 0, 0, 7, 0, 7, 0, 0, 7, 0, 7, 0, 0, 0, 0, 12], [20, 0, 0, 12, 12, 12, 0, 0, 12, 12, 12, 0, 0, 0, 0, 0], [12, 0, 0, 8, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12], [4, 0, 0, 12, 12, 12, 0, 0, 7, 10, 7, 0, 0, 21, 11, 0], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12]];
mapping10 = [[0, 0, 0, 0, 0, 5, 6, 7, 8, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 6, 7, 8, 0, 0, 0, 0, 0, 0, 0], [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [12, 2, 12, 0, 0, 5, 6, 7, 8, 0, 0, 0, 0, 0, 0, 0], [0, 2, 0, 0, 0, 5, 6, 7, 8, 0, 0, 0, 12, 12, 12, 12], [0, 2, 0, 0, 0, 5, 6, 7, 8, 0, 0, 0, 0, 0, 0, 0], [20, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 0], [9, 11, 0, 0, 21, 8, 8, 8, 8, 8, 11, 0, 0, 0, 0, 3], [12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12]];
mapping11 = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9], [0, 0, 0, 0, 21, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 13, 13, 13, 13, 0, 0, 13, 0, 0, 13, 0, 0, 0, 13], [0, 0, 13, 0, 5, 6, 7, 8, 7, 6, 5, 6, 7, 8, 0, 0], [0, 0, 0, 0, 5, 6, 7, 8, 7, 6, 5, 6, 7, 8, 0, 0], [0, 0, 13, 0, 5, 6, 7, 8, 7, 6, 5, 6, 7, 8, 0, 0], [0, 0, 0, 0, 5, 6, 7, 8, 7, 6, 5, 6, 7, 8, 0, 0], [0, 0, 13, 0, 5, 6, 7, 8, 7, 6, 5, 6, 7, 8, 0, 0], [0, 0, 0, 0, 5, 6, 7, 8, 7, 6, 5, 6, 7, 8, 0, 0], [0, 0, 13, 0, 0, 13, 0, 0, 13, 0, 0, 13, 0, 0, 13, 13], [4, 0, 0, 0, 0, 0, 0, 10, 0, 17, 0, 10, 0, 20, 0, 3], [13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13]];
mapping12 = [[9, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0], [13, 13, 13, 13, 0, 0, 13, 13, 13, 0, 13, 0, 0, 13, 2, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0], [0, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 11], [2, 13, 0, 0, 13, 0, 0, 13, 0, 0, 13, 0, 13, 13, 13, 13], [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [13, 0, 0, 13, 0, 0, 13, 0, 0, 0, 13, 0, 0, 13, 2, 13], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0], [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0], [13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13]];
}
function xcekPosisi() {
i = 0;
while (i <= panjang) {
j = 0;
while (j <= lebar) {
if (mapping[j][i] == 4) {
posisiX1 = (i * 25) + 100;
if (j != (lebar - 1)) {
posisiY1 = (j * 46) - 35;
} else {
posisiY1 = j * 46;
}
}
if (mapping[j][i] == 3) {
posisiX2 = (i * 25) + 300;
if (j != (lebar - 1)) {
posisiY2 = (j * 46) - 35;
} else {
posisiY2 = j * 46;
}
}
j++;
}
i++;
}
}
function waktu() {
if (xpause == "PAUSE") {
xtime++;
}
}
function init() {
panjang = 15;
lebar = 11;
dalemKe2 = 1;
dalemKe = 500;
xpause = "PAUSE";
mapping = this["mapping" + map];
adaSenjata = false;
tekanKey = false;
sedangKenaMusuh = false;
jalanKiri = false;
jalanKanan = false;
dalemKe++;
if (map == 1) {
this.attachMovie("back1", "back", dalemKe2);
} else if (map == 2) {
this.attachMovie("back2", "back", dalemKe2);
} else if (map == 3) {
this.attachMovie("back3", "back", dalemKe2);
} else if (map == 4) {
this.attachMovie("back4", "back", dalemKe2);
} else if (map == 5) {
this.attachMovie("back5", "back", dalemKe2);
} else if (map == 6) {
this.attachMovie("back6", "back", dalemKe2);
} else if (map == 7) {
this.attachMovie("back7", "back", dalemKe2);
} else if (map == 8) {
this.attachMovie("back8", "back", dalemKe2);
} else if (map == 9) {
this.attachMovie("back9", "back", dalemKe2);
} else if (map == 10) {
this.attachMovie("back10", "back", dalemKe2);
} else if (map == 11) {
this.attachMovie("back11", "back", dalemKe2);
} else if (map == 12) {
this.attachMovie("back12", "back", dalemKe2);
}
}
function init2() {
xcekPosisi();
if (mapKe == "plus") {
posisiX = posisiX1;
posisiY = posisiY1;
} else if (mapKe == "min") {
posisiX = posisiX2;
posisiY = posisiY2;
}
mon_mc._x = posisiX;
mon_mc._y = posisiY;
}
function buatMusuh() {
keMusuh = 0;
i = 0;
while (i <= panjang) {
j = 0;
while (j <= lebar) {
if (mapping[j][i] == 10) {
this.attachMovie("musuh_mc", "musuh_mc" + keMusuh, keMusuh + 300);
this["musuh_mc" + keMusuh]._x = i * 50;
this["musuh_mc" + keMusuh]._y = j * 50;
this["musuh_mc" + keMusuh]._visible = true;
keMusuh++;
} else if (mapping[j][i] == 11) {
this.attachMovie("musuh2_mc", "musuh2_mc" + keMusuh, keMusuh + 300);
this["musuh2_mc" + keMusuh]._x = i * 50;
this["musuh2_mc" + keMusuh]._y = j * 50;
this["musuh2_mc" + keMusuh]._visible = true;
keMusuh++;
}
j++;
}
i++;
}
}
function buatKotak() {
indi = 100;
i = 0;
while (i <= panjang) {
j = 0;
while (j <= lebar) {
ubahDalam("i", "j", "dalam");
namaBaru = "kotak" + dalam;
dalemKe++;
if (((mapping[j][i] == 1) || (mapping[j][i] == 12)) || (mapping[j][i] == 13)) {
this.attachMovie("kotak_mc", namaBaru, dalemKe);
if (mapping[j][i] == 1) {
this[namaBaru].gotoAndStop(1);
} else if (mapping[j][i] == 12) {
this[namaBaru].gotoAndStop(2);
} else if (mapping[j][i] == 13) {
this[namaBaru].gotoAndStop(3);
}
} else if (mapping[j][i] == 2) {
this.attachMovie("tangga_mc", namaBaru, indi + 1);
indi++;
} else if (mapping[j][i] == 3) {
namaBaru = "panah1_mc";
this.attachMovie("panah1_mc", "panah1_mc", dalemKe);
if (((map == 5) || (map == 10)) || (map == 12)) {
if (jumlahBintang == 0) {
panah1_mc.gotoAndStop(2);
} else {
panah1_mc.gotoAndStop(3);
}
}
if (map == 12) {
panah1_mc.gotoAndStop(4);
}
} else if ((((mapping[j][i] == 4) && (map != 1)) && (map != 6)) && (map != 11)) {
namaBaru = "panah2_mc";
this.attachMovie("panah2_mc", "panah2_mc", dalemKe);
} else if (mapping[j][i] == 5) {
this.attachMovie("bonus_mc", namaBaru, dalemKe);
this[namaBaru].anim_mc.gotoAndStop(1);
} else if (mapping[j][i] == 6) {
this.attachMovie("bonus_mc", namaBaru, dalemKe);
this[namaBaru].anim_mc.gotoAndStop(2);
} else if (mapping[j][i] == 7) {
this.attachMovie("bonus_mc", namaBaru, dalemKe);
this[namaBaru].anim_mc.gotoAndStop(3);
} else if (mapping[j][i] == 8) {
this.attachMovie("bonus_mc", namaBaru, dalemKe);
this[namaBaru].anim_mc.gotoAndStop(4);
} else if (mapping[j][i] == 9) {
this.attachMovie("bonus_mc", namaBaru, dalemKe);
this[namaBaru].anim_mc.gotoAndStop(5);
} else if (mapping[j][i] == 17) {
this.attachMovie("ranjau_mc", namaBaru, dalemKe);
this[namaBaru].gotoAndStop(1);
} else if (mapping[j][i] == 18) {
this.attachMovie("ranjau_mc", namaBaru, dalemKe);
this[namaBaru].gotoAndStop(2);
} else if (mapping[j][i] == 19) {
this.attachMovie("ranjau_mc", namaBaru, dalemKe);
this[namaBaru].gotoAndStop(3);
} else if (mapping[j][i] == 20) {
this.attachMovie("tiang_mc", namaBaru, dalemKe);
this[namaBaru].gotoAndStop(1);
if (map <= 5) {
this[namaBaru].tiang_ada.gotoAndStop(1);
} else if (map <= 10) {
this[namaBaru].tiang_ada.gotoAndStop(2);
} else {
this[namaBaru].tiang_ada.gotoAndStop(3);
}
} else if (mapping[j][i] == 21) {
this.attachMovie("random_mc", namaBaru, dalemKe);
}
this[namaBaru]._x = i * 50;
this[namaBaru]._y = j * 50;
j++;
}
i++;
}
}
function kenaKotak(char) {
kondisiKotak = false;
i = 0;
while (i <= panjang) {
j = 0;
while (j <= lebar) {
ubahDalam("i", "j", "dalam");
namaBaru = "kotak" + dalam;
if (((mapping[j][i] == 1) || (mapping[j][i] == 12)) || (mapping[j][i] == 13)) {
if (char.indi.hitTest(this[namaBaru].indi)) {
char._y = this[namaBaru]._y - 90;
kondisiKotak = true;
i = panjang;
j = lebar;
}
}
j++;
}
i++;
}
}
function kenaPagar(char) {
kondisiPagar = false;
i = 0;
while (i <= panjang) {
j = 0;
while (j <= lebar) {
ubahDalam("i", "j", "dalam");
namaBaru = "kotak" + dalam;
if (mapping[j][i] == 2) {
if (char.indi.hitTest(this[namaBaru].indi)) {
kondisiPagar = true;
i = panjang;
j = lebar;
}
}
j++;
}
i++;
}
}
function buatMon() {
this.attachMovie("mon_mc", "mon_mc", 200);
if (mapKe == "plus") {
mon_mc.gotoAndStop(1);
} else {
mon_mc.gotoAndStop(2);
}
mon_mc.onEnterFrame = enterMon;
}
function initMon() {
loncat = false;
speedVerMon = 20;
speedTanggaMon = 0;
speedTanggaMon2 = 0;
speedTangga = 6;
speedHorMon = 10;
akselMon = 2;
}
function initMon2() {
xloncat = true;
tunduk = false;
loncat2 = false;
speedVerMon2 = 4;
akselMon2 = 3;
}
function enterMon() {
if (xpause == "PAUSE") {
updateAfterEvent();
kenaPagar(this);
if (kondisiPagar && (speedTanggaMon == speedTangga)) {
this._y = this._y - speedTanggaMon;
} else if (kondisiPagar && (speedTanggaMon2 == speedTangga)) {
this._y = this._y + speedTanggaMon2;
} else if (!kondisiPagar) {
if (loncat) {
loncat2 = true;
this._y = this._y - speedVerMon;
speedVerMon = speedVerMon - akselMon;
if (speedVerMon <= 0) {
initMon();
} else if (this._y <= 0) {
}
} else {
kenaKotak(this);
if (!kondisiKotak) {
loncat2 = true;
this._y = this._y + speedVerMon2;
speedVerMon2 = speedVerMon2 + akselMon2;
} else {
if ((tunduk == false) || (xloncat == true)) {
loncat2 = true;
if (sedangKenaMusuh == false) {
mon_mc.mon_aksi.gotoAndStop(1);
}
}
initMon();
initMon2();
xloncat = false;
tunduk = true;
}
}
}
if (jalanKanan) {
if (this._x < 750) {
mon_mc.gotoAndStop(1);
if (loncat) {
mon_mc.mon_aksi.gotoAndStop(4);
}
if (!xloncat) {
if (sedangKenaMusuh == false) {
mon_mc.mon_aksi.gotoAndStop(3);
}
}
this._x = this._x + speedHorMon;
}
} else if (jalanKiri) {
if (this._x > 0) {
mon_mc.gotoAndStop(2);
if (loncat) {
mon_mc.mon_aksi.gotoAndStop(4);
}
if (!xloncat) {
if (sedangKenaMusuh == false) {
mon_mc.mon_aksi.gotoAndStop(3);
}
}
this._x = this._x - speedHorMon;
}
}
if (this.hitTest(panah1_mc.indi)) {
if (panah1_mc._currentframe == 4) {
if (jumlahBintang == 0) {
pindahLayar("plus");
}
} else if (panah1_mc._currentframe != 3) {
pindahLayar("plus");
}
} else if (this.hitTest(panah2_mc.indi)) {
pindahLayar("min");
}
i = 0;
while (i <= keMusuh) {
if (this.hitTest(_root["musuh_mc" + i])) {
if (sedangKenaMusuh == false) {
backMusuh();
mon_mc.mon_aksi.gotoAndStop(9);
menu_mc["life" + lifeKe].gotoAndStop("ilang");
lifeKe--;
if (lifeKe < 0) {
cekLose();
}
}
}
if (this.hitTest(_root["musuh2_mc" + i])) {
if (mon_mc.mon_aksi._currentframe != 9) {
cekLose();
}
}
i++;
}
i = 0;
while (i <= panjang) {
j = 0;
while (j <= lebar) {
ubahDalam("i", "j", "dalam");
namaBaru = "kotak" + dalam;
if (mapping[j][i] == 21) {
if (this.hitTest(_root[namaBaru]) && (_root[namaBaru]._visible == true)) {
backRandom();
_root[namaBaru]._visible = false;
rand = random(3);
if (rand == 0) {
score = score + (random(1000) + 1000);
} else if (rand == 1) {
if (lifeKe < 4) {
lifeKe++;
menu_mc["life" + lifeKe].gotoAndStop(1);
} else {
score = score + (random(1000) + 1000);
xtime = xtime - (random(60) + 60);
if (xtime <= 0) {
xtime = 0;
}
}
} else if (rand == 2) {
xtime = xtime - (random(60) + 60);
if (xtime <= 0) {
xtime = 0;
}
}
if (map == 1) {
mapping1[j][i] = 0;
} else if (map == 2) {
mapping2[j][i] = 0;
} else if (map == 3) {
mapping3[j][i] = 0;
} else if (map == 4) {
mapping4[j][i] = 0;
} else if (map == 5) {
mapping5[j][i] = 0;
} else if (map == 6) {
mapping6[j][i] = 0;
} else if (map == 7) {
mapping7[j][i] = 0;
} else if (map == 8) {
mapping8[j][i] = 0;
} else if (map == 9) {
mapping9[j][i] = 0;
} else if (map == 10) {
mapping10[j][i] = 0;
} else if (map == 11) {
mapping11[j][i] = 0;
} else if (map == 12) {
mapping12[j][i] = 0;
}
}
} else if (mapping[j][i] == 20) {
if (_root[namaBaru]._currentframe == 1) {
if (this.hitTest(_root[namaBaru])) {
backDapet();
adaSenjata = true;
_root[namaBaru].gotoAndStop(2);
}
}
} else if ((mapping[j][i] >= 17) && (mapping[j][i] <= 19)) {
if (this.hitTest(_root[namaBaru])) {
if (_root[namaBaru]._visible == true) {
if (_root[namaBaru]._currentframe == 1) {
score = score - 1000;
mon_mc.mon_aksi.gotoAndStop(9);
} else if (_root[namaBaru]._currentframe == 2) {
if (mon_mc.mon_aksi._currentframe != 9) {
menu_mc["life" + lifeKe].gotoAndStop("ilang");
lifeKe--;
mon_mc.mon_aksi.gotoAndStop(9);
if (lifeKe < 0) {
cekLose();
}
}
} else if (_root[namaBaru]._currentframe == 3) {
if (map <= 5) {
map = 4;
} else if (map <= 10) {
map = 9;
} else {
map = 11;
}
pindahLayar("plus");
}
_root[namaBaru]._visible = false;
}
}
} else if ((mapping[j][i] >= 5) && (mapping[j][i] <= 9)) {
if (this.hitTest(_root[namaBaru])) {
if (_root[namaBaru]._currentframe == 1) {
if (_root[namaBaru].anim_mc._currentframe == 5) {
jumlahBintang--;
score = score + 5000;
backBintang();
if (jumlahBintang <= 0) {
if (map != 12) {
panah1_mc.gotoAndStop(2);
}
}
} else {
backKena();
}
score = score + ((mapping[j][i] - 4) * 100);
_root[namaBaru].gotoAndPlay(2);
if (map == 1) {
mapping1[j][i] = 0;
} else if (map == 2) {
mapping2[j][i] = 0;
} else if (map == 3) {
mapping3[j][i] = 0;
} else if (map == 4) {
mapping4[j][i] = 0;
} else if (map == 5) {
mapping5[j][i] = 0;
} else if (map == 6) {
mapping6[j][i] = 0;
} else if (map == 7) {
mapping7[j][i] = 0;
} else if (map == 8) {
mapping8[j][i] = 0;
} else if (map == 9) {
mapping9[j][i] = 0;
} else if (map == 10) {
mapping10[j][i] = 0;
} else if (map == 11) {
mapping11[j][i] = 0;
} else if (map == 12) {
mapping12[j][i] = 0;
}
}
}
}
j++;
}
i++;
}
}
}
function cekLose() {
resetSemua();
gotoAndStop ("lose");
}
function pindahLayar(indi) {
backPindah();
if (indi == "plus") {
map++;
mapKe = "plus";
if (map == 6) {
jumlahBintang = 5;
} else if (map == 11) {
jumlahBintang = 2;
}
if (map > 12) {
resetSemua();
gotoAndStop ("win");
} else {
resetSemua();
semuaFungsi();
}
} else if (indi == "min") {
map--;
mapKe = "min";
resetSemua();
semuaFungsi();
}
}
function keluarSenjata() {
this.attachMovie("senjata_mc", "senjata_mc", 10000);
senjata_mc._x = mon_mc._x;
senjata_mc._y = mon_mc._y + 50;
if (map <= 5) {
senjata_mc.senjata_anim.gotoAndStop(1);
} else if (map <= 10) {
senjata_mc.senjata_anim.gotoAndStop(2);
} else {
senjata_mc.senjata_anim.gotoAndStop(3);
}
senjata_mc.gotoAndStop(mon_mc._currentframe);
senjata_mc.onEnterFrame = enterSenjata;
i = 0;
while (i <= panjang) {
j = 0;
while (j <= lebar) {
ubahDalam("i", "j", "dalam");
namaBaru = "kotak" + dalam;
if (mapping[j][i] == 20) {
_root[namaBaru].gotoAndStop(1);
if (map <= 5) {
_root[namaBaru].tiang_ada.gotoAndStop(1);
} else if (map <= 10) {
_root[namaBaru].tiang_ada.gotoAndStop(2);
} else {
_root[namaBaru].tiang_ada.gotoAndStop(3);
}
}
j++;
}
i++;
}
}
function enterSenjata() {
if (xpause == "PAUSE") {
if (this._currentframe == 1) {
this._x = this._x + 100;
} else if (this._currentframe == 2) {
this._x = this._x - 100;
}
if ((this._x > 1000) || (this._x < -200)) {
removeMovieClip(this);
}
i = 0;
while (i <= keMusuh) {
if (_root["musuh_mc" + i]._currentframe == 1) {
if (this.hitTest(_root["musuh_mc" + i])) {
_root["musuh_mc" + i].gotoAndStop("mati");
removeMovieClip(this);
}
}
if (_root["musuh2_mc" + i]._currentframe == 1) {
if (this.hitTest(_root["musuh2_mc" + i])) {
_root["musuh2_mc" + i].gotoAndStop("mati");
removeMovieClip(this);
}
}
i++;
}
}
}
function resetSemua() {
clearInterval(idTime);
i = 0;
while (i <= panjang) {
j = 0;
while (j <= lebar) {
ubahDalam("i", "j", "dalam");
namaBaru = "kotak" + dalam;
removeMovieClip(namaBaru);
j++;
}
i++;
}
i = 0;
while (i <= 100) {
removeMovieClip(_root["musuh_mc" + i]);
removeMovieClip(_root["musuh2_mc" + i]);
_root["musuh_mc" + i]._visible = false;
_root["musuh2_mc" + i]._visible = false;
i++;
}
removeMovieClip("menu_mc");
removeMovieClip("back");
removeMovieClip("latar_mc");
removeMovieClip("panah1_mc");
removeMovieClip("panah2_mc");
removeMovieClip("mon_mc");
delete mon_mc.onEnterFrame;
}
function ubahDalam(i, j, dalam) {
if ((this[i] < 10) && (this[j] < 10)) {
this[dalam] = (("0" + String(this[i])) + "0") + String(this[j]);
} else if ((this[i] < 10) && (this[j] >= 10)) {
this[dalam] = ("0" + String(this[i])) + String(this[j]);
} else if ((this[i] >= 10) && (this[j] < 10)) {
this[dalam] = (String(this[i]) + "0") + String(this[j]);
} else {
this[dalam] = String(this[i]) + String(this[j]);
}
}
function input() {
myListener = new Object();
myListener.onKeyDown = function () {
if (xpause == "PAUSE") {
if (Key.getCode() == 38) {
if (kondisiPagar == true) {
if (sedangKenaMusuh == false) {
mon_mc.mon_aksi.gotoAndStop(5);
}
speedTanggaMon = speedTangga;
} else if (!loncat2) {
backLompat();
xloncat = true;
loncat = true;
if (sedangKenaMusuh == false) {
mon_mc.mon_aksi.gotoAndStop(4);
}
}
}
if (Key.getCode() == 40) {
if (kondisiPagar == true) {
if (sedangKenaMusuh == false) {
mon_mc.mon_aksi.gotoAndStop(7);
}
speedTanggaMon2 = speedTangga;
} else if (!loncat2) {
tunduk = true;
if (sedangKenaMusuh == false) {
mon_mc.mon_aksi.gotoAndStop(2);
}
}
}
if (Key.getCode() == 39) {
if (!loncat2) {
tunduk = true;
if (mon_mc.mon_aksi._currentframe == 1) {
if (sedangKenaMusuh == false) {
mon_mc.mon_aksi.gotoAndStop(3);
}
}
}
jalanKanan = true;
} else if (Key.getCode() == 37) {
if (!loncat2) {
tunduk = true;
if (sedangKenaMusuh == false) {
mon_mc.mon_aksi.gotoAndStop(3);
}
}
jalanKiri = true;
}
if (Key.getCode() == 32) {
if (adaSenjata == true) {
adaSenjata = false;
backSenjata();
keluarSenjata();
}
}
}
};
myListener.onKeyUp = function () {
if (sedangKenaMusuh == false) {
mon_mc.mon_aksi.gotoAndStop(1);
}
speedTanggaMon = 0;
speedTanggaMon2 = 0;
if (Key.getCode() == 39) {
jalanKanan = false;
}
if (Key.getCode() == 37) {
jalanKiri = false;
}
if (Key.getCode() == 40) {
tunduk = false;
}
if (Key.getCode() == 38) {
if (kondisiPagar == true) {
if (sedangKenaMusuh == false) {
mon_mc.mon_aksi.gotoAndStop(6);
}
}
}
if (Key.getCode() == 40) {
if (kondisiPagar == true) {
if (sedangKenaMusuh == false) {
mon_mc.mon_aksi.gotoAndStop(8);
}
}
}
};
Key.addListener(myListener);
}
stop();
initAwal();
semuaFungsi();
this.onEnterFrame = function () {
menu_mc.score = score;
if (adaSenjata == true) {
menu_mc.senjata_mc._visible = true;
} else {
menu_mc.senjata_mc._visible = false;
}
menit = Math.floor(xtime / 60);
detik = Math.floor(xtime - (menit * 60));
zlevel = "LEVEL " + wlevel;
if (menit < 10) {
menit = "0" + menit;
}
if (detik < 10) {
detik = "0" + detik;
}
if (int(menit) >= 1) {
menu_mc.xtime = (menit + ".") + detik;
} else {
menu_mc.xtime = "00." + detik;
}
};
Frame 5
stop();
ending_mc.restart_btn.onRollOver = function () {
over();
};
ending_mc.restart_btn.onRelease = function () {
klik();
_root.gotoAndStop("loader");
delete _root.onEnterFrame;
};
Frame 6
stop();
ending_mc.restart_btn.onRollOver = function () {
over();
};
ending_mc.restart_btn.onRelease = function () {
klik();
_root.gotoAndStop("loader");
delete _root.onEnterFrame;
};
Symbol 24 MovieClip Frame 9
gotoAndPlay(random(20) + 10);
Symbol 25 MovieClip Frame 11
gotoAndPlay(random(20) + 10);
Symbol 31 MovieClip Frame 3
gotoAndPlay(random(30) + 5);
Symbol 38 MovieClip Frame 5
rand = random(2);
if (rand == 0) {
gotoAndPlay ("cengir");
} else {
gotoAndPlay ("melet");
}
Symbol 38 MovieClip Frame 30
gotoAndPlay (1);
Symbol 38 MovieClip Frame 60
gotoAndPlay (1);
Symbol 41 MovieClip Frame 5
rand = random(3);
if (rand == 0) {
gotoAndPlay ("turun");
} else if (rand == 1) {
gotoAndPlay ("nengok");
} else if (rand == 2) {
gotoAndPlay ("ngadep");
}
Symbol 41 MovieClip Frame 30
gotoAndPlay (1);
Symbol 41 MovieClip Frame 80
gotoAndPlay (1);
Symbol 90 MovieClip Frame 1
play();
_root.sedangKenaMusuh = true;
Symbol 90 MovieClip Frame 39
_root.sedangKenaMusuh = false;
Symbol 90 MovieClip Frame 40
_parent.gotoAndStop(1);
Symbol 91 MovieClip Frame 1
stop();
Symbol 94 MovieClip [mon_mc] Frame 1
stop();
Symbol 99 MovieClip [kotak_mc] Frame 1
stop();
Symbol 110 MovieClip [panah1_mc] Frame 1
stop();
Symbol 151 MovieClip Frame 1
stop();
Symbol 151 MovieClip Frame 5
play();
Symbol 151 MovieClip Frame 15
stop();
Symbol 158 MovieClip Frame 1
stop();
Symbol 169 MovieClip Frame 1
stop();
Symbol 170 MovieClip [bonus_mc] Frame 1
stop();
Symbol 170 MovieClip [bonus_mc] Frame 2
play();
Symbol 170 MovieClip [bonus_mc] Frame 10
stop();
Symbol 182 MovieClip [musuh2_mc] Frame 1
stop();
Symbol 182 MovieClip [musuh2_mc] Frame 10
play();
Symbol 182 MovieClip [musuh2_mc] Frame 11
removeMovieClip(this);
Symbol 189 MovieClip Frame 30
rand = random(3);
if (rand == 0) {
gotoAndPlay ("jenis1");
} else if (rand == 1) {
gotoAndPlay ("jenis2");
} else if (rand == 2) {
gotoAndPlay ("jenis3");
}
Symbol 190 MovieClip [musuh_mc] Frame 1
stop();
Symbol 190 MovieClip [musuh_mc] Frame 10
play();
Symbol 190 MovieClip [musuh_mc] Frame 11
removeMovieClip(this);
Symbol 194 MovieClip [ranjau_mc] Frame 1
stop();
Symbol 196 MovieClip Frame 1
stop();
Symbol 198 MovieClip [tiang_mc] Frame 1
stop();
Symbol 199 MovieClip Frame 1
stop();
Symbol 200 MovieClip [senjata_mc] Frame 1
stop();
Symbol 214 MovieClip Frame 35
stop();
Symbol 217 MovieClip Frame 1
stop();
Symbol 229 Button
on (press) {
_root.gotoAndStop("instruction");
}
Symbol 235 MovieClip Frame 12
stop();
Symbol 236 Button
on (release) {
getURL ("http://www.dailyfreegames.com", "_blank");
}
Symbol 238 Button
on (release) {
getURL ("http://www.dailyfreegames.com/free-games.html", "_blank");
}
Symbol 311 MovieClip Frame 1
submit_btn._visible = false;
restart_btn._visible = false;
Symbol 311 MovieClip Frame 105
stop();
submit_btn._visible = true;
xskor = _root.score;
restart_btn._visible = true;
Symbol 314 MovieClip Frame 1
submit_btn._visible = false;
Symbol 314 MovieClip Frame 16
stop();
restart_btn.onRelease = function () {
_root.gotoAndStop("loader");
};
submit_btn._visible = true;
xskor = _root.score;