Frame 1
stop();
this.onEnterFrame = function () {
sedang = _root.getBytesLoaded();
total = _root.getBytesTotal();
xpersen = Math.floor((sedang / total) * 100);
persen = xpersen + " %";
wpersen = Math.floor(xpersen);
bar_mc.gotoAndStop(Math.floor(xpersen / 10));
if (sedang == total) {
gotoAndPlay ("credits");
delete this.onEnterFrame;
}
};
Frame 5
stop();
myLagu.stop();
easy_btn.onRelease = function () {
xlevel = "EASY";
gotoAndStop ("game");
};
medium_btn.onRelease = function () {
xlevel = "MEDIUM";
gotoAndStop ("game");
};
hard_btn.onRelease = function () {
xlevel = "HARD";
gotoAndStop ("game");
};
Frame 14
function backSound() {
mySound = new Sound();
mySound.attachSound("backSound");
mySound.start(0, 999);
}
function back2() {
myLagu = new Sound();
myLagu.attachSound("back2");
myLagu.start(0, 999);
}
function tuing() {
mySuara = new Sound("sound2");
mySuara.attachSound("tuing");
mySuara.start(1, 1);
}
function tuing() {
mySuara = new Sound("sound2");
mySuara.attachSound("tuing");
mySuara.start(1, 1);
}
function poing2() {
mySuara = new Sound("sound2");
mySuara.attachSound("poing2");
mySuara.start(0, 1);
}
function failure1() {
mySuara = new Sound("sound2");
mySuara.attachSound("failure1");
mySuara.start(0, 1);
}
function bluk() {
mySuara = new Sound("sound2");
mySuara.attachSound("bluk");
mySuara.start(3.75, 1);
}
function uang() {
mySuara = new Sound("sound2");
mySuara.attachSound("uang");
mySuara.start(0, 1);
}
function duar() {
mySuara = new Sound("sound2");
mySuara.attachSound("duar");
mySuara.start(0, 1);
}
function loss() {
mySuara = new Sound("sound2");
mySuara.attachSound("loss");
mySuara.start(0, 1);
}
function winning() {
mySuara = new Sound("sound2");
mySuara.attachSound("winning");
mySuara.start(0, 1);
}
function xxbonus() {
mySuara = new Sound("sound2");
mySuara.attachSound("xxbonus");
mySuara.start(0, 1);
}
function explosion() {
mySuara = new Sound("sound2");
mySuara.attachSound("explosion");
mySuara.start(0, 1);
}
function explosion2() {
mySuara = new Sound("sound2");
mySuara.attachSound("explosion2");
mySuara.start(0, 1);
}
function explosion3() {
mySuara = new Sound("sound2");
mySuara.attachSound("explosion3");
mySuara.start(0, 1);
}
function klik() {
mySuara = new Sound("sound2");
mySuara.attachSound("klik");
mySuara.start(0, 1);
}
function over() {
mySuara = new Sound("sound2");
mySuara.attachSound("over");
mySuara.start(0, 1);
}
function door() {
mySuara = new Sound("sound2");
mySuara.attachSound("door");
mySuara.start(0, 1);
}
function warp() {
mySuara = new Sound("sound2");
mySuara.attachSound("warp");
mySuara.start(0, 1);
}
function xlive() {
mySuara = new Sound("sound2");
mySuara.attachSound("xlive");
mySuara.start(0, 1);
}
function missle() {
mySuara = new Sound("sound2");
mySuara.attachSound("missle");
mySuara.start(0, 1);
}
function xcolor() {
mySuara = new Sound("sound2");
mySuara.attachSound("xcolor");
mySuara.start(0, 1);
}
function thunder() {
mySuara = new Sound("sound2");
mySuara.attachSound("thunder");
mySuara.start(0, 1);
}
function cekStop() {
luas = panjang * lebar;
ix = 0;
while (ix <= luas) {
if (pos >= 1) {
cekRangkaian();
} else {
ix = luas;
}
ix++;
}
}
function hapusAku() {
clearInterval(idGame);
clearInterval(idKotak);
clearInterval(idAnimSelesai);
clearInterval(idAnimGame);
clearInterval(idGeser);
clearInterval(idWaktu);
delete _root.onEnterFrame;
delete _root.onMouseDown;
i = 0;
while (i <= panjang) {
j = 0;
while (j <= lebar) {
ubahDalam("j", "i", "dalam");
removeMovieClip(_root["kotak_mc" + dalam]);
j++;
}
i++;
}
i = 0;
while (i <= panjang) {
removeMovieClip("kotakBawah_mc" + i);
i++;
}
removeMovieClip("muncul_mc");
removeMovieClip("bonus_mc");
removeMovieClip("help_mc");
removeMovieClip("msgBox_mc");
}
function cekRangkaian() {
ii[pos] = x;
jj[pos] = y;
tanda[ii[pos]][jj[pos]] = warna;
qi = ii[pos];
qj = jj[pos];
ubahDalam("qj", "qi", "yydalam");
xxdalam[jmlHilang] = yydalam;
iiMin[pos] = ii[pos] - 1;
iiPlus[pos] = ii[pos] + 1;
jjMin[pos] = jj[pos] - 1;
jjPlus[pos] = jj[pos] + 1;
if ((warnaKotak[iiMin[pos]][jj[pos]] == warnaKotak[ii[pos]][jj[pos]]) && (tanda[iiMin[pos]][jj[pos]] == 0)) {
tanda[iiMin[pos]][jj[pos]] = warna;
qi = iiMin[pos];
qj = jj[pos];
ubahDalam("qj", "qi", "yydalam");
xxdalam[jmlHilang] = yydalam;
x = iiMin[pos];
y = jj[pos];
pos++;
jmlHilang++;
} else if ((warnaKotak[iiPlus[pos]][jj[pos]] == warnaKotak[ii[pos]][jj[pos]]) && (tanda[iiPlus[pos]][jj[pos]] == 0)) {
tanda[iiPlus[pos]][jj[pos]] = warna;
qi = iiPlus[pos];
qj = jj[pos];
ubahDalam("qj", "qi", "yydalam");
xxdalam[jmlHilang] = yydalam;
x = iiPlus[pos];
y = jj[pos];
pos++;
jmlHilang++;
} else if ((warnaKotak[ii[pos]][jjMin[pos]] == warnaKotak[ii[pos]][jj[pos]]) && (tanda[ii[pos]][jjMin[pos]] == 0)) {
tanda[ii[pos]][jjMin[pos]] = warna;
qi = ii[pos];
qj = jjMin[pos];
ubahDalam("qj", "qi", "yydalam");
xxdalam[jmlHilang] = yydalam;
x = ii[pos];
y = jjMin[pos];
pos++;
jmlHilang++;
} else if ((warnaKotak[ii[pos]][jjPlus[pos]] == warnaKotak[ii[pos]][jj[pos]]) && (tanda[ii[pos]][jjPlus[pos]] == 0)) {
tanda[ii[pos]][jjPlus[pos]] = warna;
qi = ii[pos];
qj = jjPlus[pos];
ubahDalam("qj", "qi", "yydalam");
xxdalam[jmlHilang] = yydalam;
x = ii[pos];
y = jjPlus[pos];
pos++;
jmlHilang++;
} else {
pos--;
x = ii[pos];
y = jj[pos];
}
}
function initAwal() {
pause_btn.enabled = true;
paused = false;
skor = 0;
level = 1;
wlevel = 1;
destroyed = 0;
tandaLevel = 0;
if (xlevel == "EASY") {
buah_mc.gotoAndStop(1);
nyawa_mc.gotoAndStop(1);
kombinasi = "Fruits combination";
infoWaktu = "Times limitation";
xwaktu = 120;
xxwaktu = xwaktu;
kesempatan = "Lives game";
hadiah_mc._visible = false;
ranjau_mc._visible = false;
live = 4;
banyakKotak = 3;
} else if (xlevel == "MEDIUM") {
buah_mc.gotoAndStop(2);
nyawa_mc.gotoAndStop(2);
kombinasi = "Fruits combination";
infoWaktu = "Times limitation";
xwaktu = 90;
xxwaktu = xwaktu;
kesempatan = "Lives game";
hadiah_mc._visible = true;
ranjau_mc._visible = false;
live = 3;
banyakKotak = 4;
} else if (xlevel == "HARD") {
buah_mc.gotoAndStop(3);
nyawa_mc.gotoAndStop(3);
kombinasi = "Fruits combination";
infoWaktu = "Times limitation";
xwaktu = 60;
xxwaktu = xwaktu;
kesempatan = "Lives game";
hadiah_mc._visible = true;
ranjau_mc._visible = true;
live = 2;
banyakKotak = 5;
}
i = 1;
while (i <= 4) {
this["xlive" + i]._visible = false;
this["xlive" + i].gotoAndStop(1);
i++;
}
i = 1;
while (i <= live) {
this["xlive" + i]._visible = true;
this["xlive" + i].gotoAndStop(1);
i++;
}
idWaktu = setInterval(vwaktu, 1000);
}
function vwaktu() {
if (sedangJalan != false) {
xwaktu--;
if (xwaktu <= 0) {
xwaktu = 0;
sedangJalan = false;
clearInterval(idKotak);
delete _root.onEnterFrame;
delete _root.onMouseDown;
muncul_mc.bawah_btn.enabled = false;
di = awal;
dj = lebar;
win();
clearInterval(idWaktu);
}
}
}
function gameOver() {
clearInterval(idGame);
pause_btn.enabled = false;
j = 0;
while (j <= lebar) {
i = 0;
while (i <= panjang) {
ubahDalam("j", "i", "dalam1");
indiWarna = _root["kotak_mc" + dalam1]._currentframe - 1;
myWarna = new Color(_root["kotak_mc" + dalam1].ledakan_mc);
myWarna.setRGB(warnaHancur[indiWarna]);
_root["kotak_mc" + dalam1].ledakan_mc.gotoAndPlay(2);
_root["kotak_mc" + dalam1].gotoAndStop(kotakKosong);
i++;
}
j++;
}
monyet_mc.gotoAndPlay("jatuh");
}
function win() {
zwaktu = "00.00";
pause_btn.enabled = false;
j = 0;
while (j <= lebar) {
i = 0;
while (i <= panjang) {
ubahDalam("j", "i", "dalam1");
indiWarna = _root["kotak_mc" + dalam1]._currentframe - 1;
myWarna = new Color(_root["kotak_mc" + dalam1].ledakan_mc);
myWarna.setRGB(warnaHancur[indiWarna]);
_root["kotak_mc" + dalam1].ledakan_mc.gotoAndPlay(2);
_root["kotak_mc" + dalam1].gotoAndStop(kotakKosong);
i++;
}
j++;
}
win_mc.gotoAndPlay("lanjut");
}
function init(xindi) {
panjang = 10;
lebar = 8;
dalam1 = 1;
randMinus = 0;
xlewat = random(16);
deltaX = int(899 / panjang);
deltaY = int(541 / lebar);
satuKaliUang = false;
satuKaliBom = false;
satuKaliBom2 = false;
satuKaliMacem = false;
satuKaliColor = false;
satuKaliHancur = false;
sedangJalan = true;
sudahGeser = false;
onKlik = false;
muncul_mc.bawah_btn.enabled = true;
if (level == 1) {
awal = 11;
akhir = 19;
if (xindi != "live") {
line = 20;
}
speed = 500;
} else if (level == 2) {
awal = 10;
akhir = 20;
if (xindi != "live") {
line = 22;
}
speed = 500;
} else if (level == 3) {
awal = 9;
akhir = 21;
if (xindi != "live") {
line = 24;
}
speed = 500;
} else if (level == 4) {
awal = 8;
akhir = 22;
if (xindi != "live") {
line = 26;
}
speed = 500;
} else if (level == 5) {
awal = 7;
akhir = 23;
if (xindi != "live") {
line = 28;
}
speed = 500;
} else if (level == 6) {
awal = 6;
akhir = 24;
if (xindi != "live") {
line = 30;
}
speed = 500;
} else if (level == 7) {
awal = 5;
akhir = 25;
if (xindi != "live") {
line = 32;
}
speed = 400;
} else if (level == 8) {
awal = 4;
akhir = 26;
if (xindi != "live") {
line = 34;
}
speed = 400;
} else if (level == 9) {
awal = 3;
akhir = 27;
if (xindi != "live") {
line = 36;
}
speed = 400;
} else if (level == 10) {
awal = 2;
akhir = 28;
if (xindi != "live") {
line = 38;
}
speed = 400;
} else if (level == 11) {
awal = 1;
akhir = 29;
if (xindi != "live") {
line = 40;
}
speed = 400;
} else if (level == 12) {
awal = 0;
akhir = 30;
if (xindi != "live") {
line = 45;
}
speed = 300;
} else if (level == 13) {
awal = 0;
akhir = 30;
if (xindi != "live") {
line = 50;
}
speed = 300;
} else if (level == 14) {
awal = 0;
akhir = 30;
if (xindi != "live") {
line = 55;
}
speed = 300;
} else if (level == 15) {
awal = 0;
akhir = 30;
if (xindi != "live") {
line = 60;
}
speed = 200;
} else if (level == 16) {
awal = 0;
akhir = 30;
if (xindi != "live") {
line = 70;
}
speed = 200;
} else if (level == 17) {
awal = 0;
akhir = 30;
if (xindi != "live") {
line = 80;
}
speed = 200;
} else if (level == 18) {
awal = 0;
akhir = 30;
if (xindi != "live") {
line = 90;
}
speed = 150;
} else if (level == 19) {
awal = 0;
akhir = 30;
if (xindi != "live") {
line = 95;
}
speed = 150;
} else if (level == 20) {
awal = 0;
akhir = 30;
if (xindi != "live") {
line = 100;
}
speed = 100;
}
awal = 0;
akhir = 10;
jarak = akhir - awal;
kotakKosong = 7;
xjmlHilang = 1;
sekarang = awal;
acak = new Array();
jj = new Array();
ii = new Array();
jjMin = new Array();
jjPlus = new Array();
iiMin = new Array();
iiPlus = new Array();
zzdalam = new Array();
warnaHancur = new Array("0xFFFFFF", "0xFF9900", "0xFF0000", "0x00FF00", "0xFFFF00", "0x00FF00");
simpanSementara = new Array();
i = awal;
while (i <= akhir) {
simpanSementara[i] = new Array();
j = 0;
while (j <= lebar) {
simpanSementara[i][j] = kotakKosong;
j++;
}
i++;
}
}
function reset() {
pos = 1;
jmlHilang = 1;
warnaKotak = new Array();
i = awal;
while (i <= akhir) {
warnaKotak[i] = new Array();
j = 0;
while (j <= lebar) {
warnaKotak[i][j] = 0;
j++;
}
i++;
}
x = 99;
y = 99;
tanda = new Array();
xxdalam = new Array();
i = 0;
while (i <= 99) {
jj[i] = 99;
ii[i] = 99;
jjMin[i] = 99;
jjPlus[i] = 99;
iiMin[i] = 99;
iiPlus[i] = 99;
i++;
}
i = awal;
while (i <= akhir) {
tanda[i] = new Array();
j = 0;
while (j <= lebar) {
tanda[i][j] = 0;
j++;
}
i++;
}
}
function control() {
muncul_mc.bawah_btn.onRollOver = function () {
over();
};
muncul_mc.bawah_btn.onRelease = function () {
onKlik = true;
sekarang = akhir;
m = awal;
while (m <= akhir) {
_root["kotakBawah_mc" + m]._visible = true;
_root["kotakBawah_mc" + m].gotoAndStop(acak[m]);
m++;
}
clearInterval(idGeser);
idGeser = setInterval(geserSemua, 500);
};
pause_btn.onRollOver = function () {
over();
};
pause_btn.onRelease = function () {
if (paused == false) {
klik();
pauseKotak();
paused = true;
aktifTombol(false);
xpaused = "CONTINUE";
} else {
xpaused = "PAUSE";
paused = false;
klik();
aktifTombol(true);
mySound.start(posisiLagu);
mySound.onSoundComplete = function () {
mySound = new Sound();
mySound.attachSound("backSound");
mySound.start(0, 999);
};
i = awal;
while (i <= akhir) {
j = 0;
while (j <= lebar) {
ubahDalam("j", "i", "dalam");
_root["kotak_mc" + dalam].gotoAndStop(simpanSementara[i][j]);
j++;
}
i++;
}
muncul_mc.bawah_btn.enabled = true;
sedangJalan = true;
msgBox_mc._visible = false;
_root.onEnter();
_root.idKotak = setInterval(_root.munculKotak, _root.speed);
}
};
new_btn.onRollOver = function () {
over();
};
new_btn.onRelease = function () {
klik();
newGame();
};
exit_btn.onRollOver = function () {
over();
};
exit_btn.onRelease = function () {
klik();
fscommand ("quit");
};
help_btn.onRollOver = function () {
over();
};
help_btn.onRelease = function () {
klik();
aktifTombol(false);
help_mc._visible = true;
help_mc.gotoAndStop(1);
help_mc.prev_btn._visible = false;
help_mc.next_btn._visible = true;
nex();
help_mc.quit_btn.onRollOver = function () {
over();
};
help_mc.quit_btn.onRelease = function () {
klik();
aktifTombol(true);
i = awal;
while (i <= akhir) {
j = 0;
while (j <= lebar) {
ubahDalam("j", "i", "dalam");
_root["kotak_mc" + dalam].gotoAndStop(simpanSementara[i][j]);
j++;
}
i++;
}
muncul_mc.bawah_btn.enabled = true;
sedangJalan = true;
help_mc._visible = false;
_root.onEnter();
_root.idKotak = setInterval(_root.munculKotak, _root.speed);
};
pauseKotak();
};
}
function aktifTombol(aktif) {
restart_btn.enabled = aktif;
exit_btn.enabled = aktif;
}
function nex() {
help_mc.next_btn.onRollOver = function () {
over();
};
help_mc.next_btn.onRelease = function () {
klik();
help_mc.gotoAndStop(2);
help_mc.next_btn._visible = false;
help_mc.prev_btn._visible = true;
prev();
};
}
function prev() {
help_mc.prev_btn.onRollOver = function () {
over();
};
help_mc.prev_btn.onRelease = function () {
klik();
help_mc.gotoAndStop(1);
help_mc.prev_btn._visible = false;
help_mc.next_btn._visible = true;
nex();
};
}
function newGame() {
clearInterval(idKotak);
delete _root.onEnterFrame;
delete _root.onMouseDown;
i = 0;
while (i <= panjang) {
j = 0;
while (j <= lebar) {
ubahDalam("j", "i", "dalam");
removeMovieClip(_root["kotak_mc" + dalam]);
j++;
}
i++;
}
i = 0;
while (i <= panjang) {
removeMovieClip("kotakBawah_mc" + i);
i++;
}
initAwal();
init();
reset();
buatKotak();
buatKotakBawah();
buatMuncul();
acakKotak();
control();
onEnter();
idKotak = setInterval(munculKotak, speed);
}
function pauseKotak() {
posisiLagu = int(mySound.position / 1000);
mySound.stop();
i = awal;
while (i <= akhir) {
j = 0;
while (j <= lebar) {
ubahDalam("j", "i", "dalam");
simpanSementara[i][j] = _root["kotak_mc" + dalam]._currentframe;
_root["kotak_mc" + dalam].gotoAndStop(7);
j++;
}
i++;
}
sedangJalan = false;
clearInterval(idKotak);
delete _root.onEnterFrame;
delete _root.onMouseDown;
muncul_mc.bawah_btn.enabled = false;
}
function buatKotak() {
i = awal;
while (i <= akhir) {
j = 0;
while (j <= lebar) {
ubahDalam("j", "i", "dalam");
namaBaru = "kotak_mc" + dalam;
kotak_mc.duplicateMovieClip(namaBaru, dalam1);
_root[namaBaru]._x = kotak_mc._x + (i * 44.5);
_root[namaBaru]._y = kotak_mc._y - (j * 44.5);
_root[namaBaru].gotoAndStop(kotakKosong);
dalam1++;
j++;
}
i++;
}
kotak_mc._visible = false;
}
function buatKotakBawah() {
i = awal;
while (i <= akhir) {
namaBaru = "kotakBawah_mc" + i;
kotakBawah_mc.duplicateMovieClip(namaBaru, dalam1);
_root[namaBaru]._x = kotakBawah_mc._x + (i * 44.5);
_root[namaBaru]._visible = false;
dalam1++;
i++;
}
kotakBawah_mc._visible = false;
}
function buatMuncul() {
xmuncul_mc.duplicateMovieClip("muncul_mc", dalam1);
xmuncul_mc._visible = false;
dalam1++;
xbonus_mc.duplicateMovieClip("bonus_mc", dalam1);
xbonus_mc._visible = false;
bonus_mc._visible = false;
dalam1++;
xhelp_mc.duplicateMovieClip("help_mc", dalam1);
xhelp_mc._visible = false;
help_mc._visible = false;
dalam1++;
xmsgBox_mc.duplicateMovieClip("msgBox_mc", dalam1);
xmsgBox_mc._visible = false;
msgBox_mc._visible = false;
}
function ubahDalam(j, i, dalam) {
if ((_root[j] < 10) && (_root[i] < 10)) {
_root[dalam] = (("0" + String(_root[j])) + "0") + String(_root[i]);
} else if ((_root[j] < 10) && (_root[i] >= 10)) {
_root[dalam] = ("0" + String(_root[j])) + String(_root[i]);
} else if ((_root[j] >= 10) && (_root[i] < 10)) {
_root[dalam] = (String(_root[j]) + "0") + String(_root[i]);
} else {
_root[dalam] = String(_root[j]) + String(_root[i]);
}
}
function acakKotak() {
i = awal;
while (i <= akhir) {
if (line > 1) {
acak[i] = random(banyakKotak) + 1;
} else {
acak[i] = 8;
}
i++;
}
if ((xlevel == "MEDIUM") || (xlevel == "HARD")) {
if (line > 1) {
iii = random(akhir - awal) + awal;
eee = random(akhir - awal) + awal;
ooo = random(akhir - awal) + awal;
uuu = random(akhir - awal) + awal;
aaa = random(akhir - awal) + awal;
bbb = random(akhir - awal) + awal;
rand = random(100);
if (rand > 30) {
if (satuKaliUang == true) {
satuKaliUang = false;
acak[iii] = 9;
}
}
rand = random(100);
if (rand > 40) {
if (satuKaliBom == true) {
satuKaliBom = false;
acak[ooo] = 16 + random(3);
}
}
rand = random(100);
if (rand > 50) {
if (satuKaliBom2 == true) {
satuKaliBom2 = false;
rand2 = random(banyakKotak) + 1;
acak[eee] = 9 + rand2;
}
}
rand = random(100);
if (rand > 60) {
if (satuKaliMacem == true) {
satuKaliMacem = false;
rand2 = random(5);
acak[uuu] = 19 + rand2;
if (level > 7) {
if (acak[uuu] == 21) {
acak[uuu] = random(banyakKotak) + 1;
}
}
}
}
if ((level == 16) || (level == 18)) {
rand = random(100);
if (rand > 90) {
if (satuKaliColor == false) {
satuKaliColor = true;
acak[aaa] = 24;
}
}
}
if ((level == 17) || (level == 19)) {
rand = random(100);
if (rand > 90) {
if (satuKaliHancur == false) {
satuKaliHancur = true;
acak[bbb] = 25;
}
}
}
if (xlevel == "HARD") {
randBom = random(100);
if (rand > 50) {
xbom = random(akhir - awal) + awal;
acak[xbom] = 22;
}
}
}
}
if (xlevel == "MEDIUM") {
i = awal;
while (i <= akhir) {
if (acak[i] >= 22) {
acak[i] = random(banyakKotak) + 1;
}
i++;
}
} else if (xlevel == "HARD") {
i = awal;
while (i <= akhir) {
if (acak[i] >= 23) {
acak[i] = random(banyakKotak) + 1;
}
i++;
}
}
}
function geserAtas() {
adaAtas = false;
j = lebar;
i = awal;
while (i <= akhir) {
ubahDalam("j", "i", "dalam1");
if (_root["kotak_mc" + dalam1]._currentframe != kotakKosong) {
adaAtas = true;
}
i++;
}
if (adaAtas == true) {
this["xlive" + live].gotoAndPlay("hilang");
live--;
if (live <= 0) {
sedangJalan = false;
clearInterval(idKotak);
delete _root.onEnterFrame;
delete _root.onMouseDown;
muncul_mc.bawah_btn.enabled = false;
di = awal;
dj = lebar;
idGame = setInterval(gameOver, 1500);
} else {
loss();
bonus_mc._visible = true;
bonus_mc.gotoAndPlay(2);
bonus_mc._x = _root["kotak_mc" + dalam]._x;
bonus_mc._y = _root["kotak_mc" + dalam]._y;
bonus_mc.bonus = "LIVE \n MINUS \n 1 PTS";
lanjut("live");
}
}
if (sedangJalan == true) {
if (line > 0) {
j = lebar;
while (j >= 1) {
i = awal;
while (i <= akhir) {
ubahDalam("j", "i", "dalam1");
j2 = j - 1;
ubahDalam("j2", "i", "dalam2");
_root["kotak_mc" + dalam1].gotoAndStop(_root["kotak_mc" + dalam2]._currentframe);
i++;
}
j--;
}
} else {
sedangJalan = false;
clearInterval(idKotak);
delete _root.onEnterFrame;
delete _root.onMouseDown;
muncul_mc.bawah_btn.enabled = false;
dj = lebar;
idAnimSelesai = setInterval(acakSelesai, 100);
}
}
}
function acakSelesai() {
di = awal;
while (di <= akhir) {
ubahDalam("dj", "di", "ddalam1");
if (_root["kotak_mc" + ddalam1]._currentframe == kotakKosong) {
_root["kotak_mc" + ddalam1].gotoAndStop(8);
skor = skor + level;
} else {
_root["kotak_mc" + ddalam1].gotoAndStop(kotakKosong);
}
di++;
}
if (dj == 0) {
winning();
clearInterval(idAnimSelesai);
msgBox_mc._visible = true;
if (level < 20) {
msgBox_mc.gotoAndStop(1);
msgBox_mc.kata = ("LEVEL " + level) + " COMPLETED. GO TO THE NEXT LEVEL";
} else {
msgBox_mc.gotoAndStop(2);
msgBox_mc.kata = "ALL LEVEL COMPLETED. YOU WIN THIS GAME. CONGRATULATION..";
}
msgBox_mc.next_btn.onRollOver = function () {
over();
};
msgBox_mc.next_btn.onRelease = function () {
klik();
if (level < 20) {
lanjut("selesai");
} else {
msgBox_mc._visible = false;
newGame();
}
};
msgBox_mc.exit_btn.onRollOver = function () {
over();
};
msgBox_mc.exit_btn.onRelease = function () {
klik();
fscommand ("quit");
};
} else {
uang();
}
dj--;
}
function acakGame() {
duar();
clearInterval(idAnimGame);
i = awal;
while (i <= akhir) {
j = 0;
while (j <= lebar) {
ubahDalam("j", "i", "dalam");
_root["kotak_mc" + dalam].ledakan_mc.gotoAndPlay(2);
_root["kotak_mc" + dalam].gotoAndStop(kotakKosong);
j++;
}
i++;
}
msgBox_mc._visible = true;
msgBox_mc.gotoAndStop(2);
msgBox_mc.kata = "GAME OVER";
msgBox_mc.next_btn.onRollOver = function () {
over();
};
msgBox_mc.next_btn.onRelease = function () {
klik();
lanjut("game");
};
msgBox_mc.exit_btn.onRollOver = function () {
over();
};
msgBox_mc.exit_btn.onRelease = function () {
klik();
fscommand ("quit");
};
}
function lanjut(indi) {
msgBox_mc._visible = false;
if (indi == "selesai") {
level++;
init();
} else if (indi == "game") {
initAwal();
init();
} else if (indi == "live") {
init("live");
}
reset();
buatKotak();
buatKotakBawah();
buatMuncul();
acakKotak();
control();
onEnter();
if (indi == "selesai") {
idKotak = setInterval(munculKotak, speed);
}
}
function munculKotak() {
if (sedangJalan == true) {
if (sekarang <= akhir) {
bluk();
_root["kotakBawah_mc" + sekarang]._visible = true;
_root["kotakBawah_mc" + sekarang].gotoAndStop(acak[sekarang]);
}
sekarang++;
if (sekarang > (akhir + 1)) {
if (onKlik == false) {
geserSemua();
}
}
}
}
function geserSemua() {
clearInterval(idGeser);
poing2();
if (sudahGeser == false) {
sudahGeser = true;
if (sedangJalan == true) {
geserAtas();
j = 0;
if (line > 0) {
i = awal;
while (i <= akhir) {
ubahDalam("j", "i", "dalam");
_root["kotak_mc" + dalam]._visible = true;
_root["kotak_mc" + dalam].gotoAndStop(acak[i]);
_root["kotakBawah_mc" + i]._visible = false;
i++;
}
sekarang = awal;
clearInterval(idKotak);
acakKotak();
xlewat++;
if (level <= 5) {
if (xlewat == 10) {
satuKaliUang = true;
} else if (xlewat == 13) {
satuKaliMacem = true;
satuKaliBom = true;
} else if (xlewat > 16) {
satuKaliBom2 = true;
xlewat = 1;
}
} else if ((level >= 5) && (level <= 10)) {
if (xlewat == 7) {
satuKaliUang = true;
} else if (xlewat == 10) {
satuKaliMacem = true;
satuKaliBom = true;
} else if (xlewat > 13) {
satuKaliBom2 = true;
xlewat = 1;
}
} else if ((level >= 10) && (level <= 15)) {
if (xlewat == 4) {
satuKaliUang = true;
} else if (xlewat == 7) {
satuKaliMacem = true;
satuKaliBom = true;
} else if (xlewat > 10) {
satuKaliBom2 = true;
xlewat = 1;
}
} else if ((level >= 16) && (level <= 17)) {
if (xlewat == 10) {
satuKaliUang = true;
} else if (xlewat == 13) {
satuKaliMacem = true;
satuKaliBom = true;
} else if (xlewat > 16) {
satuKaliBom2 = true;
xlewat = 1;
}
} else if ((level >= 18) && (level <= 19)) {
if (xlewat == 15) {
satuKaliUang = true;
} else if (xlewat == 18) {
satuKaliMacem = true;
satuKaliBom = true;
} else if (xlewat > 21) {
satuKaliBom2 = true;
xlewat = 1;
}
} else if (level == 20) {
if (xlewat == 20) {
satuKaliUang = true;
} else if (xlewat == 26) {
satuKaliMacem = true;
satuKaliBom = true;
} else if (xlewat > 32) {
satuKaliBom2 = true;
xlewat = 1;
}
}
idKotak = setInterval(munculKotak, speed);
}
}
idDelay = setInterval(delay, 100);
}
}
function delay() {
sudahGeser = false;
onKlik = false;
clearInterval(idDelay);
}
function cekLevel() {
skor = int(skor);
if (skor < 500) {
wlevel = 1;
tandaLevel = 1;
} else if ((skor > 500) && (tandaLevel == 1)) {
wlevel = 2;
tandaLevel = 2;
resetWaktu();
} else if ((skor > 1000) && (tandaLevel == 2)) {
wlevel = 3;
tandaLevel = 3;
resetWaktu();
} else if ((skor > 2000) && (tandaLevel == 3)) {
wlevel = 4;
tandaLevel = 4;
resetWaktu();
} else if ((skor > 4000) && (tandaLevel == 4)) {
wlevel = 5;
tandaLevel = 5;
resetWaktu();
} else if ((skor > 8000) && (tandaLevel == 5)) {
wlevel = 6;
tandaLevel = 6;
resetWaktu();
} else if ((skor > 16000) && (tandaLevel == 6)) {
wlevel = 7;
tandaLevel = 7;
resetWaktu();
} else if ((skor > 24000) && (tandaLevel == 7)) {
wlevel = 8;
tandaLevel = 8;
resetWaktu();
} else if ((skor > 48000) && (tandaLevel == 8)) {
wlevel = 9;
tandaLevel = 9;
resetWaktu();
} else if ((skor > 100000) && (tandaLevel == 9)) {
wlevel = 10;
tandaLevel = 10;
resetWaktu();
} else if ((skor > 200000) && (tandaLevel == 10)) {
xwaktu = 0;
sedangJalan = false;
clearInterval(idKotak);
delete _root.onEnterFrame;
delete _root.onMouseDown;
muncul_mc.bawah_btn.enabled = false;
di = awal;
dj = lebar;
win();
clearInterval(idWaktu);
}
}
function resetWaktu() {
if (xlevel == "EASY") {
xwaktu = 120;
xxwaktu = xwaktu;
} else if (xlevel == "MEDIUM") {
xwaktu = 90;
xxwaktu = xwaktu;
} else if (xlevel == "HARD") {
xwaktu = 60;
xxwaktu = xwaktu;
}
}
function onEnter() {
this.onEnterFrame = function () {
menit = Math.floor(xwaktu / 60);
detik = Math.floor(xwaktu - (menit * 60));
zlevel = "LEVEL " + wlevel;
if (menit < 10) {
menit = "0" + menit;
}
if (detik < 10) {
detik = "0" + detik;
}
if (int(menit) >= 1) {
zwaktu = (menit + ".") + detik;
} else {
zwaktu = "00." + detik;
}
xscore = "SCORE : " + skor;
cekLevel();
i = awal;
while (i <= akhir) {
j = 0;
while (j <= lebar) {
ubahDalam("j", "i", "dalam");
warnaKotak[i][j] = _root["kotak_mc" + dalam]._currentframe;
if (warnaKotak[i][j] == kotakKosong) {
warnaKotak[i][j] = 0;
}
_root["kotak_mc" + dalam]._alpha = 100;
j++;
}
i++;
}
i = awal;
while (i <= akhir) {
j = 0;
while (j < lebar) {
ubahDalam("j", "i", "dalam1");
if (_root["kotak_mc" + dalam1]._currentframe == kotakKosong) {
j2 = j + 1;
ubahDalam("j2", "i", "dalam2");
_root["kotak_mc" + dalam1].gotoAndStop(_root["kotak_mc" + dalam2]._currentframe);
_root["kotak_mc" + dalam2].gotoAndStop(kotakKosong);
}
j++;
}
i++;
}
i = 5;
while (i < akhir) {
geser = 0;
j = 0;
while (j < lebar) {
ubahDalam("j", "i", "dalam1");
if (_root["kotak_mc" + dalam1]._currentframe != kotakKosong) {
geser++;
}
j++;
}
if (geser == 0) {
j = 0;
while (j < lebar) {
ubahDalam("j", "i", "dalam1");
i2 = i + 1;
ubahDalam("j", "i2", "dalam2");
_root["kotak_mc" + dalam1].gotoAndStop(_root["kotak_mc" + dalam2]._currentframe);
_root["kotak_mc" + dalam2].gotoAndStop(kotakKosong);
j++;
}
}
i++;
}
i = 5;
while (i > 0) {
geser = 0;
j = 0;
while (j < lebar) {
ubahDalam("j", "i", "dalam1");
if (_root["kotak_mc" + dalam1]._currentframe != kotakKosong) {
geser++;
}
j++;
}
if (geser == 0) {
j = 0;
while (j < lebar) {
ubahDalam("j", "i", "dalam1");
i2 = i - 1;
ubahDalam("j", "i2", "dalam2");
_root["kotak_mc" + dalam1].gotoAndStop(_root["kotak_mc" + dalam2]._currentframe);
_root["kotak_mc" + dalam2].gotoAndStop(kotakKosong);
j++;
}
}
i--;
}
};
this.onMouseDown = function () {
if (sedangJalan == true) {
m = awal;
while (m <= akhir) {
n = 0;
while (n <= lebar) {
ubahDalam("n", "m", "dalam");
if (_root["kotak_mc" + dalam].hitTest(_root._xmouse, _root._ymouse, true)) {
myKata = new String(_root["kotak_mc" + dalam]);
y = int(myKata.substr(myKata.length - 4, 2));
x = int(myKata.substr(myKata.length - 2, 2));
indiX = x;
indiY = y;
warna = _root["kotak_mc" + dalam]._currentframe;
if (warna != kotakKosong) {
cekStop();
if (jmlHilang >= 3) {
tuing();
zz = 1;
while (zz <= jmlHilang) {
indiWarna = _root["kotak_mc" + xxdalam[zz]]._currentframe - 1;
myWarna = new Color(_root["kotak_mc" + xxdalam[zz]].ledakan_mc);
myWarna.setRGB(warnaHancur[indiWarna]);
_root["kotak_mc" + xxdalam[zz]].ledakan_mc.gotoAndPlay(2);
_root["kotak_mc" + xxdalam[zz]].gotoAndStop(kotakKosong);
zzdalam[zz] = xxdalam[zz];
skor = skor + (level * jmlHilang);
zz++;
}
if (jmlHilang > 10) {
xxbonus();
xTotalBonus = (100 * level) * jmlHilang;
skor = skor + xTotalBonus;
bonus_mc._visible = true;
bonus_mc.gotoAndPlay(2);
bonus_mc._x = _root["kotak_mc" + dalam]._x;
bonus_mc._y = _root["kotak_mc" + dalam]._y;
bonus_mc.bonus = (" BONUS \n SCORE \n " + xTotalBonus) + " PTS";
}
destroyed = destroyed + jmlHilang;
xjmlHilang = jmlHilang;
kosongBawah = 0;
w = 0;
v = awal;
while (v <= akhir) {
ubahDalam("w", "v", "dalam5");
if (_root["kotak_mc" + dalam5]._currentframe != kotakKosong) {
kosongBawah++;
}
v++;
}
if (kosongBawah == 0) {
xxbonus();
xTotalBonus = 5000 * level;
skor = skor + xTotalBonus;
bonus_mc._visible = true;
bonus_mc.gotoAndPlay(2);
bonus_mc._x = _root["kotak_mc" + dalam]._x;
bonus_mc._y = _root["kotak_mc" + dalam]._y;
bonus_mc.bonus = (" BONUS \n SCORE \n " + xTotalBonus) + " PTS";
}
} else if (warna != undefined) {
if (warna < kotakKosong) {
failure1();
}
xjmlHilang = 1;
}
if ((warna == 9) && (warna != undefined)) {
xxbonus();
xTotalBonus = 0;
zz = 1;
while (zz <= jmlHilang) {
indiWarna = _root["kotak_mc" + xxdalam[zz]]._currentframe - 1;
myWarna = new Color(_root["kotak_mc" + xxdalam[zz]].ledakan_mc);
myWarna.setRGB(warnaHancur[indiWarna]);
_root["kotak_mc" + xxdalam[zz]].ledakan_mc.gotoAndPlay(2);
_root["kotak_mc" + xxdalam[zz]].gotoAndStop(kotakKosong);
zzdalam[zz] = xxdalam[zz];
xTotalBonus = xTotalBonus + ((500 * level) * jmlHilang);
zz++;
}
skor = skor + xTotalBonus;
bonus_mc._visible = true;
bonus_mc.gotoAndPlay(2);
bonus_mc._x = _root["kotak_mc" + dalam]._x;
bonus_mc._y = _root["kotak_mc" + dalam]._y;
bonus_mc.bonus = (" BONUS \n SCORE \n " + xTotalBonus) + " PTS";
destroyed = destroyed + jmlHilang;
xjmlHilang = jmlHilang;
} else if (((warna >= 10) && (warna <= 15)) && (warna != undefined)) {
explosion2();
zz = 1;
while (zz <= jmlHilang) {
indiWarna = _root["kotak_mc" + xxdalam[zz]]._currentframe - 1;
myWarna = new Color(_root["kotak_mc" + xxdalam[zz]].ledakan_mc);
myWarna.setRGB(warnaHancur[indiWarna]);
_root["kotak_mc" + xxdalam[zz]].ledakan_mc.gotoAndPlay(2);
_root["kotak_mc" + xxdalam[zz]].gotoAndStop(kotakKosong);
zzdalam[zz] = xxdalam[zz];
skor = skor + ((1000 * level) * jmlHilang);
zz++;
}
destroyed = destroyed + jmlHilang;
xjmlHilang = jmlHilang;
i = awal;
while (i <= akhir) {
j = 0;
while (j <= lebar) {
ubahDalam("j", "i", "dalam1");
if (_root["kotak_mc" + dalam1]._currentframe == (warna - 9)) {
indiWarna = _root["kotak_mc" + dalam1]._currentframe - 1;
myWarna = new Color(_root["kotak_mc" + dalam1].ledakan_mc);
myWarna.setRGB(warnaHancur[indiWarna]);
_root["kotak_mc" + dalam1].ledakan_mc.gotoAndPlay(2);
_root["kotak_mc" + dalam1].gotoAndStop(kotakKosong);
skor = skor + level;
destroyed++;
}
j++;
}
i++;
}
} else if (((warna >= 16) && (warna <= 18)) && (warna != undefined)) {
explosion();
indikat = warna - 13;
i = indiX - indikat;
while (i <= (indiX + indikat)) {
j = indiY - indikat;
while (j <= (indiY + indikat)) {
ubahDalam("j", "i", "dalam1");
if (_root["kotak_mc" + dalam1]._currentframe != kotakKosong) {
indiWarna = _root["kotak_mc" + dalam1]._currentframe - 1;
myWarna = new Color(_root["kotak_mc" + dalam1].ledakan_mc);
myWarna.setRGB(warnaHancur[indiWarna]);
_root["kotak_mc" + dalam1].ledakan_mc.gotoAndPlay(2);
_root["kotak_mc" + dalam1].gotoAndStop(kotakKosong);
skor = skor + level;
destroyed++;
}
j++;
}
i++;
}
} else if ((warna == 19) && (warna != undefined)) {
warp();
zz = 1;
while (zz <= jmlHilang) {
indiWarna = _root["kotak_mc" + xxdalam[zz]]._currentframe - 1;
myWarna = new Color(_root["kotak_mc" + xxdalam[zz]].ledakan_mc);
myWarna.setRGB(warnaHancur[indiWarna]);
_root["kotak_mc" + xxdalam[zz]].ledakan_mc.gotoAndPlay(2);
_root["kotak_mc" + xxdalam[zz]].gotoAndStop(kotakKosong);
zzdalam[zz] = xxdalam[zz];
zz++;
}
i = awal;
while (i <= akhir) {
j = 0;
while (j <= lebar) {
ubahDalam("j", "i", "dalam1");
if (_root["kotak_mc" + dalam1]._currentframe <= 6) {
_root["kotak_mc" + dalam1].gotoAndStop(random(banyakKotak) + 1);
}
j++;
}
i++;
}
} else if ((warna == 20) && (warna != undefined)) {
missle();
indikat = random(3) + 1;
i = awal;
while (i <= akhir) {
j = indiY - indikat;
while (j <= (indiY + indikat)) {
ubahDalam("j", "i", "dalam1");
if (_root["kotak_mc" + dalam1]._currentframe != kotakKosong) {
indiWarna = _root["kotak_mc" + dalam1]._currentframe - 1;
myWarna = new Color(_root["kotak_mc" + dalam1].ledakan_mc);
myWarna.setRGB(warnaHancur[indiWarna]);
_root["kotak_mc" + dalam1].ledakan_mc.gotoAndPlay(2);
_root["kotak_mc" + dalam1].gotoAndStop(kotakKosong);
skor = skor + level;
destroyed++;
}
j++;
}
i++;
}
} else if ((warna == 21) && (warna != undefined)) {
explosion3();
indikat = random(3) + 1;
i = indiX - indikat;
while (i <= (indiX + indikat)) {
j = 0;
while (j <= lebar) {
ubahDalam("j", "i", "dalam1");
if (_root["kotak_mc" + dalam1]._currentframe != kotakKosong) {
indiWarna = _root["kotak_mc" + dalam1]._currentframe - 1;
myWarna = new Color(_root["kotak_mc" + dalam1].ledakan_mc);
myWarna.setRGB(warnaHancur[indiWarna]);
_root["kotak_mc" + dalam1].ledakan_mc.gotoAndPlay(2);
_root["kotak_mc" + dalam1].gotoAndStop(kotakKosong);
skor = skor + level;
destroyed++;
}
j++;
}
i++;
}
} else if ((warna == 22) && (warna != undefined)) {
this["xlive" + live].gotoAndPlay("hilang");
live--;
if (live <= 0) {
sedangJalan = false;
clearInterval(idKotak);
delete _root.onEnterFrame;
delete _root.onMouseDown;
muncul_mc.bawah_btn.enabled = false;
di = awal;
dj = lebar;
idGame = setInterval(gameOver, 1500);
} else {
loss();
bonus_mc._visible = true;
bonus_mc.gotoAndPlay(2);
bonus_mc._x = _root["kotak_mc" + dalam]._x;
bonus_mc._y = _root["kotak_mc" + dalam]._y;
bonus_mc.bonus = "LIVE \n MINUS \n 1 PTS";
lanjut("live");
}
}
reset();
} else {
failure1();
}
}
n++;
}
m++;
}
}
};
}
stop();
restart_btn.onRelease = function () {
hapusAku();
gotoAndStop ("credits");
};
backSound();
sound1._visible = false;
sound2._visible = false;
back2();
initAwal();
init();
reset();
buatKotak();
buatKotakBawah();
buatMuncul();
acakKotak();
control();
onEnter();
idKotak = setInterval(munculKotak, speed);
Symbol 11 MovieClip Frame 35
stop();
Symbol 14 MovieClip Frame 1
this._visible = false;
Symbol 18 MovieClip Frame 1
_root.stop();
Symbol 18 MovieClip Frame 3
xyb1 = _root.getBytesLoaded();
xyb2 = _root.getBytesTotal();
xytgFrame = Math.round((xyb1 / xyb2) * 100) + 1;
prelbar.gotoAndStop(xytgFrame);
Symbol 18 MovieClip Frame 5
if ((xyb1 >= xyb2) && (xyb2 > 50)) {
stop();
_root.play();
} else {
gotoAndPlay ("xloop1");
}
Symbol 34 MovieClip Frame 13
gotoAndPlay(random(20) + 20);
Symbol 37 MovieClip Frame 15
gotoAndPlay(random(20) + 20);
Symbol 47 MovieClip Frame 4
gotoAndPlay(random(20) + 10);
Symbol 48 MovieClip Frame 20
gotoAndPlay(random(20) + 20);
Symbol 89 MovieClip Frame 13
_parent.poing3();
gotoAndPlay(random(40) + 20);
Symbol 128 MovieClip Frame 17
stop();
Symbol 137 MovieClip Frame 12
stop();
Symbol 138 Button
on (release) {
getURL ("http://www.dailyfreegames.com", "_blank");
}
Symbol 140 Button
on (release) {
getURL ("http://www.dailyfreegames.com/free-games.html", "_blank");
}
Symbol 162 MovieClip Frame 1
stop();
Symbol 164 MovieClip Frame 1
stop();
Symbol 173 MovieClip Frame 1
stop();
Symbol 173 MovieClip Frame 30
stop();
Symbol 175 MovieClip Frame 11
gotoAndPlay(random(40) + 20);
Symbol 181 MovieClip Frame 1
stop();
Symbol 181 MovieClip Frame 2
play();
Symbol 183 MovieClip Frame 1
stop();
Symbol 198 MovieClip Frame 15
stop();
Symbol 200 MovieClip Frame 15
stop();
Symbol 204 MovieClip Frame 1
stop();
Symbol 204 MovieClip Frame 51
stop();
Symbol 209 MovieClip Frame 1
stop();
this._visible = false;
Symbol 209 MovieClip Frame 2
play();
this._visible = true;
Symbol 212 MovieClip Frame 1
stop();
Symbol 212 MovieClip Frame 2
play();
Symbol 212 MovieClip Frame 11
stop();