Frame 1
var MochiAd = {getVersion:function () {
return("1.5");
}, showPreloaderAd:function (options) {
var _local27 = {clip:_root, ad_timeout:3000, fadeout_time:250, regpt:"o", method:"showPreloaderAd", color:16747008, background:16777161, outline:13994812, ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = MochiAd._parseOptions(options, _local27);
var clip = options.clip;
var _local23 = 11000;
var _local26 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local14 = MochiAd._getRes(options);
var _local4 = _local14[0];
var _local13 = _local14[1];
mc._x = _local4 * 0.5;
mc._y = _local13 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk._x = _local4 * -0.5;
chk._y = _local13 * -0.5;
var _local7 = chk.createEmptyMovieClip("_mochiad_bar", 4);
_local7._x = 10;
_local7._y = _local13 - 20;
var _local22 = options.color;
delete options.color;
var _local19 = options.background;
delete options.background;
var _local24 = options.outline;
delete options.outline;
var _local5 = _local7.createEmptyMovieClip("_outline", 1);
_local5.beginFill(_local19);
_local5.moveTo(0, 0);
_local5.lineTo(_local4 - 20, 0);
_local5.lineTo(_local4 - 20, 10);
_local5.lineTo(0, 10);
_local5.lineTo(0, 0);
_local5.endFill();
var _local3 = _local7.createEmptyMovieClip("_inside", 2);
_local3.beginFill(_local22);
_local3.moveTo(0, 0);
_local3.lineTo(_local4 - 20, 0);
_local3.lineTo(_local4 - 20, 10);
_local3.lineTo(0, 10);
_local3.lineTo(0, 0);
_local3.endFill();
_local3._xscale = 0;
var _local6 = _local7.createEmptyMovieClip("_outline", 3);
_local6.lineStyle(0, _local24, 100);
_local6.moveTo(0, 0);
_local6.lineTo(_local4 - 20, 0);
_local6.lineTo(_local4 - 20, 10);
_local6.lineTo(0, 10);
_local6.lineTo(0, 0);
chk.ad_msec = _local23;
chk.ad_timeout = _local26;
chk.started = getTimer();
chk.showing = false;
chk.last_pcnt = 0;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adLoaded = function (width, height) {
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec;
};
chk.onEnterFrame = function () {
var _local6 = this._parent._parent;
var _local12 = this._parent._mochiad_ctr;
var _local5 = getTimer() - this.started;
var _local3 = false;
var _local4 = _local6.getBytesTotal();
var _local8 = _local6.getBytesLoaded();
var _local10 = (100 * _local8) / _local4;
var _local11 = (100 * _local5) / chk.ad_msec;
var _local9 = this._mochiad_bar._inside;
var _local2 = Math.min(100, Math.min(_local10 || 0, _local11));
_local2 = Math.max(this.last_pcnt, _local2);
this.last_pcnt = _local2;
_local9._xscale = _local2;
if (!chk.showing) {
var _local7 = _local12.getBytesTotal();
if ((_local7 > 0) || (typeof(_local7) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local5 > chk.ad_timeout) {
_local3 = true;
}
}
if (_local5 > chk.ad_msec) {
_local3 = true;
}
if (((_local4 > 0) && (_local8 >= _local4)) && (_local3)) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = chk.fadeFunction;
}
}
};
}, showTimedAd:function (options) {
var _local13 = {clip:_root, ad_timeout:2000, fadeout_time:250, regpt:"o", method:"showTimedAd", ad_started:function () {
this.clip.stop();
}, ad_finished:function () {
this.clip.play();
}};
options = MochiAd._parseOptions(options, _local13);
var clip = options.clip;
var _local10 = 11000;
var _local12 = options.ad_timeout;
delete options.ad_timeout;
var fadeout_time = options.fadeout_time;
delete options.fadeout_time;
if (!MochiAd.load(options)) {
options.ad_finished();
return(undefined);
}
options.ad_started();
var mc = clip._mochiad;
mc.onUnload = function () {
options.ad_finished();
};
var _local5 = MochiAd._getRes(options);
var _local14 = _local5[0];
var _local11 = _local5[1];
mc._x = _local14 * 0.5;
mc._y = _local11 * 0.5;
var chk = mc.createEmptyMovieClip("_mochiad_wait", 3);
chk.ad_msec = _local10;
chk.ad_timeout = _local12;
chk.started = getTimer();
chk.showing = false;
chk.fadeout_time = fadeout_time;
chk.fadeFunction = function () {
var _local2 = 100 * (1 - ((getTimer() - this.fadeout_start) / this.fadeout_time));
if (_local2 > 0) {
this._parent._alpha = _local2;
} else {
var _local3 = this._parent._parent;
MochiAd.unload(_local3);
delete this.onEnterFrame;
}
};
mc.lc.adjustProgress = function (msec) {
var _local2 = this.mc._mochiad_wait;
_local2.server_control = true;
_local2.started = getTimer();
_local2.ad_msec = msec - 250;
};
chk.onEnterFrame = function () {
var _local5 = this._parent._mochiad_ctr;
var _local4 = getTimer() - this.started;
var _local2 = false;
if (!chk.showing) {
var _local3 = _local5.getBytesTotal();
if ((_local3 > 0) || (typeof(_local3) == "undefined")) {
chk.showing = true;
chk.started = getTimer();
} else if (_local4 > chk.ad_timeout) {
_local2 = true;
}
}
if (_local4 > chk.ad_msec) {
_local2 = true;
}
if (_local2) {
if (this.server_control) {
delete this.onEnterFrame;
} else {
this.fadeout_start = getTimer();
this.onEnterFrame = this.fadeFunction;
}
}
};
}, _allowDomains:function (server) {
var _local1 = server.split("/")[2].split(":")[0];
if (System.security) {
if (System.security.allowDomain) {
System.security.allowDomain("*");
System.security.allowDomain(_local1);
}
if (System.security.allowInsecureDomain) {
System.security.allowInsecureDomain("*");
System.security.allowInsecureDomain(_local1);
}
}
return(_local1);
}, _loadCommunicator:function (options) {
var _local25 = {clip:_root, com_server:"http://x.mochiads.com/com/1/", method:"loadCommunicator", depth:10337, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, _local25);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = MochiAd.getVersion();
var _local18 = options.clip;
var _local20 = "_mochiad_com_" + options.id;
if (!MochiAd._isNetworkAvailable()) {
return(null);
}
if (_local18[_local20]) {
return(_local18[_local20].lc);
}
var _local21 = options.com_server + options.id;
MochiAd._allowDomains(_local21);
delete options.id;
delete options.com_server;
var _local24 = options.depth;
delete options.depth;
var _local17 = _local18.createEmptyMovieClip(_local20, _local24);
var _local11 = _local17.createEmptyMovieClip("_mochiad_com", 1);
for (var _local15 in options) {
_local11[_local15] = options[_local15];
}
var _local6 = new LocalConnection();
var _local16 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local6.mc = _local17;
_local6.name = _local16;
_local6.allowDomain = function (d) {
return(true);
};
_local6.allowInsecureDomain = _local6.allowDomain;
_local6.connect(_local16);
_local17.lc = _local6;
_local11.lc = _local16;
_local6._id = 0;
_local6._queue = [];
_local6.rpcResult = function (cb) {
cb = parseInt(cb);
var _local4 = this._callbacks[cb];
if (!_local4) {
return(undefined);
}
delete this._callbacks[cb];
var _local5 = [];
var _local3 = 2;
while (_local3 < _local4.length) {
_local5.push(_local4[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 < arguments.length) {
_local5.push(arguments[_local3]);
_local3++;
}
var _local6 = _local4[1];
var _local7 = _local4[0];
if (_local7 && (typeof(_local6) == "string")) {
_local6 = _local7[_local6];
}
if (_local6) {
_local6.apply(_local7, _local5);
}
};
_local6._didConnect = function (endpoint) {
this._endpoint = endpoint;
var _local4 = this._queue;
delete this._queue;
var _local5 = this.doSend;
var _local2 = 0;
while (_local2 < _local4.length) {
var _local3 = _local4[_local2];
_local5.apply(this, _local3);
_local2++;
}
};
_local6.doSend = function (args, cbobj, cbfn) {
if (this._endpoint == null) {
var _local4 = [];
var _local3 = 0;
while (_local3 < arguments.length) {
_local4.push(arguments[_local3]);
_local3++;
}
this._queue.push(_local4);
return(undefined);
}
this._id = this._id + 1;
var _local5 = this._id;
if ((cbfn === undefined) || (cbfn === null)) {
cbfn = cbobj;
}
this._callbacks[_local5] = [cbobj, cbfn];
var _local7 = new LocalConnection();
var _local9 = _local7.send(this._endpoint, "rpc", _local5, args);
};
_local6._callbacks = {};
_local6._callbacks[0] = [_local6, "_didConnect"];
_local11.st = getTimer();
_local11.loadMovie(_local21 + ".swf", "POST");
return(_local6);
}, fetchHighScores:function (options, callbackObj, callbackMethod) {
var _local1 = MochiAd._loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["fetchHighScores", options];
_local1.doSend(["fetchHighScores", options], callbackObj, callbackMethod);
return(true);
}, sendHighScore:function (options, callbackObj, callbackMethod) {
var _local1 = MochiAd._loadCommunicator({id:options.id});
if (!_local1) {
return(false);
}
var _local4 = ["sendHighScore", options];
_local1.doSend(["sendHighScore", options], callbackObj, callbackMethod);
return(true);
}, load:function (options) {
var _local13 = {clip:_root, server:"http://x.mochiads.com/srv/1/", method:"load", depth:10333, id:"_UNKNOWN_"};
options = MochiAd._parseOptions(options, _local13);
options.swfv = options.clip.getSWFVersion() || 6;
options.mav = MochiAd.getVersion();
var _local7 = options.clip;
if (!MochiAd._isNetworkAvailable()) {
return(null);
}
if (_local7._mochiad_loaded) {
return(null);
}
var _local12 = options.depth;
delete options.depth;
var _local6 = _local7.createEmptyMovieClip("_mochiad", _local12);
var _local11 = MochiAd._getRes(options);
options.res = (_local11[0] + "x") + _local11[1];
options.server = options.server + options.id;
delete options.id;
_local7._mochiad_loaded = true;
var _local4 = _local6.createEmptyMovieClip("_mochiad_ctr", 1);
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
if (_local7._url.indexOf("http") != 0) {
options.no_page = true;
}
var _local10 = _local4.server;
delete _local4.server;
var _local14 = MochiAd._allowDomains(_local10);
_local6.onEnterFrame = function () {
if (this._mochiad_ctr._url != this._url) {
this.onEnterFrame = function () {
if (!this._mochiad_ctr) {
delete this.onEnterFrame;
MochiAd.unload(this._parent);
}
};
}
};
var _local5 = new LocalConnection();
var _local9 = ["", Math.floor(new Date().getTime()), random(999999)].join("_");
_local5.mc = _local6;
_local5.name = _local9;
_local5.hostname = _local14;
_local5.allowDomain = function (d) {
return(true);
};
_local5.allowInsecureDomain = _local5.allowDomain;
_local5.connect(_local9);
_local6.lc = _local5;
_local4.lc = _local9;
_local4.st = getTimer();
_local4.loadMovie(_local10 + ".swf", "POST");
return(_local6);
}, unload:function (clip) {
if (typeof(clip) == "undefined") {
clip = _root;
}
if (clip.clip && (clip.clip._mochiad)) {
clip = clip.clip;
}
if (!clip._mochiad) {
return(false);
}
clip._mochiad.removeMovieClip();
delete clip._mochiad_loaded;
delete clip._mochiad;
return(true);
}, _isNetworkAvailable:function () {
if (System.security) {
var _local1 = System.security;
if (_local1.sandboxType == "localWithFile") {
return(false);
}
}
return(true);
}, _getRes:function (options) {
var _local3 = options.clip.getBounds();
var _local2 = 0;
var _local1 = 0;
if (typeof(options.res) != "undefined") {
var _local4 = options.res.split("x");
_local2 = parseFloat(_local4[0]);
_local1 = parseFloat(_local4[1]);
} else {
_local2 = _local3.xMax - _local3.xMin;
_local1 = _local3.yMax - _local3.yMin;
}
if ((_local2 == 0) || (_local1 == 0)) {
_local2 = Stage.width;
_local1 = Stage.height;
}
return([_local2, _local1]);
}, _parseOptions:function (options, defaults) {
var _local4 = {};
for (var _local8 in defaults) {
_local4[_local8] = defaults[_local8];
}
if (options) {
for (var _local8 in options) {
_local4[_local8] = options[_local8];
}
}
if (_root.mochiad_options) {
var _local5 = _root.mochiad_options.split("&");
var _local2 = 0;
while (_local2 < _local5.length) {
var _local3 = _local5[_local2].split("=");
_local4[unescape(_local3[0])] = unescape(_local3[1]);
_local2++;
}
}
return(_local4);
}, _:null};
MochiAd.showPreloaderAd({id:"test", res:"640x480"});
Frame 8
function playSfx(l) {
if (muting == false) {
sfx.setVolume(100);
switch (l) {
case 1 :
sfx.attachSound("bell");
break;
case 2 :
sfx.attachSound("brr");
break;
case 3 :
sfx.attachSound("sitar");
break;
case 4 :
sfx.attachSound("bella");
}
sfx.start(0, 1);
} else {
sfx.setVolume(0);
sfx.stop();
}
}
function playBG(l) {
if (muting == false) {
musik.setVolume(100);
musik.stop();
switch (l) {
case 0 :
musik.stop();
break;
case 1 :
musik.attachSound("m1");
break;
case 2 :
musik.attachSound("goofy");
break;
case 3 :
musik.attachSound("votesong");
break;
case 4 :
musik.attachSound("m2");
}
musik.start(0, 99999999);
} else {
musik.setVolume(0);
musik.stop();
}
}
var sfx = new Sound();
var musik = new Sound();
var muting = false;
muting = false;
_root.gotoAndStop("menu");
Frame 13
function initGame() {
var _local1;
_local1 = 0;
while (_local1 < 7) {
regionPercent[_local1] = 0;
regionVisited[_local1] = false;
_local1++;
}
score = 0;
}
var regionPercent = Array(0, 0, 0, 0, 0, 0);
var regionVisited = Array(false, false, false, false, false, false);
var curRegion;
var score;
var curPlayer;
initGame();
Frame 18
stop();
Symbol 22 MovieClip Frame 35
stop();
Symbol 32 Button
on (release) {
getURL ("http://dailyfreegames.com", "_blank");
}
Symbol 33 Button
on (release) {
getURL ("http://www.dailyfreegames.com/games/action-games/escaping-paris.html", "_blank");
}
Symbol 34 Button
on (release) {
getURL ("http://www.dailyfreegames.com/games/puzzle-games/deal-or-no-deal-game.html", "_blank");
}
Symbol 35 Button
on (release) {
getURL ("http://www.dailyfreegames.com/games/arcade-games/superman-game.html", "_blank");
}
Symbol 36 Button
on (release) {
getURL ("http://www.dailyfreegames.com/games/action-games/kane-the-ninja.html", "_blank");
}
Symbol 37 Button
on (release) {
getURL ("http://www.dailyfreegames.com/games/sports-games/dx-hockey.html", "_blank");
}
Symbol 47 MovieClip [blink] Frame 13
stop();
Symbol 52 MovieClip [player] Frame 1
stop();
Symbol 80 MovieClip Frame 1
stop();
Symbol 84 MovieClip [play_mc] Frame 1
stop();
Symbol 103 MovieClip [scoreAnim1] Frame 18
this._visible = false;
Symbol 120 MovieClip [game] Frame 1
function getAngle(dx, dy) {
return((Math.atan2(dy, dx) * 180) / Math.PI);
}
function getBolaRandom() {
return(Math.floor(Math.random() * maxType) + 1);
}
function setVisited(v) {
i = 0;
while (i < dataw) {
j = 0;
while (j < datah) {
data1[i][j].visited = v;
j++;
}
i++;
}
}
function setDropped(v) {
i = 0;
while (i < dataw) {
j = 0;
while (j < datah) {
if (data1[i][j].isi > 0) {
data1[i][j].dropped = v;
}
j++;
}
i++;
}
}
function init() {
info._visible = false;
endcmpgn._visible = false;
player.gotoAndStop(_root.curPlayer);
var _local3;
nosoundBtn._visible = false;
soundBtn._visible = false;
if (!_root.muting) {
soundBtn._visible = true;
} else {
nosoundBtn._visible = true;
}
var _local2;
var _local4;
var _local5;
_local3 = 0;
while (_local3 < dataw) {
data1[_local3] = new Array(datah);
_local2 = 0;
while (_local2 < datah) {
data1[_local3][_local2] = new Object();
data1[_local3][_local2].isi = getBolaRandom();
if (_local2 > 5) {
data1[_local3][_local2].isi = 0;
}
if ((_local2 % 2) == 1) {
_local4 = sh;
} else {
_local4 = 0;
}
data1[_local3][_local2].visited = false;
data1[_local3][_local2].dropped = false;
data1[_local3][_local2]._xc = ((scrLeft + (_local3 * w)) + _local4) + sh;
data1[_local3][_local2]._yc = ((scrTop + (_local2 * h)) + (rapetAtas * _local2)) + sh;
_local2++;
}
_local3++;
}
_local3 = 1;
while (_local3 < datah) {
data1[dataw - 1][_local3].isi = -1;
_local3 = _local3 + 2;
}
curAngle = 0;
xArrow = scrLeft + Math.floor((dataw * w) / 2);
yArrow = 460;
level = 1;
scoreTxt.text = _root.score;
initMC();
initLevel(_root.curRegion);
}
function showMap() {
var _local3;
var _local2;
var _local1;
trace("");
trace("====================");
_local3 = 0;
while (_local3 < datah) {
_local1 = "";
_local2 = 0;
while (_local2 < dataw) {
_local1 = _local1 + data1[_local2][_local3].isi;
if (data1[_local2][_local3].dropped == true) {
_local1 = _local1 + "t";
} else {
_local1 = _local1 + "f";
}
_local1 = _local1 + " ";
_local2++;
}
trace(_local1);
_local3++;
}
}
function initMC() {
i = 0;
while (i < dataw) {
j = 0;
while (j < datah) {
if (data1[i][j].isi != -1) {
if ((j % 2) == 1) {
dx = sh;
} else {
dx = 0;
}
dy = rapetAtas * j;
var _local2 = getBolaName(i, j);
var _local3 = getBolaDepth(i, j);
attachMovie("bola", _local2, _local3, {_x:(scrLeft + (i * w)) + dx, _y:(scrTop + (j * h)) + dy});
this[_local2].gotoAndStop("none");
}
j++;
}
i++;
}
attachMovie("arrow", "arrow", 2000, {_x:xArrow, _y:yArrow});
attachMovie("bola", "bolaNow", 2001, {_x:xArrow - sh, _y:(yArrow - sh) - 4});
attachMovie("bola", "bolaNext", 2002, {_x:(xArrow - (w * 2)) - 65, _y:(yArrow - sh) - 4});
}
function redrawMap() {
i = 0;
while (i < dataw) {
j = 0;
while (j < datah) {
if ((data1[i][j].isi != -1) && (data1[i][j].isi != 0)) {
if ((j % 2) == 1) {
dx = sh;
} else {
dx = 0;
}
dy = rapetAtas * j;
attachMovie("bola", getBolaName(i, j), getBolaDepth(i, j), {_x:(scrLeft + (i * w)) + dx, _y:(scrTop + (j * h)) + dy});
this[getBolaName(i, j)].gotoAndStop(data1[i][j].isi);
}
j++;
}
i++;
}
bolaNow.gotoAndStop(bolaNowIsi);
bolaNext.gotoAndStop(bolaNextIsi);
}
function getRealPosX(x, y) {
var _local2;
var _local1;
if ((y % 2) == 1) {
_local1 = sh;
} else {
_local1 = 0;
}
_local2 = Math.floor(((x - scrLeft) - _local1) / w);
return(_local2);
}
function getRealPosY(y) {
var _local1 = 0;
_local1 = rapetAtas * ((y - scrTop) / h);
return(Math.floor(((y - scrTop) - _local1) / h));
}
function hit(xm, ym, x, y) {
var _local2;
var _local10;
var _local9;
var _local4 = 0;
var _local3 = 0;
var _local1;
_local2 = false;
_local1 = Math.sqrt(Math.pow(xm - data1[x][y]._xc, 2) + Math.pow(ym - data1[x][y]._yc, 2));
if (_local1 <= (w - (w * 0.15))) {
return(true);
}
return(false);
}
function obj1() {
var _local1;
totObj = 0;
_local1 = 0;
while (_local1 < 7) {
gotObjective[_local1] = 0;
objective[_local1] = 0;
_local1++;
}
objective[0] = 40;
objective[1] = 40;
objective[2] = 40;
_local1 = 0;
while (_local1 < 7) {
totObj = totObj + objective[_local1];
_local1++;
}
}
function obj2() {
var _local1;
totObj = 0;
_local1 = 0;
while (_local1 < 7) {
gotObjective[_local1] = 0;
objective[_local1] = 0;
_local1++;
}
objective[0] = 30;
objective[1] = 25;
objective[2] = 20;
objective[3] = 15;
objective[4] = 5;
_local1 = 0;
while (_local1 < 7) {
totObj = totObj + objective[_local1];
_local1++;
}
}
function obj3() {
var _local1;
totObj = 0;
_local1 = 0;
while (_local1 < 7) {
gotObjective[_local1] = 0;
objective[_local1] = 0;
_local1++;
}
objective[3] = 30;
objective[4] = 45;
objective[5] = 50;
_local1 = 0;
while (_local1 < 7) {
totObj = totObj + objective[_local1];
_local1++;
}
}
function obj4() {
var _local1;
totObj = 0;
_local1 = 0;
while (_local1 < 7) {
gotObjective[_local1] = 0;
objective[_local1] = 0;
_local1++;
}
_local1 = 0;
while (_local1 < 7) {
objective[_local1] = 20;
totObj = totObj + objective[_local1];
_local1++;
}
}
function obj5() {
var _local1;
totObj = 0;
_local1 = 0;
while (_local1 < 7) {
gotObjective[_local1] = 0;
objective[_local1] = 0;
_local1++;
}
objective[data1[0][0].isi - 1] = 30;
_local1 = 0;
while (_local1 < 7) {
if (objective[_local1] == 0) {
objective[_local1] = 10;
}
totObj = totObj + objective[_local1];
_local1++;
}
}
function obj6() {
var _local1;
totObj = 0;
_local1 = 0;
while (_local1 < 7) {
gotObjective[_local1] = 0;
objective[_local1] = 0;
_local1++;
}
objective[data1[0][0].isi - 1] = 30;
_local1 = 0;
while (_local1 < 7) {
if (objective[_local1] == 0) {
objective[_local1] = 20;
}
totObj = totObj + objective[_local1];
_local1++;
}
}
function initLevel(l) {
scoreAnim1._visible = false;
var _local3;
_root.regionPercent[l] = 0;
switch (l) {
case 1 :
waktu = 60 * fps;
case 2 :
waktu = 50 * fps;
case 3 :
waktu = 80 * fps;
case 4 :
waktu = 60 * fps;
case 5 :
waktu = 60 * fps;
case 6 :
waktu = 60 * fps;
}
pauseBtn._visible = true;
playBtn._visible = false;
paused = false;
canFire = true;
shooting = false;
bolaNowIsi = getBolaRandom();
bolaNextIsi = getBolaRandom();
var _local2;
_local3 = 0;
while (_local3 < datah) {
_local2 = 0;
while (_local2 < dataw) {
if (data1[_local2][_local3].isi > 0) {
data1[_local2][_local3].isi = 0;
}
_local2++;
}
_local3++;
}
switch (l) {
case 1 :
level1();
break;
case 2 :
level2();
break;
case 3 :
level3();
break;
case 4 :
level4();
break;
case 5 :
level5();
break;
case 6 :
level6();
}
totObj = 0;
switch (l) {
case 1 :
obj1();
break;
case 2 :
obj2();
break;
case 3 :
obj3();
break;
case 4 :
obj4();
break;
case 5 :
obj5();
break;
case 6 :
obj6();
break;
case 7 :
obj7();
}
levelOver = false;
redrawMap();
updateObjective();
}
function level1() {
var _local1;
var _local2;
var _local3;
var _local4;
_local4 = 1;
_local3 = 1;
_local1 = 0;
while (_local1 < dataw) {
_local2 = 0;
while (_local2 < 5) {
if (data1[_local1][_local2].isi != -1) {
data1[_local1][_local2].isi = _local3;
}
_local2++;
}
_local3 = _local3 + _local4;
if (_local3 >= 3) {
_local4 = -1;
}
if (_local3 <= 1) {
_local4 = 1;
}
_local1++;
}
_local4 = 1;
_local3 = 3;
_local1 = 0;
while (_local1 < dataw) {
_local2 = 5;
while (_local2 < 5) {
if (data1[_local1][_local2].isi != -1) {
data1[_local1][_local2].isi = _local3;
}
_local2++;
}
_local3 = _local3 + _local4;
if (_local3 >= 3) {
_local4 = -1;
}
if (_local3 <= 1) {
_local4 = 1;
}
_local1++;
}
_local1 = 0;
while (_local1 < dataw) {
if (data1[_local1][5].isi != -1) {
data1[_local1][5].isi = Math.ceil(Math.random() * 7);
}
_local1++;
}
_local1 = 0;
while (_local1 < dataw) {
if (data1[_local1][6].isi != -1) {
data1[_local1][6].isi = Math.ceil(Math.random() * 7);
}
_local1++;
}
}
function level2() {
var _local4;
var _local3;
var _local2;
var _local1;
_local1 = 0;
data1[0][_local1].isi = 1;
data1[1][_local1].isi = 2;
data1[2][_local1].isi = 3;
data1[3][_local1].isi = 4;
data1[4][_local1].isi = 5;
data1[5][_local1].isi = 5;
data1[6][_local1].isi = 4;
data1[7][_local1].isi = 3;
data1[8][_local1].isi = 2;
data1[9][_local1].isi = 1;
_local1++;
data1[0][_local1].isi = 1;
data1[1][_local1].isi = 2;
data1[2][_local1].isi = 3;
data1[3][_local1].isi = 4;
data1[4][_local1].isi = 5;
data1[5][_local1].isi = 4;
data1[6][_local1].isi = 3;
data1[7][_local1].isi = 2;
data1[8][_local1].isi = 1;
data1[9][_local1].isi = 0;
_local1++;
data1[0][_local1].isi = 0;
data1[1][_local1].isi = 1;
data1[2][_local1].isi = 2;
data1[3][_local1].isi = 3;
data1[4][_local1].isi = 4;
data1[5][_local1].isi = 4;
data1[6][_local1].isi = 3;
data1[7][_local1].isi = 2;
data1[8][_local1].isi = 1;
_local1++;
data1[0][_local1].isi = 0;
data1[1][_local1].isi = 1;
data1[2][_local1].isi = 2;
data1[3][_local1].isi = 3;
data1[4][_local1].isi = 4;
data1[5][_local1].isi = 3;
data1[6][_local1].isi = 2;
data1[7][_local1].isi = 1;
_local1++;
data1[0][_local1].isi = 0;
data1[1][_local1].isi = 0;
data1[2][_local1].isi = 1;
data1[3][_local1].isi = 2;
data1[4][_local1].isi = 3;
data1[5][_local1].isi = 3;
data1[6][_local1].isi = 2;
data1[7][_local1].isi = 1;
_local1++;
data1[0][_local1].isi = 0;
data1[1][_local1].isi = 0;
data1[2][_local1].isi = 1;
data1[3][_local1].isi = 2;
data1[4][_local1].isi = 3;
data1[5][_local1].isi = 2;
data1[6][_local1].isi = 1;
_local1++;
data1[0][_local1].isi = 0;
data1[1][_local1].isi = 0;
data1[2][_local1].isi = 0;
data1[3][_local1].isi = 1;
data1[4][_local1].isi = 2;
data1[5][_local1].isi = 2;
data1[6][_local1].isi = 1;
_local1++;
data1[0][_local1].isi = 0;
data1[1][_local1].isi = 0;
data1[2][_local1].isi = 0;
data1[3][_local1].isi = 1;
data1[4][_local1].isi = 2;
data1[5][_local1].isi = 1;
_local1++;
data1[0][_local1].isi = 0;
data1[1][_local1].isi = 0;
data1[2][_local1].isi = 0;
data1[3][_local1].isi = 0;
data1[4][_local1].isi = 1;
data1[5][_local1].isi = 1;
_local1++;
data1[4][_local1].isi = 1;
}
function level3() {
var _local2;
var _local1;
var _local3;
var _local4;
_local3 = 4;
_local2 = 0;
while (_local2 < 5) {
_local1 = 0;
while (_local1 < dataw) {
if (data1[_local1][_local2].isi != -1) {
data1[_local1][_local2].isi = _local3;
}
_local1++;
}
if ((_local2 % 2) == 0) {
_local3++;
}
_local2++;
}
_local2 = 5;
while (_local2 < 9) {
_local1 = 0;
while (_local1 < dataw) {
if (data1[_local1][_local2].isi != -1) {
data1[_local1][_local2].isi = Math.ceil(Math.random() * 7);
}
_local1++;
}
_local2++;
}
}
function level4() {
var _local3;
var _local1;
var _local2;
var _local4;
_local2 = 1;
_local3 = 0;
while (_local3 < 10) {
_local1 = 0;
while (_local1 < dataw) {
if (data1[_local1][_local3].isi != -1) {
data1[_local1][_local3].isi = _local2;
}
if (((_local1 + 1) % 2) == 0) {
_local2++;
}
if (_local2 > 7) {
_local2 = 1;
}
_local1++;
}
_local3++;
}
}
function level5() {
var _local4;
var _local1;
var _local2;
var _local5;
var _local3;
_local3 = 0;
while (_local3 < 3) {
_local2 = Math.ceil(Math.random() * 7);
_local4 = 0;
while (_local4 < dataw) {
_local1 = 0;
while (_local1 < 3) {
if ((_local1 % 2) == 0) {
_local2 = _local2 + _local3;
}
if (_local2 > 7) {
_local2 = 1;
}
if (data1[_local4][_local1 + (_local3 * 3)].isi != -1) {
data1[_local4][_local1 + (_local3 * 3)].isi = _local2;
}
_local1++;
}
_local4++;
}
_local3++;
}
}
function level6() {
var _local2;
var _local1;
var _local4;
var _local3;
var _local5;
_local5 = 0;
while (_local5 < 3) {
_local4 = Math.ceil(Math.random() * 7);
_local2 = 0;
while (_local2 < dataw) {
if ((_local1 % 2) == 0) {
_local4++;
}
if (_local4 > 7) {
_local4 = 1;
}
_local1 = 0;
while (_local1 < 2) {
if (data1[_local2][_local1 + (_local5 * 2)].isi != -1) {
data1[_local2][_local1 + (_local5 * 2)].isi = _local4;
}
_local1++;
}
_local2++;
}
_local5++;
}
_local2 = 0;
while (_local2 < 14) {
_local3 = data1[0][0].isi;
while (_local3 == data1[0][0].isi) {
_local3 = Math.ceil(Math.random() * 7);
}
data1[4][_local2].isi = _local3;
_local3 = data1[0][0].isi;
while (_local3 == data1[0][0].isi) {
_local3 = Math.ceil(Math.random() * 7);
}
data1[5][_local2].isi = _local3;
_local2++;
}
}
function onEnterFrame() {
if (scoreAnim1._visible) {
scoreAnim1.scoreTxt.scoreTxt.text = "+" + isiScoreAnim;
}
var _local2;
arrowAngle = getAngle(_root._xmouse - xArrow, _root._ymouse - yArrow) + 90;
if ((arrowAngle < -80) || (arrowAngle > 180)) {
arrowAngle = -80;
}
if (arrowAngle > 80) {
arrowAngle = 80;
}
arrow._rotation = arrowAngle;
gerakShoot();
if (paused == false) {
if (waktu > 0) {
waktu--;
if ((waktu % fps) == 0) {
timeTxt.text = Math.ceil(waktu / fps);
}
if (waktu == 0) {
timeOut();
}
}
}
}
function gerakShoot() {
i = 0;
while (i < 10) {
if (shooting) {
lhit = -1;
bolaTembak._x = bolaTembak._x + bolaTembak._dx;
bolaTembak._y = bolaTembak._y + bolaTembak._dy;
if (bolaTembak._x <= scrLeft) {
bolaTembak._x = scrLeft;
bolaTembak._dx = -bolaTembak._dx;
}
if ((bolaTembak._x + w) >= (scrLeft + (dataw * w))) {
bolaTembak._x = (scrLeft + (dataw * w)) - w;
bolaTembak._dx = -bolaTembak._dx;
}
yy = getRealPosY(bolaTembak._y + sh);
xx = getRealPosX(bolaTembak._x + sh, yy);
if (lhit < 0) {
if (((yy - 1) >= 0) && (data1[xx][yy - 1].isi > 0)) {
if (hit(bolaTembak._x + sh, bolaTembak._y + sh, xx, yy - 1)) {
lhit = 0;
}
}
}
if (lhit < 0) {
if ((((yy - 1) >= 0) && ((xx - 1) >= 0)) && (data1[xx - 1][yy - 1].isi > 0)) {
if (hit(bolaTembak._x + sh, bolaTembak._y + sh, xx - 1, yy - 1)) {
lhit = 0;
}
}
}
if (lhit < 0) {
if ((((yy - 1) >= 0) && ((xx + 1) < dataw)) && (data1[xx + 1][yy - 1].isi > 0)) {
if (hit(bolaTembak._x + sh, bolaTembak._y + sh, xx + 1, yy - 1)) {
lhit = 0;
}
}
}
if (lhit < 0) {
if (((yy >= 0) && ((xx - 1) >= 0)) && (data1[xx - 1][yy].isi > 0)) {
if (hit(bolaTembak._x + sh, bolaTembak._y + sh, xx - 1, yy)) {
lhit = 0;
}
}
}
if (lhit < 0) {
if (((yy >= 0) && ((xx + 1) < dataw)) && (data1[xx + 1][yy].isi > 0)) {
if (hit(bolaTembak._x + sh, bolaTembak._y + sh, xx + 1, yy)) {
lhit = 0;
}
}
}
if (bolaTembak._y <= scrTop) {
bolaTembak._y = scrTop;
bolaTembak._dy = 0;
bolaTembak._dx = 0;
yy = 0;
lhit = 0;
}
if (lhit >= 0) {
_root.playSfx(1);
var _local4;
if (data1[xx][yy].isi != 0) {
yy = yy + 1;
}
if (data1[xx][yy].isi != 0) {
xx = xx - 1;
}
if (data1[xx][yy].isi != 0) {
xx = xx + 2;
}
data1[xx][yy].isi = bolaTembak._isi;
data1[xx][yy].dropped = false;
_local4 = bolaTembak._isi;
this[getBolaName(xx, yy)].gotoAndStop(data1[xx][yy].isi);
bolaTembak.removeMovieClip();
shooting = false;
if (yy == (datah - 1)) {
levelOver = true;
levelOverProc();
}
if (levelOver == false) {
var _local3 = 1;
setVisited(false);
_local3 = getGoneCtr(xx, yy, data1[xx][yy].isi);
if (_local3 >= 3) {
_root.score = _root.score + (_local3 * 5);
if (objective[_local4 - 1] > 0) {
gotObjective[_local4 - 1] = gotObjective[_local4 - 1] + _local3;
}
gone();
setDropped(true);
i = 0;
while (i < dataw) {
if (data1[i][0].isi > 0) {
data1[i][0].dropped = false;
if (((((i - 1) >= 0) && (data1[i - 1][1].isi > 0)) && (data1[i - 1][1].visited == false)) && (data1[i - 1][1].dropped == true)) {
setDropBelow(i - 1, 1);
}
if (((data1[i][1].isi > 0) && (data1[i][1].visited == false)) && (data1[i][1].dropped == true)) {
setDropBelow(i, 1);
}
}
i++;
}
dropIt();
updateObjective();
}
}
}
}
i++;
}
}
function dropIt() {
var _local4;
var _local3;
_local4 = 0;
while (_local4 < datah) {
_local3 = 0;
while (_local3 < dataw) {
if ((data1[_local3][_local4].dropped == true) && (data1[_local3][_local4].isi > 0)) {
if (objective[data1[_local3][_local4].isi - 1] > 0) {
gotObjective[data1[_local3][_local4].isi - 1] = gotObjective[data1[_local3][_local4].isi - 1] + 1;
}
_root.score = _root.score + 5;
this[getBolaName(_local3, _local4)].gotoAndStop("none");
var _local5 = getBolaJatuhName(_local3, _local4);
attachMovie("bola_jatuh", _local5, getBolaJatuhDepth(_local3, _local4), {_x:-100, _y:-100});
this[_local5].bola.gotoAndStop(data1[_local3][_local4].isi);
this[_local5]._x = data1[_local3][_local4]._xc - sh;
this[_local5]._y = data1[_local3][_local4]._yc - sh;
data1[_local3][_local4].isi = 0;
}
_local3++;
}
_local4++;
}
}
function setDropBelow(x, y) {
var _local4;
var _local3;
_local3 = true;
if (data1[x][y].isi > 0) {
data1[x][y].dropped = false;
if ((((x - 1) >= 0) && (data1[x - 1][y].isi > 0)) && (data1[x - 1][y].dropped)) {
setDropBelow(x - 1, y);
}
if ((((x + 1) < dataw) && (data1[x + 1][y].isi > 0)) && (data1[x + 1][y].dropped == true)) {
setDropBelow(x + 1, y);
}
if ((((y + 1) < datah) && (data1[x][y + 1].isi > 0)) && (data1[x][y + 1].dropped == true)) {
setDropBelow(x, y + 1);
}
if ((((y - 1) >= 0) && (data1[x][y - 1].isi > 0)) && (data1[x][y - 1].dropped == true)) {
setDropBelow(x, y - 1);
}
if ((y % 2) == 0) {
if (((((x - 1) >= 0) && ((y + 1) < datah)) && (data1[x - 1][y + 1].isi > 0)) && (data1[x - 1][y + 1].dropped)) {
setDropBelow(x - 1, y + 1);
}
if (((((x - 1) >= 0) && ((y - 1) >= 0)) && (data1[x - 1][y - 1].isi > 0)) && (data1[x - 1][y - 1].dropped)) {
setDropBelow(x - 1, y - 1);
}
} else {
if (((((x + 1) < dataw) && ((y + 1) < datah)) && (data1[x + 1][y + 1].isi > 0)) && (data1[x + 1][y + 1].dropped)) {
setDropBelow(x + 1, y + 1);
}
if (((((x + 1) < dataw) && ((y - 1) >= 0)) && (data1[x + 1][y - 1].isi > 0)) && (data1[x + 1][y - 1].dropped)) {
setDropBelow(x + 1, y - 1);
}
}
}
}
function shoot(isi, angle) {
_root.playSfx(2);
shooting = true;
duplicateMovieClip ("bolaNow", "bolaTembak", 2503);
bolaTembak.gotoAndStop(bolaNowIsi);
var _local2 = 3;
bolaTembak._dx = Math.cos(((angle - 90) * Math.PI) / 180) * _local2;
bolaTembak._dy = Math.sin(((angle - 90) * Math.PI) / 180) * _local2;
bolaTembak._isi = isi;
}
function getGoneCtr(xx, yy, isi) {
var _local3;
_local3 = 0;
if (data1[xx][yy].isi == isi) {
_local3 = 1;
data1[xx][yy].visited = true;
if ((yy % 2) == 0) {
if (((((xx - 1) >= 0) && ((yy - 1) >= 0)) && (data1[xx - 1][yy - 1].isi == data1[xx][yy].isi)) && (data1[xx - 1][yy - 1].visited == false)) {
_local3 = _local3 + getGoneCtr(xx - 1, yy - 1, isi);
}
if ((((xx >= 0) && ((yy - 1) >= 0)) && (data1[xx][yy - 1].isi == data1[xx][yy].isi)) && (data1[xx][yy - 1].visited == false)) {
_local3 = _local3 + getGoneCtr(xx, yy - 1, isi);
}
if ((((xx - 1) >= 0) && (data1[xx - 1][yy].isi == data1[xx][yy].isi)) && (data1[xx - 1][yy].visited == false)) {
_local3 = _local3 + getGoneCtr(xx - 1, yy, isi);
}
if ((((xx + 1) < dataw) && (data1[xx + 1][yy].isi == data1[xx][yy].isi)) && (data1[xx + 1][yy].visited == false)) {
_local3 = _local3 + getGoneCtr(xx + 1, yy, isi);
}
if (((((xx - 1) >= 0) && ((yy + 1) < datah)) && (data1[xx - 1][yy + 1].isi == data1[xx][yy].isi)) && (data1[xx - 1][yy + 1].visited == false)) {
_local3 = _local3 + getGoneCtr(xx - 1, yy + 1, isi);
}
if ((((yy + 1) < datah) && (data1[xx][yy + 1].isi == data1[xx][yy].isi)) && (data1[xx][yy + 1].visited == false)) {
_local3 = _local3 + getGoneCtr(xx, yy + 1, isi);
}
} else {
if ((((xx >= 0) && ((yy - 1) >= 0)) && (data1[xx][yy - 1].isi == data1[xx][yy].isi)) && (data1[xx][yy - 1].visited == false)) {
_local3 = _local3 + getGoneCtr(xx, yy - 1, isi);
}
if (((((xx + 1) < dataw) && ((yy - 1) >= 0)) && (data1[xx + 1][yy - 1].isi == data1[xx][yy].isi)) && (data1[xx + 1][yy - 1].visited == false)) {
_local3 = _local3 + getGoneCtr(xx + 1, yy - 1, isi);
}
if ((((xx - 1) >= 0) && (data1[xx - 1][yy].isi == data1[xx][yy].isi)) && (data1[xx - 1][yy].visited == false)) {
_local3 = _local3 + getGoneCtr(xx - 1, yy, isi);
}
if ((((xx + 1) < dataw) && (data1[xx + 1][yy].isi == data1[xx][yy].isi)) && (data1[xx + 1][yy].visited == false)) {
_local3 = _local3 + getGoneCtr(xx + 1, yy, isi);
}
if ((((yy + 1) < datah) && (data1[xx][yy + 1].isi == data1[xx][yy].isi)) && (data1[xx][yy + 1].visited == false)) {
_local3 = _local3 + getGoneCtr(xx, yy + 1, isi);
}
if (((((xx + 1) < dataw) && ((yy + 1) < datah)) && (data1[xx + 1][yy + 1].isi == data1[xx][yy].isi)) && (data1[xx + 1][yy + 1].visited == false)) {
_local3 = _local3 + getGoneCtr(xx + 1, yy + 1, isi);
}
}
return(_local3);
}
return(_local3);
}
function gone() {
var _local6 = 0;
var _local4;
var _local3;
_local4 = 0;
while (_local4 < datah) {
_local3 = 0;
while (_local3 < dataw) {
if ((data1[_local3][_local4].isi > 0) && (data1[_local3][_local4].visited)) {
_local6--;
if (_local6 <= 0) {
_root.playSfx(4);
_local6 = 5;
}
var _local5 = getBolaHilangName(_local3, _local4);
this[getBolaName(_local3, _local4)].gotoAndStop("none");
this.attachMovie("bola_hilang", _local5, getBolaHilangDepth(_local3, _local4), {_x:-50, _y:-50});
this[_local5].bola.gotoAndStop(data1[_local3][_local4].isi);
this[_local5]._x = data1[_local3][_local4]._xc - sh;
this[_local5]._y = data1[_local3][_local4]._yc - sh;
data1[_local3][_local4].isi = 0;
}
_local3++;
}
_local4++;
}
}
function getBolaHilangDepth(x, y) {
var _local1;
_local1 = 100 + ((x * datah) + y);
return(_local1);
}
function getBolaHilangName(x, y) {
var _local1;
_local1 = "bolahilang" + ((x * datah) + y);
return(_local1);
}
function getBolaDepth(x, y) {
var _local1;
_local1 = 1000 + ((x * datah) + y);
return(_local1);
}
function getBolaName(x, y) {
var _local1;
_local1 = "bola" + ((x * datah) + y);
return(_local1);
}
function getBolaJatuhName(x, y) {
var _local1;
_local1 = "bolajatuh" + ((x * datah) + y);
return(_local1);
}
function getBolaJatuhDepth(x, y) {
var _local1;
_local1 = 400 + ((x * datah) + y);
return(_local1);
}
function enableFire(v) {
canFire = v;
}
function updateObjective() {
var _local3;
var _local4;
var _local6;
var _local5;
regionTxt.text = regionName[_root.curRegion - 1];
_local6 = 0;
_local5 = 0;
_local3 = 0;
while (_local3 < 7) {
_local5 = gotObjective[_local3];
if (_local5 > objective[_local3]) {
_local5 = objective[_local3];
}
_local6 = _local6 + _local5;
_root.regionPercent[_root.curRegion] = Math.floor((_local6 / totObj) * 100);
_local3++;
}
if (_root.regionPercent[_root.curRegion] > 100) {
_root.regionPercent[_root.curRegion] = 100;
}
regionPercentTxt.text = _root.regionPercent[_root.curRegion] + "%";
_local3 = 0;
while (_local3 < 7) {
if (objective[_local3] != 0) {
if (gotObjective[_local3] > objective[_local3]) {
_local4 = "0";
} else {
_local4 = (objective[_local3] - gotObjective[_local3]).toString();
}
blinkPercent.gotoAndPlay(1);
} else {
_local4 = "--";
}
if (this[objectiveName[_local3]].text != _local4) {
this[objectiveHighlight[_local3]].gotoAndPlay(1);
this[objectiveName[_local3]].text = _local4;
}
_local3++;
}
scoreAnim1.scoreTxt.scoreTxt.text = "+40";
if (scoreTxt.text != _root.score.toString()) {
isiScoreAnim = (_root.score - scoreTxt.text).toString();
scoreAnim1._visible = true;
scoreAnim1.gotoAndPlay(1);
scoreTxt.text = _root.score;
}
}
function timeOut() {
paused = true;
info.txt.text = "Campaign is Over\nTime is up !";
info.swapDepths(this.getNextHighestDepth());
info._visible = true;
}
function levelOverProc() {
paused = true;
info.txt.text = "Campaign is Over\nYou have reach the bottom line";
info.swapDepths(this.getNextHighestDepth());
info._visible = true;
}
var regionName = Array("PACIFIC", "MOUNTAIN", "MIDWEST", "SOUTH", "NORTHEAST", "HAWAII");
var fps = 24;
var isiScoreAnim;
var objective = Array(0, 0, 0, 0, 0, 0, 0);
var gotObjective = Array(0, 0, 0, 0, 0, 0, 0);
var objectiveName = Array("educationTxt", "defenseTxt", "religionTxt", "monetaryTxt", "mediaTxt", "cultureTxt", "technologyTxt");
var objectiveHighlight = Array("blinkEducation", "blinkDefense", "blinkReligion", "blinkMonetary", "blinkMedia", "blinkCulture", "blinkTechnology");
var canFire;
var paused;
var w = 30;
var level;
var h = 30;
var sh = Math.floor(w / 2);
var scrLeft = 170;
var scrTop = 14;
var dataw = 10;
var datah = 16;
var maxType = 7;
var rapetAtas = -4;
var data1 = [new Array(dataw)];
var curAngle;
var xArrow;
var yArrow;
var bolaNowIsi;
var bolaNextIsi;
var mouseHandler = new Object();
var shooting;
var levelOver;
var arrowAngle;
var waktu;
var totObj;
_root.playBG(1);
Mouse.addListener(mouseHandler);
init();
mouseHandler.onMouseUp = function () {
if ((((!shooting) && (levelOver == false)) && (canFire)) && (paused == false)) {
shoot(bolaNowIsi, arrowAngle);
bolaNowIsi = bolaNextIsi;
bolaNextIsi = getBolaRandom();
bolaNow.gotoAndStop(bolaNowIsi);
bolaNext.gotoAndStop(bolaNextIsi);
}
};
playBtn.onRelease = function () {
paused = false;
playBtn._visible = false;
pauseBtn._visible = true;
};
pauseBtn.onRelease = function () {
paused = true;
pauseBtn._visible = false;
playBtn._visible = true;
};
soundBtn.onRelease = function () {
_root.muting = true;
nosoundBtn._visible = true;
soundBtn._visible = false;
_root.playBG(1);
};
nosoundBtn.onRelease = function () {
_root.muting = false;
nosoundBtn._visible = false;
soundBtn._visible = true;
_root.playBG(1);
};
endcampaignBtn.onRelease = function () {
paused = true;
endcmpgn._visible = true;
endcmpgn.swapDepths(50005);
};
playBtn.onRollOver = function () {
enableFire(false);
};
playBtn.onRollOut = function () {
enableFire(true);
};
pauseBtn.onRollOver = function () {
enableFire(false);
};
pauseBtn.onRollOut = function () {
enableFire(true);
};
soundBtn.onRollOver = function () {
enableFire(false);
};
soundBtn.onRollOut = function () {
enableFire(true);
};
nosoundBtn.onRollOver = function () {
enableFire(false);
};
nosoundBtn.onRollOut = function () {
enableFire(true);
};
endcampaignBtn.onRollOver = function () {
enableFire(false);
};
endcampaignBtn.onRollOut = function () {
enableFire(true);
};
info.button.onRelease = function () {
_root.gotoAndStop("maps");
};
endcmpgn.yesbtn.onRelease = function () {
endcmpgn._visible = false;
_root.gotoAndStop("maps");
paused = false;
};
endcmpgn.nobtn.onRelease = function () {
endcmpgn._visible = false;
paused = false;
};
Symbol 151 MovieClip [bola2] Frame 1
stop();
Symbol 210 MovieClip [bola] Frame 1
stop();
Symbol 211 MovieClip [bola_hilang] Frame 15
stop();
bola.swapDepths(9999999);
this.removeMovieClip();
Symbol 212 MovieClip [bola_jatuh] Frame 35
stop();
bola.swapDepths(9999999);
this.removeMovieClip();
Symbol 223 MovieClip [blitzAnim] Frame 12
this.removeMovieClip();
Symbol 227 MovieClip [charaAnim] Frame 15
stop();
Symbol 238 MovieClip [titleAnim] Frame 29
stop();
Symbol 247 MovieClip [menu] Frame 1
function onEnterFrame() {
if (Math.random() < 0.5) {
i++;
this.attachMovie("blitzAnim", "blitz" + i, i + 20, {_x:random(640), _y:random(300)});
var _local2;
_local2 = random(40);
this["blitz" + i]._xscale = _local2 + 60;
this["blitz" + i]._yscale = _local2 + 60;
}
}
var i;
i = 0;
startBtn.onRelease = function () {
_root.gotoAndStop("instruction");
};
playMoreBtn.onRelease = function () {
getURL ("http://www.dailyfreegames.com", "_blank");
};
addGameBtn.onRelease = function () {
getURL ("http://www.dailyfreegames.com/free-games.html", "_blank");
};
_root.playBG(4);
Symbol 287 MovieClip [birdsanim] Frame 30
stop();
Symbol 332 MovieClip [playerv] Frame 1
stop();
Symbol 337 MovieClip [selectplayer] Frame 1
function init() {
this._alpha = 100;
_root.curPlayer = -1;
player1.gotoAndStop(2);
blurx = 100;
blury = 100;
dd = -5;
filterArray.push(bFilter);
ctr = 0;
}
function onEnterFrame() {
if ((blurx > 0) && (dd < 0)) {
blurx = blurx + dd;
blury = blury + dd;
bFilter.blurX = blurx;
bFilter.blurY = blury;
this.filters = filterArray;
}
if ((blurx < 100) && (dd > 0)) {
blurx = blurx + dd;
blury = blury + dd;
bFilter.blurX = blurx;
bFilter.blurY = blury;
this.filters = filterArray;
}
if (ctr > 0) {
ctr--;
if (ctr == 0) {
dd = 5;
}
}
if ((dd > 0) && (this._alpha > 0)) {
this._alpha = this._alpha - dd;
if (this._alpha <= 10) {
_root.gotoAndStop("maps");
}
}
}
var blurx;
var blury;
var bFilter = (new flash.filters.BlurFilter(30, 30, 1));
var filterArray = new Array();
var ctr;
init();
backtomenu.onRelease = function () {
_root.gotoAndStop("menu");
};
player1.onRollOver = function () {
player1._xscale = 120;
player1._yscale = 120;
player1._x = player1._x - 20;
player1._y = player1._y - 20;
};
player2.onRollOver = function () {
player2._xscale = 120;
player2._yscale = 120;
player2._x = player2._x - 20;
player2._y = player2._y - 20;
};
player1.onRollOut = function () {
player1._xscale = 100;
player1._yscale = 100;
player1._x = player1._x + 20;
player1._y = player1._y + 20;
};
player2.onRollOut = function () {
player2._xscale = 100;
player2._yscale = 100;
player2._x = player2._x + 20;
player2._y = player2._y + 20;
};
player1.onRelease = function () {
if (_root.curPlayer == -1) {
_root.curPlayer = 2;
attachMovie("birdsanim", "birdy", 100, {_x:640, _y:480});
_root.playSfx(3);
ctr = 35;
}
};
player2.onRelease = function () {
if (_root.curPlayer == -1) {
_root.playSfx(3);
ctr = 35;
_root.curPlayer = 1;
attachMovie("birdsanim", "birdy", 100, {_x:640, _y:480});
}
};
Symbol 369 MovieClip [region1] Frame 1
stop();
Symbol 383 MovieClip [region2] Frame 1
stop();
Symbol 399 MovieClip [region3] Frame 1
stop();
Symbol 413 MovieClip [region4] Frame 1
stop();
Symbol 427 MovieClip [region5] Frame 1
stop();
Symbol 431 MovieClip [region6] Frame 1
stop();
Symbol 438 MovieClip [selectregion] Frame 1
function init() {
mode1 = 1;
info._visible = false;
info.swapDepths(4000);
info.txt.text = "Already Visited !";
this._alpha = 0;
blurx = 100;
blury = 100;
dd = -10;
filterArray.push(bFilter);
ctr = 0;
windAnim.swapDepths(250);
windAnim2.swapDepths(251);
i = 1;
while (i <= 6) {
this["region" + i].percent.text = _root.regionPercent[i] + "%";
i++;
}
i = 1;
while (i <= 6) {
this["region" + i].isi = i;
this["region" + i].gotoAndStop(1);
this["region" + i].onRollOver = function () {
this.gotoAndStop(2);
this.swapDepths(200 + i);
};
this["region" + i].onRollOut = function () {
this.swapDepths(100 + i);
this.gotoAndStop(1);
};
this["region" + i].onRelease = function () {
if (mode1 == 0) {
_root.curRegion = this.isi;
if (_root.regionVisited[this.isi] == false) {
_root.regionVisited[this.isi] = true;
ctr = 1;
act = 1;
} else {
info._visible = true;
}
}
};
i++;
}
attachMovie("plane", "plane", 249, {_x:-100, _y:Math.floor(Math.random() * 400)});
plane.dx = ((Math.random() * 2) + 2) + 20;
}
function onEnterFrame() {
mode1 = 0;
if ((blurx > 0) && (dd < 0)) {
mode1 = 1;
this._alpha = this._alpha - dd;
blurx = blurx + dd;
blury = blury + dd;
bFilter.blurX = blurx;
bFilter.blurY = blury;
this.filters = filterArray;
}
if ((blurx < 100) && (dd > 0)) {
mode1 = 1;
blurx = blurx + dd;
blury = blury + dd;
bFilter.blurX = blurx;
bFilter.blurY = blury;
this.filters = filterArray;
}
if (ctr > 0) {
ctr--;
if (ctr == 0) {
dd = 5;
}
}
if ((dd > 0) && (this._alpha > 0)) {
this._alpha = this._alpha - dd;
mode1 = 1;
if (this._alpha <= 0) {
switch (act) {
case 1 :
_root.gotoAndStop("game");
break;
case 2 :
_root.gotoAndStop("vote");
}
}
}
windAnim._x = windAnim._x + 4;
windAnim2._x = windAnim2._x + 4;
if (windAnim._x >= 640) {
windAnim._x = windAnim2._x - windAnim._width;
}
if (windAnim2._x >= 640) {
windAnim2._x = windAnim._x - windAnim2._width;
}
plane._x = plane._x + plane.dx;
if (((plane.dx > 0) && (plane._x > 660)) || ((plane.dx < 0) && (((plane._x + plane._width) + 200) < 0))) {
var _local3 = Math.floor((Math.random() * 50) + 50);
plane._yscale = _local3;
plane.dx = ((2 * (Math.floor(Math.random() * 2) - 1)) * (plane._xscale / 30)) + 5;
plane._y = (Math.random() * 400) + 50;
if (plane.dx < 0) {
plane._xscale = -_local3;
} else {
plane._xscale = _local3;
}
if (plane.dx < 0) {
plane._x = 740;
} else {
plane._x = -100;
}
}
}
var act;
var blurx;
var blury;
var bFilter = (new flash.filters.BlurFilter(30, 30, 1));
var filterArray = new Array();
var ctr;
var mode1;
_root.playBG(2);
info.button.onRelease = function () {
info._visible = false;
};
init();
backtomenu.onRelease = function () {
_root.gotoAndStop("menu");
};
voteBtn.onRelease = function () {
if (mode1 == 0) {
ctr = 1;
act = 2;
}
};
Symbol 457 MovieClip [lingAnim] Frame 29
stop();
Symbol 512 MovieClip Frame 1
stop();
Symbol 516 MovieClip [vote] Frame 1
function blitzing() {
if (Math.random() < 0.5) {
iz++;
this.attachMovie("blitzAnim", "blitz" + iz, iz + 50, {_x:random(640), _y:random(300)});
var _local2;
_local2 = random(40);
this["blitz" + iz]._xscale = _local2 + 60;
this["blitz" + iz]._yscale = _local2 + 60;
}
}
function init() {
pp1 = 0;
pp2 = 0;
p1.text = "0";
p2.text = "0";
lingAnim._y = -82.2;
lingAnim.gotoAndStop(1);
backtomenu._y = 487.4;
mode1 = 0;
ctr1 = 0;
dly = 10;
var _local4;
var _local3;
var _local2;
_local2 = 0;
i = 0;
while (i < 6) {
_local2 = _local2 + _root.regionPercent[i];
i++;
}
if (_root.curPlayer == 2) {
_local4 = _local2;
_local3 = 600 - _local4;
} else {
_local3 = _local2;
_local4 = 600 - _local3;
}
if (_local4 == _local3) {
_local4++;
_local3--;
}
_local4 = _local4 / 3;
_local3 = _local3 / 3;
d1 = 1.17 * (_local4 / 200);
d2 = 1.17 * (_local3 / 200);
progress1.progress2._y = 234;
progress2.progress2._y = 234;
player2.gotoAndStop(4);
if (_local4 > _local3) {
lingAnim._x = 41.4;
} else {
lingAnim._x = 446.4;
}
}
function onEnterFrame() {
if (dly > 0) {
dly--;
} else {
startVoting();
}
if ((mode1 == 1) && (mode1 != 3)) {
backtomenu._y = backtomenu._y - 5;
if ((backtomenu._y < 404) && (mode1 == 1)) {
lingAnim.gotoAndPlay(2);
backtomenu._y = 404;
mode1 = 3;
}
}
if (mode1 == 4) {
blitzing();
}
if (mode1 == 3) {
mode1 = 4;
_root.playBG(3);
if (pp1 > pp2) {
player1.gotoAndStop(2);
player2.gotoAndStop(6);
} else {
player1.gotoAndStop(3);
player2.gotoAndStop(5);
}
}
}
function startVoting() {
if (ctr1 < 200) {
pp1 = ((d1 * (ctr1 + 1)) / 234) * 100;
p1.text = Math.floor(pp1);
pp2 = ((d2 * (ctr1 + 1)) / 234) * 100;
p2.text = Math.floor(pp2);
progress1.progress2._y = progress1.progress2._y - d1;
progress2.progress2._y = progress2.progress2._y - d2;
ctr1++;
if (ctr1 >= 200) {
if (pp1 > pp2) {
if ((Number(p1.text) + Number(p2.text)) < 100) {
p1.text = Number(p1.text) + 1;
}
} else if ((Number(p1.text) + Number(p2.text)) < 100) {
p2.text = Number(p2.text) + 1;
}
mode1 = 1;
}
}
}
var dly;
var d1;
var d2;
var ctr1;
var mode1;
var pp1;
var pp2;
_root.playBG(0);
var iz;
iz = 0;
backtomenu.onRelease = function () {
_root.gotoAndStop("menu");
};
init();
Symbol 525 MovieClip Frame 1
stop();
Symbol 534 MovieClip Frame 1
stop();
okBtn.onRelease = function () {
_root.curPlayer = 2;
_root.gotoAndStop("maps");
};