Frame 1
Frame 3
function getphstatus(phno) {
swfurl = this._url;
if ((swfurl.split("games2win.com").length == 1) or ((gurl.split("/").length < 2) or (gurl eq undefined))) {
obj_game.ph1_status = true;
}
var _local2 = obj_game[("ph" + phno) + "_status"];
if ((!_local2) or (_local2 eq undefined)) {
play();
}
}
function __com_mochibot__(swfid, mc, lv, trk) {
var x;
var g;
var s;
var fv;
var sb;
var u;
var res;
var mb;
var mbc;
mb = "__mochibot__";
mbc = "mochibot.com";
g = (_global ? (_global) : (_level0._root));
if (g[mb + swfid]) {
return(g[mb + swfid]);
}
s = System.security;
x = mc._root.getSWFVersion;
fv = (x ? (mc.getSWFVersion()) : ((_global ? 6 : 5)));
if (!s) {
s = {};
}
sb = s.sandboxType;
if (sb == "localWithFile") {
return(null);
}
x = s.allowDomain;
if (x) {
s.allowDomain(mbc);
}
x = s.allowInsecureDomain;
if (x) {
s.allowInsecureDomain(mbc);
}
u = (((((((((((("http://" + mbc) + "/my/core.swf?mv=7&fv=") + fv) + "&v=") + escape(getVersion())) + "&swfid=") + escape(swfid)) + "&l=") + lv) + "&f=") + mc) + (sb ? ("&sb=" + sb) : "")) + (trk ? "&t=1" : "");
lv = ((fv > 6) ? (mc.getNextHighestDepth()) : ((g[mb + "level"] ? (g[mb + "level"] + 1) : (lv))));
g[mb + "level"] = lv;
if (fv == 5) {
res = "_level" + lv;
if (!eval (res)) {
loadMovieNum (u, lv);
}
} else {
res = mc.createEmptyMovieClip(mb + swfid, lv);
res.loadMovie(u);
}
trace(u + " Mochi tracker");
return(res);
}
function load_rgames(trgt) {
var rel_games = new XML();
rel_games.ignoreWhite = true;
rel_games.onLoad = function () {
game_details = new Object();
var _local1 = 0;
while (_local1 < trgt.rel_games.firstChild.childNodes.length) {
game_details[rel_games.firstChild.childNodes[_local1].nodeName] = rel_games.firstChild.childNodes[_local1].firstChild.nodeValue;
_local1++;
}
};
rel_games.load((curl + "game_details.xml?") + getTimer());
}
function getScore(_loc) {
_loc.gotoAndStop("lbl_top_scores");
_root.g_trg = _loc;
int_gscore = setInterval(_root, "getTop10", 150);
}
function getTop10() {
trace("getTop10");
clearInterval(int_gscore);
_root.send_lv = new XML();
_root.rst_lv = new XML();
_root.rst_lv.onLoad = function (success) {
if (success) {
var _local3 = new it.sephiroth.XML2Object();
_root.lst_top_scorer = _local3.parseXML(this);
_root.g_trg.gotoAndStop("top10");
} else {
_root.c_fail++;
if (_root.c_fail >= 3) {
_root.g_trg.gotoAndStop("error_screen");
} else {
_root.send_lv.sendAndLoad(url, _root.rst_lv, "POST");
}
}
};
var url = ((((((obj_partner.top10URL + "?game_id=") + _root.obj_game._gid) + "&order=") + obj_game._score_ord) + "&timspam") + getTimer());
trace(url + " Url");
_root.send_lv.sendAndLoad(url, _root.rst_lv, "POST");
}
function itemHandler(obj, item) {
getURL ("http://www.games2win.com/", "_blank");
}
function _newUser() {
getURL (_registerurl, "_blank");
}
function _trackClickThru(mc) {
if (obj_partner._allowclick) {
mc.hit_area.onRelease = function () {
getURL (obj_partner.clickthru, "_blank");
};
} else {
mc.hit_area.useHandCursor = false;
}
}
function _readSharedData() {
so_uname = ((_sostatus.data.so_uname == undefined) ? "" : (_sostatus.data.so_uname));
so_jumpframe = ((_sostatus.data.so_jumpframe == undefined) ? "" : (_sostatus.data.so_jumpframe));
so_sound = ((_sostatus.data.so_sound == undefined) ? 0 : (_sostatus.data.so_sound));
_resetString = _sostatus.data.so_resetString;
trace("==========================");
trace((("so_jumpframe : " + _sostatus.data.so_jumpframe) + " : ") + so_uname);
if (so_jumpframe != "") {
_assignValue(_resetString);
createEmptyMovieClip("eye", getNextHighestDepth());
eye.onEnterFrame = function () {
if ((getBytesTotal() == getBytesLoaded()) and (getBytesLoaded() > 50000)) {
intro = 0;
_sostatus.data.so_jumpframe = "";
_sostatus.flush();
this.onEnterFrame = null;
gotoAndStop(so_jumpframe);
}
};
} else {
intro = 1;
play();
}
uname = so_uname;
gamesound = so_sound;
}
function _writeSharedData(jumpframe, jumpurl, _resetString) {
_sostatus.data.so_uname = ((so_uname == undefined) ? "" : (so_uname));
_sostatus.data.so_sound = so_sound;
_sostatus.data.so_resetString = _resetString;
_sostatus.data.so_jumpframe = jumpframe;
_sostatus.flush();
if (jumpurl != "") {
getURL (jumpurl);
} else {
gotoAndPlay (1);
}
}
function _assignValue(_val) {
_arr = new Array();
_arr = _val.split("|");
i = 0;
while (i < (_arr.length / 2)) {
_var2 = ((i * 2) + 1) - 1;
_var3 = _var2 + 1;
_val = _arr[_var3];
_rst = isNaN(_val);
if (_rst) {
_root[_arr[_var2]] = _arr[_var3];
} else {
_root[_arr[_var2]] = int(_arr[_var3]);
}
i++;
}
}
function _playAgain(mc, jumpframe, _resetString) {
so_uname = uname;
if ((gurl != undefined) and (gurl != "")) {
_writeSharedData(jumpframe, gurl, _resetString);
} else {
trace((("else" + mc) + " ") + jumpframe);
intro = 0;
_assignValue(_resetString);
mc.gotoAndStop(jumpframe);
}
}
function g2w_playagain() {
_root.score = 0;
if (_complete) {
_playAgain(_root, "lblgameintro");
} else {
str_playagain = "current_level|" + _root.current_level;
_playAgain(_root, "jumpframe", str_playagain);
}
}
var obj_game = new Array();
obj_game._gid = "1075";
obj_game._tra = "meal_tower";
obj_game._gname = "meal_tower";
obj_game._gtitle = "Meal Tower";
obj_game._google_text = "Meal Tower";
obj_game.StageW = 700;
obj_game.StageH = 525;
obj_game._res = (Stage.width + "x") + Stage.height;
obj_game._score_ord = "desc";
obj_game.mochi_tag = "";
obj_game.g2wbot = "ba1f153d";
obj_game.g2wbotid = 10301;
obj_game.ph1_status = false;
obj_game.ph2_status = false;
obj_game.adv_zedo = true;
obj_game.adv_mochi = false;
obj_game.inviziads = (("http://ads.inviziads.com/ad.html/g=" + obj_game._gid) + "&h=g2w&ts=") + getTimer();
zedo_tim = 15;
var obj_partner = new Array();
obj_partner.partner_name = "g2w";
obj_partner.partner_id = 1;
obj_partner.invalid_txt = "Invalid Nickname!";
obj_partner.show_submit = false;
obj_partner.submitURL = "/submit_score.asp";
obj_partner.top10URL = "/get_top_scorer.asp";
obj_partner.lblsubmit = "Enter your Games2win Nickname below";
obj_partner.show_g2w_slate = true;
obj_partner.show_register = true;
obj_partner.text_register = "Create Nickname";
obj_partner.url_register = "http://www.games2win.com/register.asp";
obj_partner.clickthru = "http://www.games2win.com";
obj_partner._allowclick = true;
_root.uname = "";
scoreSubmit = function (_loc) {
trace(_loc + " _loc");
myname = _root.partner_uname;
myscore = _root.partner_score;
mygameid = _root.obj_game._gid;
myname = myname.trim();
if ((((myname.length == 0) or (myname == obj_partner.invalid_txt)) or (myname == "Connecting Error!")) or (myname == undefined)) {
trace(obj_partner.invalid_txt);
_root.partner_uname = obj_partner.invalid_txt;
} else {
_root.send_lv = new LoadVars();
_root.send_lv.onLoad = function (success) {
if (success) {
if (_root.send_lv.isreg == 0) {
_root.uname = obj_partner.invalid_txt;
_loc.gotoAndStop("invalid_user_screen");
} else if (_root.send_lv.isreg == 1) {
Key.removeListener(_loc.keyListener);
_root.getScore(_loc);
}
} else {
_loc.gotoAndStop("error_screen");
}
};
_root.send_lv.nickname = myname;
_root.send_lv.points = myscore;
_root.send_lv.gameid = mygameid;
_root.send_lv.sendAndLoad(obj_partner.submitURL, _root.send_lv, "POST");
trace(_root.send_lv);
_loc.gotoAndStop("lbl_submit_screen");
}
};
c_fail = 0;
var g2w_menu = new ContextMenu();
g2w_menu.hideBuiltInItems();
g2w_menu.customItems.push(new ContextMenuItem("Games2win.com", itemHandler));
this.menu = g2w_menu;
var _sostatus = SharedObject.getLocal("gamestatus", "/");
String.prototype.trim = function () {
var _local3 = 0;
var _local2 = this.length;
white = new Object();
white._32 = 1;
_local2--;
while (white["_" + ord(this.charAt(_local2))]) {
}
while (white["_" + ord(this.charAt(_local3++))]) {
}
return(this.slice(_local3 - 1, _local2 + 1));
};
_readSharedData();
Frame 9
stop();
getphstatus(1);
Frame 21
stop();
Frame 31
stop();
Instance of Symbol 291 MovieClip in Frame 31
onClipEvent (load) {
_visible = false;
total = _parent.getBytesTotal();
}
onClipEvent (enterFrame) {
_visible = true;
loaded = _parent.getBytesLoaded();
percent = int((loaded / total) * 100);
this.txt = ("Loaded : " + percent) + "%";
this.bar._width = percent;
if (loaded == total) {
trace("**");
_parent.gotoAndStop("lblgameintro");
}
}
Frame 38
stop();
Frame 48
stop();
_root.allSounds = new Sound(this);
_root.allSounds.attachSound("music");
_root.allSounds.start(0, 100000);
trace(_root.current_level + ">>>>>>>>>>>>>>>>>??????????");
Frame 60
gotoAndStop ("lblgame");
Symbol 12 MovieClip [star] Frame 60
this.removeMovieClip();
Symbol 15 MovieClip Frame 33
this._parent.removeMovieClip();
Symbol 19 MovieClip Frame 19
this._parent.removeMovieClip();
Symbol 33 MovieClip [hurry] Frame 1
stop();
Symbol 33 MovieClip [hurry] Frame 203
stop();
gotoAndPlay (19);
Symbol 33 MovieClip [hurry] Frame 240
Symbol 38 MovieClip [greatgoing] Frame 23
stop();
this.removeMovieClip();
Symbol 50 MovieClip [Bonus] Frame 9
stop();
Symbol 56 MovieClip [slow] Frame 18
stop();
Symbol 87 MovieClip [garbage] Frame 1
stop();
Symbol 89 MovieClip Frame 1
this._alpha = 0;
Symbol 92 MovieClip Frame 1
_parent.setColor(1);
stop();
bg._visible = false;
Symbol 92 MovieClip Frame 2
_parent.setColor(2);
Symbol 92 MovieClip Frame 3
Symbol 232 MovieClip [mc_food] Frame 1
function _setColor(id) {
if (id == 2) {
var _local1 = [0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0, 0, 0, 1, 0];
var _local2 = new flash.filters.ColorMatrixFilter(_local1);
_this.filters = [_local2];
} else {
var _local1 = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
var _local2 = new flash.filters.ColorMatrixFilter(_local1);
_this.filters = [_local2];
}
}
function setClock() {
clearInterval(myTime);
myTime = setInterval(function () {
if (_this._currentframe != 1) {
times++;
if ((times % 7) == 0) {
_parent._parent._parent._parent.addToScore(id, 50);
trace((_this + " add score ********************************************* ") + times);
}
}
}, 1000);
}
function clearClock() {
times = 0;
clearInterval(myTime);
}
stop();
var _this = this;
var times;
setClock();
Symbol 236 MovieClip Frame 1
_root._trackClickThru(this);
Symbol 242 MovieClip [game_sound_ctrl] Frame 1
_gameSounds = new Sound();
var frame = "on";
changeVol = function (targetvol, step) {
this.onEnterFrame = function () {
var _local3 = _gameSounds.getVolume();
if ((step < 0) and (_local3 <= targetvol)) {
_local3 = targetvol;
delete this.onEnterFrame;
_root.so_sound = 1;
} else if ((step > 0) and (_local3 >= targetvol)) {
_local3 = targetvol;
delete this.onEnterFrame;
_root.so_sound = 0;
} else {
_gameSounds.setVolume(_local3 + step);
}
};
};
if (_root.so_sound == 1) {
frame = "off";
this.gotoAndPlay(frame);
}
this.onRelease = function () {
if (frame == "on") {
frame = "off";
} else {
frame = "on";
}
this.gotoAndPlay(frame);
};
Symbol 242 MovieClip [game_sound_ctrl] Frame 2
stop();
changeVol(100, 5);
Symbol 242 MovieClip [game_sound_ctrl] Frame 3
stop();
changeVol(0, -5);
Symbol 1010 MovieClip [__Packages.it.sephiroth.XML2Object] Frame 0
class it.sephiroth.XML2Object
{
var oXML;
function XML2Object () {
}
function get xml() {
return(oXML);
}
function parseXML(sFile) {
oResult = new Object();
oXML = sFile;
oResult = translateXML();
return(oResult);
}
function translateXML(from, path, name, position) {
var _local2;
var _local9;
var _local4;
var _local10;
if (path == undefined) {
path = this;
name = "oResult";
}
path = path[name];
if (from == undefined) {
from = new XML(xml.toString());
from.ignoreWhite = true;
}
if (from.hasChildNodes()) {
_local9 = from.childNodes;
if (position != undefined) {
_local10 = path;
path = path[position];
}
while (_local9.length > 0) {
_local4 = _local9.shift();
_local2 = _local4.nodeName;
if (_local2 != undefined) {
var _local5 = new Object();
_local5.attributes = _local4.attributes;
_local5.data = _local4.firstChild.nodeValue;
if (position != undefined) {
_local10 = path;
}
if (path[_local2] != undefined) {
if (path[_local2].__proto__ == Array.prototype) {
path[_local2].push(_local5);
name = _local4.nodeName;
position = path[_local2].length - 1;
} else {
var _local8 = path[_local2];
path[_local2] = new Array();
path[_local2].push(_local8);
path[_local2].push(_local5);
name = _local2;
position = path[_local2].length - 1;
}
} else {
path[_local2] = _local5;
name = _local2;
position = undefined;
}
}
if (_local4.hasChildNodes()) {
translateXML(_local4, path, name, position);
}
}
}
return(oResult);
}
var oResult = new Object();
}
Symbol 244 MovieClip Frame 1
function brain() {
create_assets(myself, _global.obj_iads.type);
switch (_global.obj_iads.type) {
case "FULL" :
mcLoader.loadClip(_global.obj_iads.url, trgt_main);
break;
case "EMBED" :
mcLoader.loadClip(_global.obj_iads.url, trgt_main.trgt_ads);
if (_global.obj_iads.link ne undefined) {
trgt_main.onRelease = function () {
trace("_global.obj_iads.link " + _global.obj_iads.link);
getURL (_global.obj_iads.link, "_blank");
};
}
break;
}
}
function get_iads(game_id, invizi_url, ver) {
lv_iads = new XML();
lv_result = new XML();
lv_result.ignoreWhite = true;
lv_result.onLoad = function (success) {
trace("success " + success);
if (success) {
parse_iads(lv_result);
myself.attachMovie("invizi_logo", "invizi_logo", this.getNextHighestDepth(), {_x:Stage.width - 120, _y:Stage.height - 20});
} else {
_root.play();
}
};
lv_iads.g = game_id;
lv_iads.h = "as";
lv_iads.sendAndLoad(_root.adurl, lv_result, "POST");
}
function parse_iads(lv_result) {
_global.obj_iads = new Array();
var _local2 = 0;
while (_local2 < lv_result.firstChild.childNodes.length) {
if (lv_result.firstChild.childNodes[_local2].firstChild.nodeValue != null) {
obj_iads[lv_result.firstChild.childNodes[_local2].nodeName] = lv_result.firstChild.childNodes[_local2].firstChild.nodeValue;
} else if (lv_result.firstChild.childNodes[_local2].firstChild.firstChild.nodeValue != null) {
var _local5 = new Object();
var _local4 = 0;
while (_local4 < lv_result.firstChild.childNodes[_local2].childNodes.length) {
_local5[lv_result.firstChild.childNodes[_local2].childNodes[_local4].nodeName] = lv_result.firstChild.childNodes[_local2].childNodes[_local4].firstChild.nodeValue;
_local4++;
}
obj_iads[lv_result.firstChild.childNodes[_local2].nodeName] = _local5;
}
_local2++;
}
show_time = int(_global.obj_iads.t);
check_type();
}
function time_delay() {
tim = 0;
int1 = setInterval(timespam, 1000);
}
function timespam() {
tim++;
trace(((tim + " tim Tim") + " show_time") + show_time);
if (tim == show_time) {
clearInterval(int1);
_parent.play();
}
}
function create_assets(mc, _type) {
trace((("Create _ assets " + mc) + " ") + _type);
mc.createEmptyMovieClip("trgt_main", 4);
mcLoader = new MovieClipLoader();
mcLoader.addListener(mc);
if (_type != "FULL") {
mc.createEmptyMovieClip("square_mc", 5);
var _local4 = trgt_main.createEmptyMovieClip("trgt_ads", getNextHighestDepth());
var _local2 = new TextFormat();
_local2.align = "center";
_local2.font = "Verdana";
_local2.size = 10;
mc.createTextField("h_txt", mc.getNextHighestDepth(), 0, 0, 100, 22);
mc.createTextField("b_txt", mc.getNextHighestDepth(), 0, 0, 100, 22);
b_txt.autoSize = true;
b_txt.selectable = false;
h_txt.selectable = false;
b_txt.multiline = true;
b_txt.setNewTextFormat(_local2);
h_txt.autoSize = true;
h_txt.setNewTextFormat(_local2);
h_txt.text = "";
mc.createEmptyMovieClip("progressBar", 500);
}
}
function onLoadInit(mc) {
ad_width = int(_global.obj_iads.x);
ad_height = int(_global.obj_iads.y);
h_txt.text = "Advertisement";
progressBar.tim = show_time;
progressBar.width = _global.obj_iads.x;
progressBar.height = 15;
progressBar.start = function () {
maxw = this.width - 2;
this.ad = maxw / (this.tim + 1);
this.ad = this.ad / game_fps;
};
progressBar.onEnterFrame = function () {
if (this.bar._width < (this.width - 2)) {
this.bar._width = this.bar._width + this.ad;
} else {
this.bar._width = this.width;
}
};
progressBar._x = 100;
progressBar._y = 100;
bar_mc = progressBar.createEmptyMovieClip("bar", 1);
box_mc = progressBar.createEmptyMovieClip("box", 2);
bar_mc.beginFill(26112);
bar_mc.moveTo(0, 0);
bar_mc.lineTo(1, 0);
bar_mc.lineTo(1, progressBar.height - 2);
bar_mc.lineTo(0, progressBar.height - 2);
bar_mc.lineTo(0, 0);
bar_mc.endFill();
bar_mc._x = 1.5;
bar_mc._y = 1.5;
box_mc.lineStyle(1, 3355443, 100, true, "none", "round", "miter", 1);
box_mc.lineTo(progressBar.width, 0);
box_mc.lineTo(progressBar.width, progressBar.height);
box_mc.lineTo(0, progressBar.height);
box_mc.lineTo(0, 0);
box_mc._x = 0;
box_mc._y = 0;
progressBar.start();
b_txt.text = "Note\rClicking on the above Ad won't interrupt your game.\rAd link opens in a new window.\rThanks to our sponsors, we provide you free games to play.";
x = (Stage.width / 2) - (ad_width / 2);
y = (Stage.height / 2) - (ad_height / 2);
mc._x = x;
mc._y = y;
h_txt._x = (x + (ad_width / 2)) - (h_txt._width / 2);
h_txt._y = y - 20;
progressBar._x = (x + (ad_width / 2)) - (progressBar._width / 2);
progressBar._y = (y + 5) + ad_height;
b_txt._x = (x + (ad_width / 2)) - (b_txt._width / 2);
b_txt._y = progressBar._y + 20;
square_mc.beginFill(16711680);
square_mc.moveTo(0, 0);
square_mc.lineTo(ad_width, 0);
square_mc.lineTo(ad_width, ad_height);
square_mc.lineTo(0, ad_height);
square_mc.lineTo(0, 0);
square_mc.endFill();
square_mc._x = x;
square_mc._y = y;
trgt_main.setMask(square_mc);
}
function check_type() {
if (_global.obj_iads.type eq "UPDATE") {
this.createEmptyMovieClip("holder", 100);
var _local4 = _global.obj_iads.url;
_root.obj_iads = _global.obj_iads.payload;
holder.loadMovie(_global.obj_iads.url);
holder.obj_iads = _root.obj_iads;
show_time = 20;
} else {
brain();
}
time_delay();
}
function init_call() {
lv_init = new XML();
rv_init = new XML();
rv_init.ignoreWhite = true;
loadurl = (((((("http://ads.inviziads.com/init.html/g=" + _parent.obj_game._gid) + "&h=g2w&hURL=") + this._url) + "&ts=") + getTimer()) + "&pUrl=") + domain_name;
trace("loadurl " + loadurl);
lv_init.sendAndLoad(loadurl, rv_init, "GET");
rv_init.onLoad = function (success) {
trace("success " + success);
if (success) {
trace("rv_init " + rv_init.childNodes[0].nodeValue);
_parent.initdata = parse_xml(rv_init);
trace("initdata.token " + _parent.initdata.token);
create_js();
startdelay();
} else {
_parent.play();
}
};
}
function parse_xml(mydata) {
var _local4 = new Array();
var _local1 = 0;
while (_local1 < mydata.firstChild.childNodes.length) {
if (mydata.firstChild.childNodes[_local1].firstChild.nodeValue != null) {
_local4[mydata.firstChild.childNodes[_local1].nodeName] = mydata.firstChild.childNodes[_local1].firstChild.nodeValue;
} else if (mydata.firstChild.childNodes[_local1].firstChild.firstChild.nodeValue != null) {
var _local5 = new Object();
var _local2 = 0;
while (_local2 < lv_result.firstChild.childNodes[_local1].childNodes.length) {
_local4[lv_result.firstChild.childNodes[_local1].childNodes[_local2].nodeName] = mydata.firstChild.childNodes[_local1].childNodes[_local2].firstChild.nodeValue;
_local2++;
}
_local4[lv_result.firstChild.childNodes[_local1].nodeName] = _local5;
}
_local1++;
}
return(_local4);
}
function runJS(script) {
getURL (("javascript:" + script) + "");
}
function create_js() {
in_js = ((((_parent.initdata.token + "&g=") + _parent.obj_game._gid) + "&h=g2w&ts=") + getTimer()) + ";";
trace("_parent.initdata.token " + _parent.initdata.token);
var _local2 = "function sendRequest(){";
_local2 = _local2 + ("var remote_url = 'http://ads.inviziads.com/pg.html?pageurl=' + document.URL&t=" + in_js);
_local2 = _local2 + "var oHead = document.getElementsByTagName('head').item(0);";
_local2 = _local2 + "var oScript = document.createElement('script');";
_local2 = _local2 + "oScript.setAttribute('src', remote_url);";
_local2 = _local2 + "oHead.appendChild(oScript);}";
_local2 = _local2 + "sendRequest();";
}
function delay() {
trace("DElay CALLED");
get_iads();
runJS(js_new);
clearInterval(intervalID);
}
function startdelay() {
intervalID = setInterval(delay, 2000);
}
System.security.allowDomain("*");
lc_mydomain = new LocalConnection();
domain_name = lc_mydomain.domain();
trace("domain_name " + domain_name);
Object.prototype.getFps = function () {
if (signal == true) {
time = getTimer();
} else {
tempo = int(1000 / (getTimer() - time));
}
signal = !signal;
return(tempo);
};
this.onEnterFrame = function () {
game_fps = getFps();
if ((game_fps ne 0) and (game_fps ne undefined)) {
this.onEnterFrame = null;
}
};
myself = this;
trace(_root.obj_game.inviziads);
_root.adurl = _root.obj_game.inviziads;
init_call();
stop();
Symbol 249 MovieClip Frame 120
stop();
_root.gotoAndStop("lblloader");
Symbol 513 MovieClip Frame 135
stop();
btn_story.onRelease = function () {
gotoAndPlay ("story");
};
btn_instructions.onRelease = function () {
gotoAndPlay ("instructions");
};
btn_start.onRelease = function () {
_parent.gotoAndStop("lblgame");
};
Symbol 513 MovieClip Frame 139
stop();
btn_back.onRelease = function () {
gotoAndStop ("menu");
};
btn_start.onRelease = function () {
_parent.gotoAndStop("lblgame");
};
Symbol 513 MovieClip Frame 143
stop();
btn_back.onRelease = function () {
gotoAndStop ("menu");
};
btn_start.onRelease = function () {
_parent.gotoAndStop("lblgame");
};
Symbol 610 MovieClip Frame 110
_parent._parent.talk("talk");
Symbol 654 MovieClip Frame 85
_parent._parent.talk("talk");
Symbol 655 MovieClip Frame 14
var i = 1;
while (i <= 4) {
this["food_" + i].gotoAndStop(foodArray[i - 1]);
i++;
}
trace("get food :" + foodArray);
Symbol 655 MovieClip Frame 26
stop();
Symbol 695 MovieClip Frame 135
_parent._parent.talk("talk");
Symbol 707 MovieClip Frame 105
_parent._parent.talk("talk");
Symbol 708 MovieClip Frame 14
var i = 1;
while (i <= 4) {
this["food_" + i].gotoAndStop(foodArray[i - 1]);
i++;
}
trace("get food :" + foodArray);
stop();
Symbol 708 MovieClip Frame 26
stop();
Symbol 761 MovieClip Frame 70
_parent._parent.talk("talk");
Symbol 766 MovieClip Frame 70
stop();
Symbol 793 MovieClip Frame 122
_parent._parent.talk("talk");
Symbol 793 MovieClip Frame 189
_parent._parent.talk("talk");
Symbol 799 MovieClip Frame 70
stop();
Symbol 800 MovieClip Frame 2
Symbol 800 MovieClip Frame 7
trace("************************");
Symbol 800 MovieClip Frame 14
var i = 1;
while (i <= 4) {
this["food_" + i].gotoAndStop(foodArray[i - 1]);
i++;
}
trace("get food :" + foodArray);
Symbol 800 MovieClip Frame 26
stop();
Symbol 800 MovieClip Frame 47
Symbol 800 MovieClip Frame 64
Symbol 800 MovieClip Frame 74
Symbol 805 MovieClip Frame 1
function slide(_str) {
vx = 2;
str = _str;
((str == "L") ? (-slideSpeed) : (slideSpeed));
onEnterFrame = function () {
if (fallBoolean) {
_totalNum = 1;
}
if (_totalNum > 1) {
if (str == "L") {
vx = 2;
} else if (str == "R") {
vx = -2;
}
if (_this["food" + _totalNum]._x < startX) {
str = "L";
} else {
str = "R";
}
var _local2 = 2;
while (_local2 <= 10) {
if ((_this["food" + _local2]._currentframe != 1) && (_this["food" + _local2])) {
if (_local2 != 1) {
_this["food" + _local2]._x = _this["food" + _local2]._x + ((vx * this["food" + _local2]._y) / 100);
} else {
_this["food" + _local2]._x = _this["food" + _local2]._x - (vx * 0.05);
}
_this["food" + _local2]._rotation = this["food" + _local2]._x - startX;
}
_local2++;
}
} else if ((_totalNum == 1) && (_this["food" + _totalNum]._currentframe != 1)) {
hitMC._y = 5;
}
if (this.food1._currentframe == 1) {
hitMC._y = 30;
}
if ((Math.abs(_this["food" + _totalNum]._x - startX) > maxStep) && (!fallBoolean)) {
fallBoolean = true;
trace("down");
fall();
init();
}
};
}
function init() {
fallBoolean = false;
times = 0;
var _local2 = 1;
while (_local2 <= 10) {
this["food" + _local2].gotoAndStop(1);
this["food" + _local2]._x = startX;
removeMovieClip(this["food" + _local2]);
this["food" + _local2].removeMovieClip();
_local2++;
}
_local2 = 1;
while (_local2 <= 10) {
this["food" + _local2].times = 0;
_local2++;
}
_totalNum = 1;
hitMC._y = 30;
this.food1.times = 0;
}
function addFood(tempNum) {
_totalNum++;
var _local3 = 1;
while (_local3 < 10) {
if ((this["food" + _local3]._currentframe == 1) || (!this["food" + _local3])) {
_totalNum = _local3;
trace("*******************************---------------------*********************************" + this["food" + _local3]);
break;
}
_local3++;
}
((_totalNum >= 3) ? ((_parent._parent.full = true)) : null);
hitMC._y = (-(_totalNum - 1)) * 15;
trace(">>>>>" + _totalNum);
var _local4 = this.food1.duplicateMovieClip("food" + _totalNum, _totalNum);
trace("*******************************---------------------*********************************" + this["food" + _totalNum]);
_local4._x = startX;
_local4.times = 0;
_local4._y = startY - ((_totalNum - 1) * stepY);
_local4.gotoAndStop((tempNum ? (tempNum) : 1));
}
function fall() {
var _local3 = 1;
while (_local3 <= 10) {
trace("\u575A\u6301\u65F6\u95F4\u4E3A \uFF1A" + this["food" + _local3].times);
this["food" + _local3].clearClock();
_local3++;
}
_parent._parent._parent.fallFood(_totalNum, this);
_totalNum = 1;
}
stop();
var speed = 1;
var _this = this;
var slideSpeed = 2;
var maxStep = 30;
var _totalNum = 1;
var stepY = 15;
var startX = this.food1._x;
var startY = this.food1._y;
var str;
var fallBoolean = false;
Symbol 809 MovieClip Frame 1
function displayFood(_foodArray) {
dishMC._visible = false;
foodArray = _foodArray;
var _local1 = 1;
while (_local1 <= _foodArray.length) {
if (!sendWriter.dishMC["food" + _local1]) {
var _local2 = sendWriter.dishMC.food1.duplicateMovieClip("food" + _local1, _local1);
_local2._y = _local1 * -10;
}
sendWriter.dishMC["food" + _local1].gotoAndStop(foodArray[_local1 - 1]);
_local1++;
}
}
function back(id) {
ID = id;
dishMC._visible = true;
(tempLessFoodArray ? null : ((tempLessFoodArray = [0, 0, 0, 0])));
if (rightFoodArray) {
tempLessFoodArray = [];
for (var _local3 in rightFoodArray) {
tempLessFoodArray[_local3] = rightFoodArray[_local3];
}
}
var _local6 = displayPassFood(foodArray, rightFoodArray);
lessFoodArray = _local6;
trace("\u7F3A\u5C11\u7684\u98DF\u7269 \uFF1A" + lessFoodArray);
if (((tempLessFoodArray.length != rightFoodArray.length) || (tempLessFoodArray.length == 0)) || (rightFoodArray.length == 0)) {
var _local5 = tempLessFoodArray.length - rightFoodArray.length;
_parent.countScore(_local5);
ifgeted(foodArray);
_parent.countScore(-(foodArray.length - _local5));
trace("\u672A\u6D88\u9664 1 " + (foodArray.length - (tempLessFoodArray.length - rightFoodArray.length)));
wrongEffect(foodArray.length - (tempLessFoodArray.length - rightFoodArray.length));
} else {
ifgeted(foodArray);
_parent.countScore(-foodArray.length);
wrongEffect(foodArray.length);
trace("\u672A\u6D88\u9664 2 " + foodArray.length);
}
_parent.currentFoodArray = lessFoodArray;
if (!myTempArray.length) {
var _local3 = 1;
while (_local3 <= 4) {
if (this["customer" + id]["food_" + _local3].passFood._currentframe == 1) {
myTempArray.push(_local3);
}
_local3++;
}
}
__array = getMC(lessFoodArray, id);
var _local3 = 1;
while (_local3 <= 10) {
sendWriter.dishMC["food" + _local3].gotoAndStop(1);
if (this["food" + _local3]._currentframe == 1) {
this["food" + _local3].gotoAndStop(foodArray[_local3 - 1]);
}
_local3++;
}
_local3 = 1;
while (_local3 <= 4) {
if (this["customer" + id]["food_" + _local3].passFood._currentframe != 2) {
setColor(2, this["customer" + id]["food_" + _local3]);
this["customer" + id]["food_" + _local3].passFood.gotoAndStop(2);
}
_local3++;
}
_local3 = 0;
while (_local3 < __array.length) {
if (__array[_local3]._currentframe != 1) {
setColor(1, __array[_local3]._parent);
__array[_local3].gotoAndStop(1);
}
_local3++;
}
if (__array.length == 1) {
_parent.waiterMC.onlyOne = true;
_parent.waiterMC.full = true;
} else {
_parent.waiterMC.onlyOne = false;
_parent.waiterMC.full = false;
}
if ((myTempArray.length == __array.length) && (__array.length)) {
anger();
} else {
smile(id);
}
myTempArray = __array;
}
function wrongEffect(NUM) {
var _local2 = 0;
while (_local2 < NUM) {
var _local3 = this.attachMovie("wrong", "wrong", this.getNextHighestDepth());
_local3._x = this["customer" + ID]._x - 35;
_local3._y = (this["customer" + ID]._y + (_local2 * -50)) - 130;
_local2++;
}
}
function setColor(id, _mc) {
if (id == 2) {
var _local1 = [0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0.3086, 0.6094, 0.082, 0, 0, 0, 0, 0, 1, 0];
var _local2 = new flash.filters.ColorMatrixFilter(_local1);
_mc.filters = [_local2];
} else {
var _local1 = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0];
var _local2 = new flash.filters.ColorMatrixFilter(_local1);
_mc.filters = [_local2];
}
}
function getMC(array, id) {
var _local6 = new Array();
var _local3 = 1;
while (_local3 <= 4) {
var _local2 = 0;
while (_local2 < array.length) {
if (this["customer" + id]["food_" + _local3]._currentframe == array[_local2]) {
_local6.push(this["customer" + id]["food_" + _local3].passFood);
}
_local2++;
}
_local3++;
}
return(_local6);
}
function getPassFoodMC(id) {
var _local4 = new Array();
var _local2 = 1;
while (_local2 <= 4) {
if ((this["customer" + ID]["food_" + _local2]._currentframe == id) && (this["customer" + ID]["food_" + _local2].passFood._currentframe == 2)) {
return(false);
}
_local2++;
}
return(true);
}
function displayPassFood(current, right) {
var _local2 = right;
var _local3 = 0;
while (_local3 < current.length) {
var _local1 = 0;
while (_local1 < _local2.length) {
if (current[_local3] == _local2[_local1]) {
_local2.splice(_local1, 1);
}
_local1++;
}
_local3++;
}
return(_local2);
}
function init() {
gotoAndStop ("empty");
}
function anger(id) {
this["customer" + ID].gotoAndStop("anger");
var _local3 = 1;
while (_local3 <= 4) {
if (this["customer" + ID]["food_" + _local3].passFood._currentframe == 2) {
setColor(2, this["customer" + ID]["food_" + _local3]);
}
_local3++;
}
_parent.playSound("tableWrong");
}
function smile(id) {
this["customer" + ID].gotoAndStop("smile");
var _local2 = 1;
while (_local2 <= 4) {
if (this["customer" + ID]["food_" + _local2].passFood._currentframe == 2) {
setColor(2, this["customer" + ID]["food_" + _local2]);
}
_local2++;
}
}
function talk() {
this["customer" + ID].gotoAndStop("talk");
var _local2 = 1;
while (_local2 <= 4) {
if (this["customer" + ID]["food_" + _local2].passFood._currentframe == 2) {
setColor(2, this["customer" + ID]["food_" + _local2]);
}
_local2++;
}
}
function isFinish() {
var _local2 = 1;
while (_local2 <= 4) {
if (this["customer" + ID]["food_" + _local2].passFood._currentframe == 1) {
return(false);
}
_local2++;
}
return(true);
}
function ifgeted(_array) {
deleteDouble(_array);
for (var _local4 in _array) {
if (_array[_local4] == 1) {
_array.splice(_local4, 1);
}
}
var _local4 = 1;
while (_local4 <= 4) {
if (this["customer" + ID]["food_" + _local4].passFood._currentframe == 2) {
var _local2 = 0;
while (_local2 < _array.length) {
if (_array[_local2] == this["customer" + ID]["food_" + _local4]._currentframe) {
_array.splice(_local2, 1);
}
_local2++;
}
}
_local4++;
}
}
function deleteDouble(_a) {
var _local3 = 0;
while (_local3 < _a.length) {
var _local2 = 0;
while (_local2 < _a.length) {
if ((((_a[_local3] == _a[_local2]) && (_local3 != _local2)) || (_a[_local3] == 1)) && (_a.length != 1)) {
_a.splice(_local3, 1);
}
_local2++;
}
_local3++;
}
return(_a);
}
var foodArray;
var rightFoodArray;
var lessFoodArray;
var ID;
var getRightFoodArray = new Array();
this.customer1.gotoAndStop("sit");
this.customer2.gotoAndStop("sit");
this.customer3.gotoAndStop("sit");
myTempArray = [];
Symbol 809 MovieClip Frame 25
back(1);
Symbol 809 MovieClip Frame 39
stop();
_parent.sendFoodFinish(lessFoodArray);
Symbol 809 MovieClip Frame 72
back(2);
Symbol 809 MovieClip Frame 86
stop();
_parent.sendFoodFinish(lessFoodArray);
Symbol 809 MovieClip Frame 117
back(3);
Symbol 809 MovieClip Frame 130
stop();
_parent.sendFoodFinish(lessFoodArray);
Symbol 859 MovieClip Frame 1
dishMC.gotoAndStop(1);
Symbol 859 MovieClip Frame 6
gotoAndPlay (1);
Symbol 859 MovieClip Frame 7
dishMC.gotoAndStop(2);
trace("boon ");
Symbol 859 MovieClip Frame 16
gotoAndPlay ("stand2");
Symbol 859 MovieClip Frame 17
dishMC.gotoAndStop(1);
Symbol 859 MovieClip Frame 26
gotoAndPlay ("stand3");
Symbol 860 MovieClip Frame 1
function move(way) {
this.onEnterFrame = function () {
mc.play();
if (mouseControl && (_visible)) {
var _local3 = new Object();
_local3.x = this.centerMC._x;
_local3.y = this.centerMC._y;
centerMC.localToGlobal(_local3);
if ((this._x >= maxLeft) && (this._x <= maxRight)) {
if ((this._xmouse > center._x) && (Math.abs(this._xmouse - center._x) > 10)) {
if (Math.abs(this._x - maxLeft) > 10) {
moveToRight();
} else {
moveToRight();
}
} else if (Math.abs(this._xmouse - center._x) <= 10) {
stand();
} else {
moveToLeft();
}
} else {
stand();
if ((Math.abs(this._x - maxLeft) < 11) && (this._xmouse > center._x)) {
this._x = maxLeft;
} else if ((Math.abs(this._x - maxRight) < 11) && (this._xmouse < center._x)) {
this._x = maxRight;
} else if ((Math.abs(this._x - maxRight) < 11) && (this._xmouse > center._x)) {
if (full || (onlyOne)) {
if (((((mc.dishMC.food2._currentframe && (mc.dishMC.food1._currentframe)) && (mc.dishMC.food2._currentframe != 1)) && (mc.dishMC.food1._currentframe != 1)) || (((mc.dishMC1.food2._currentframe && mc.dishMC1.food1._currentframe) && (mc.dishMC1.food2._currentframe != 1)) && (mc.dishMC1.food1._currentframe != 1))) && (!sending)) {
sending = true;
full = false;
_parent.sendFood(getDishFood());
}
}
}
}
}
};
}
function stand() {
if (_global.LEVEL == 1) {
mc.gotoAndStop("stand3");
} else {
if (mc._currentframe >= 7) {
if (mc._currentframe >= 17) {
(mc.gotoAndStop("stand3"));// not popped
} else {
(mc.gotoAndStop("stand2"));// not popped
}
} else {
(mc.gotoAndStop(1));// not popped
}
}
}
function moveToLeft() {
this._x = this._x - speed;
((mc._currentframe >= 17) ? (mc.dishMC1.slide("R")) : null);
mc.dishMC.slide("R");
}
function moveToRight() {
this._x = this._x + speed;
mc.dishMC.slide("L");
((mc._currentframe >= 17) ? (mc.dishMC1.slide("L")) : null);
}
function displayFood(_mc, id) {
var _local4 = 1;
isGetRightFood(id);
if (_mc.food1._currentframe == 1) {
__right = 1;
_mc.food1.gotoAndStop(id);
_local4 = 1;
full = false;
haveFoodArray[0] = id;
} else {
_mc.addFood(id);
haveFoodArray.push(id);
(_mc.food3 ? ((full = true)) : null);
}
if (__right >= 4) {
_parent.addToScore(id, 200);
}
}
function getDishFood() {
var _local2 = new Array();
var _local1 = 1;
while (_local1 <= 10) {
if (mc.dishMC["food" + _local1]) {
_local2.push(mc.dishMC["food" + _local1]._currentframe);
}
if (mc.dishMC1["food" + _local1]) {
_local2.push(mc.dishMC1["food" + _local1]._currentframe);
}
_local1++;
}
return(_local2);
}
function isGetRightFood(id) {
var _local7 = false;
var _local8 = false;
var _local6 = 0;
while (_local6 < rightFoodArray.length) {
if ((id == rightFoodArray[_local6]) || (id == (_global.totalLevelNum + 1))) {
_local8 = true;
var _local5 = true;
var _local4 = 1;
while (_local4 <= 3) {
if (((id == mc.dishMC["food" + _local4]._currentframe) || (id == mc.dishMC1["food" + _local4]._currentframe)) || (!_parent.tableHaveFood(id))) {
_local5 = false;
}
_local4++;
}
((id == _global.totalLevelNum) ? (_local5 = true) : null);
if (_local5) {
__right++;
_parent.getRightFood(id);
_local7 = true;
break;
}
if (id == (_global.totalLevelNum + 1)) {
__right++;
_parent.getRightFood(id, 200);
_local7 = true;
break;
}
}
_local6++;
}
if (!_local7) {
__right = 1;
}
}
function init() {
var _local2 = 1;
while (_local2 <= 10) {
mc.dishMC["food" + _local2].gotoAndStop(1);
mc.dishMC1["food" + _local2].gotoAndStop(1);
mc.dishMC1["food" + _local2].removeMovieClip();
mc.dishMC["food" + _local2].removeMovieClip();
_local2++;
}
full = false;
sending = false;
speed = _global.SPEEDWAITER[0];
mouseControl = true;
if (mc._currentframe >= 7) {
if (mc._currentframe >= 17) {
(mc.gotoAndStop("stand3"));// not popped
} else {
(mc.gotoAndStop("stand2"));// not popped
}
} else {
(mc.gotoAndStop(1));// not popped
}
if (_global.LEVEL == 1) {
mc.gotoAndStop("stand3");
}
_visible = true;
mc.dishMC.init();
move();
}
function fallInit() {
var _local1 = 1;
while (_local1 <= 10) {
mc.dishMC["food" + _local1].gotoAndStop(1);
_local1++;
}
full = false;
__right = 1;
}
function stopControl() {
mouseControl = false;
}
function getBonus(id) {
if (mc._currentframe >= 7) {
} else {
(mc.gotoAndStop("stand2"));// not popped
}
}
function updataSpeed(id) {
speed = _global.SPEEDWAITER[id];
}
function waiterLevel2() {
mc.gotoAndPlay("stand3");
}
function waiterLevel1() {
mc.gotoAndPlay(1);
}
var speed = _global.SPEEDWAITER[0];
var maxLeft = -271;
var maxRight = 65;
var full = false;
var mouseControl = (mouseControl ? true : false);
var rightFoodArray;
var haveFoodArray = [];
this.createEmptyMovieClip("center", 1);
var sending = false;
stop();
stand();
Symbol 864 MovieClip Frame 1
function fall() {
this.onEnterFrame = function () {
if (Math.abs(this._xscale - 100) > 2) {
this._xscale = this._xscale + ((100 - this._xscale) * 0.3);
this._yscale = this._yscale + ((100 - this._yscale) * 0.3);
} else {
this._xscale = 100;
this._yscale = 100;
}
if (falling && (this._xscale == 100)) {
if (isGarbage) {
vy = vy + g;
this._y = this._y + vy;
this._rotation = this._rotation + (8 / vy);
} else {
this._y = this._y + speed;
}
if (this._y >= maxY) {
addGarbage(this.foodMC._currentframe);
if (isGarbage) {
delete this.onEnterFrame;
this.foodMC.gotoAndStop(1);
this._x = 0;
this._y = 0;
_parent.playSound("fallSound");
} else {
init();
}
} else if (!isGarbage) {
if (this.foodMC.hitArea.hitTest(_parent.waiterMC.mc.dishMC1.hitMC) && (_parent.waiterMC._visible)) {
if (this.foodMC._currentframe == (_global.totalLevelNum + 1)) {
_parent.getBonus();
} else if (this.foodMC._currentframe == _global.totalLevelNum) {
_parent.getSlow();
} else {
_parent.waiterMC.displayFood(_parent.waiterMC.mc.dishMC1.hitMC._parent, this.foodMC._currentframe);
}
init();
} else if (this.foodMC.hitArea.hitTest(_parent.waiterMC.mc.dishMC.hitMC) && (_parent.waiterMC._visible)) {
if (!isGarbage) {
if (this.foodMC._currentframe == (_global.totalLevelNum + 1)) {
_parent.getBonus();
} else if (this.foodMC._currentframe == _global.totalLevelNum) {
_parent.getSlow();
} else {
trace("|||||||||||||||||||" + _parent.waiterMC._visible);
_parent.waiterMC.displayFood(_parent.waiterMC.mc.dishMC.hitMC._parent, this.foodMC._currentframe);
}
init();
}
}
}
}
};
}
function addGarbage(id) {
var _local3 = _parent.garbageMC.attachMovie("garbage", "garbage" + _parent.garbageMC.getNextHighestDepth(), _parent.garbageMC.getNextHighestDepth());
_local3._x = (this._x + Math.abs(_parent.food1._x)) - 8;
_local3._y = 5;
if (displayWrong) {
var _local4 = _parent.garbageMC.attachMovie("wrong", "wrong", _parent.garbageMC.getNextHighestDepth() + random(100));
_local4._x = _local3._x;
_local4._y = _local3._y - 30;
}
_local3.gotoAndStop(id);
}
function init() {
displayWrong = false;
this._xscale = 0;
this._yscale = 0;
falling = true;
this.foodMC.gotoAndStop(1);
this._y = startY;
var _local5 = _parent.getRandomFood();
var _local6 = false;
var _local4 = 0;
while (_local4 < _parent.currentFoodArray.length) {
if (_local5 != _parent.currentFoodArray[_local4]) {
if (random(100) > 85) {
_local6 = true;
}
}
_local4++;
}
if (_local6) {
_local5 = _parent.currentFoodArray[random(_parent.currentFoodArray.length)];
}
speed = random(3) + _global.SPEEDFOOD[_global.SUBLEVEL - 1];
this.foodMC.gotoAndStop(_local5);
this.foodMC.bonusMC.gotoAndStop(1);
}
function stopFall() {
falling = false;
delete this.onEnterFrame;
}
function slide() {
foodMC.onEnterFrame = function () {
speed = speed + _global.mainWay;
var _local2 = ((_global.mainWay > 0) ? ((-_y) / 100) : (_y / 100));
_x = (_x + (_global.mainWay + _local2));
};
}
stop();
var isGarbage = false;
var dish = _parent.waiterMC.mc.dishMC.hitMC;
var dish1 = _parent.waiterMC.mc.dishMC1.hitMC;
var startY = this._y;
var maxY = _parent.garbageMC._y;
var falling = true;
var g = 0.28;
var vy = 0;
var f = 0.9;
displayWrong = false;
this.foodMC.bonusMC.gotoAndStop(1);
Symbol 868 MovieClip Frame 1
stop();
Symbol 886 MovieClip Frame 1
stop();
but.useHandCursor = false;
this.onEnterFrame = function () {
if (Key.isDown(32)) {
this._visible = false;
}
};
Symbol 901 MovieClip Frame 1
function init(mainID, subID) {
trace((("********level_" + mainID) + "_") + subID);
gotoAndStop("level_" + subID);
_visible = true;
}
function close() {
_visible = false;
}
stop();
bg.onRelease = function () {
};
bg.enabled = false;
gotoAndStop("level_" + _global.SUBLEVEL);
Symbol 908 MovieClip Frame 1
function Clear() {
trace("clear........");
delete onEnterFrame;
onEnterFrame = function () {
if (_pauseClear) {
this._x = this._x + speed;
loadStar();
if (this._x >= maxRight) {
speed = speed * -1;
}
if (this._x < maxLeft) {
this._x = maxLeft;
speed = speed * -1;
delete this.onEnterFrame;
}
for (var _local3 in _parent.garbageMC) {
if (typeof(_parent.garbageMC[_local3] == "moviclip")) {
if (this.hitArea.hitTest(_parent.garbageMC[_local3])) {
_parent.garbageMC[_local3].removeMovieClip();
}
}
}
}
};
}
function getMC() {
var _local2 = false;
for (var _local3 in _parent.garbageMC) {
if (typeof(_parent.garbageMC[_local3] == "moviclip")) {
_local2 = true;
}
}
return(_local2);
}
function loadStar() {
var _local3 = _parent.attachMovie("star", "star", order);
_local3._x = (this._x + random(50)) + 25;
_local3._y = (this._y + random(50)) + 25;
order++;
if (order > 5500) {
order = 5000;
}
}
function isHaveBag() {
}
function pauseClear() {
this._x = maxLeft + 5;
_pauseClear = false;
}
function startClear() {
order = 5000;
_pauseClear = true;
}
function clearTime() {
clearInterval(myTime);
delete onEnterFrame;
}
stop();
var clearTime = 10000;
var speed = 15;
var maxRight = 80;
var maxLeft = this._x;
var _pauseClear = true;
var order = 5000;
if (!myTime) {
myTime = setInterval(Clear, clearTime);
}
Symbol 921 MovieClip Frame 1
stop();
Symbol 922 MovieClip Frame 1
function init(time) {
trace("time " + time);
callHalf = false;
startTime = time * 1000;
halfTime = startTime / 2;
clearInterval(myTime);
myTime = setInterval(start, 100);
}
function start() {
var _local4 = Math.floor(startTime / 60000);
var _local2 = Math.floor((startTime % 60000) / 1000);
var _local3 = Math.floor((((startTime % 60000) / 1000) - _local2) * 10);
if ((startTime <= halfTime) && (!callHalf)) {
callHalf = true;
_parent.halfTime();
}
if (((_local4 <= 0) && (_local2 <= 0)) && (_local3 <= 0)) {
_local4 = 0;
_local2 = 0;
_local3 = 0;
trace((((_local4 + ">>") + _local2) + ">>>") + _local3);
_parent.nextLevel(true);
clearInterval(myTime);
}
display(format(_local4), format(_local2), _local3);
startTime = startTime - 100;
}
function format(num) {
return(((num < 10) ? ("0" + num) : (num)));
}
function clearTime() {
clearInterval(myTime);
}
function display(_m, _s, _ms) {
var _local1 = String(_m).split("");
var _local2 = String(_s).split("");
m_mc_1.gotoAndStop(Number(_local1[0]) + 1);
m_mc_2.gotoAndStop(Number(_local1[1]) + 1);
s_mc_1.gotoAndStop(Number(_local2[0]) + 1);
s_mc_2.gotoAndStop(Number(_local2[1]) + 1);
ms_mc_1.gotoAndStop(Number(_ms) + 1);
}
var startTime;
var myTime;
var halfTime;
Symbol 937 MovieClip Frame 1
_root._trackClickThru(this);
Symbol 962 MovieClip Frame 1
stop();
gotoAndStop(_root.obj_game._gstatus);
Symbol 968 Button
on (release) {
tryAgain();
}
Symbol 993 MovieClip Frame 1
TXT.text = "";
Symbol 993 MovieClip Frame 2
function tryAgain() {
gotoAndStop ("login_screen");
}
function filltopscore(destmc) {
trace(_root.lst_top_scorer.top_score.status.data);
if ((_root.lst_top_scorer.top_score.status.data == 0) or (_root.lst_top_scorer.top_score.user[0].score.data == 0)) {
_top10_lbl._visible = false;
var _local2 = 0;
while (_local2 < 10) {
destmc["row" + _local2]._visible = false;
_local2++;
}
} else {
_noscore_mc._visible = false;
var _local2 = 0;
while (_local2 < 10) {
if ((_root.lst_top_scorer.top_score.user[_local2] == undefined) or (_root.lst_top_scorer.top_score.user[_local2].score.data == 0)) {
destmc["row" + _local2].txtrollno.text = "";
destmc["row" + _local2].txtusername.text = "";
destmc["row" + _local2].txtscore.text = "";
} else {
destmc["row" + _local2].txtrollno.text = _local2 + 1;
destmc["row" + _local2].txtusername.text = _root.lst_top_scorer.top_score.user[_local2].nick_name.data;
destmc["row" + _local2].txtscore.text = _root.lst_top_scorer.top_score.user[_local2].score.data;
}
_local2++;
}
}
}
stop();
playAgain_btn.onRelease = function () {
trace("Login");
_root.g2w_playagain();
};
username_txt.onSetFocus = function () {
trace((this.text + " ") + _root.obj_partner.invalid_txt);
if ((this.text == _root.obj_partner.invalid_txt) or (this.text == "Connecting Error!")) {
this.text = "";
}
};
Selection.setFocus("username_txt");
btn_scoresubmit.onRelease = function () {
_root.scoreSubmit(this._parent);
};
_trg_loc = this;
var keyListener = new Object();
keyListener.onKeyDown = function () {
if (!(Key.getCode() === 13)) {
} else {
Selection.setFocus("btn_scoresubmit");
_root.scoreSubmit(_trg_loc);
}
};
Key.addListener(keyListener);
btn_create_nickname.onRelease = function () {
getURL (_root.obj_partner.url_register, "_blank");
};
if (_root.obj_partner.show_submit) {
btn_scoresubmit._visible = false;
}
stop();
_btn_g2w.useHandCursor = false;
Symbol 993 MovieClip Frame 31
stop();
Symbol 993 MovieClip Frame 45
stop();
Symbol 993 MovieClip Frame 60
stop();
Symbol 993 MovieClip Frame 74
stop();
filltopscore(this);
playAgain_btn.onRelease = function () {
_root._playAgain(_root, "lblgameintro");
};
Symbol 1007 MovieClip Frame 1
stop();
trace("gameoverBoolean=" + _parent._parent.gameoverBoolean);
if (_parent._parent.gameoverBoolean) {
gotoAndStop (2);
}
Instance of Symbol 995 MovieClip "bgBtn" in Symbol 1008 MovieClip Frame 1
onClipEvent (load) {
this.onRelease = function () {
};
this.enabled = false;
}
Symbol 1009 MovieClip Frame 1
function ceaterRandom(totalNum, selNum) {
var _local5 = [];
var _local1 = [];
var _local3 = 0;
while (_local3 < totalNum.length) {
_local1.push(totalNum[_local3]);
_local3++;
}
_local3 = 1;
while (_local3 <= selNum) {
var _local2 = Math.floor(Math.random() * _local1.length);
_local5.push(_local1[_local2]);
_local1.splice(_local2, 1);
_local3++;
}
return(_local5);
}
function createOrderDishesArray() {
var _local2 = new Array();
var _local1 = 0;
while (_local1 < totalLevelNum) {
_local2.push(random(3) + 1);
while (_local2[_local1] == _local2[_local1 - 1]) {
_local2[_local1] = random(3) + 1;
}
_local1++;
}
trace(_local2);
return(_local2);
}
function getRandomFood() {
var _local2 = _global.LEVELFOODARRAY[_global.LEVEL][random(_global.LEVELFOODARRAY[_global.LEVEL].length)];
if (_local2 == (_global.totalLevelNum + 1)) {
if (random(100) < 90) {
_local2 = _global.LEVELFOODARRAY[_global.LEVEL][random(_global.LEVELFOODARRAY[_global.LEVEL].length)];
} else {
trace("\u5956\u52B1");
}
} else if (_global.LEVEL == 1) {
if (_local2 == _global.LEVELFOODARRAY[_global.LEVEL][_global.LEVELFOODARRAY[_global.LEVEL].length - 2]) {
if (random(100) < 90) {
_local2 = _global.LEVELFOODARRAY[_global.LEVEL][random(_global.LEVELFOODARRAY[_global.LEVEL].length)];
}
}
}
return(_local2);
}
function formatNum(num) {
var _local1 = num;
trace(num);
if (num < 10) {
return("0000" + _local1);
}
if (num < 100) {
return("000" + _local1);
}
if (num < 1000) {
return("00" + _local1);
}
if (num < 10000) {
return("0" + _local1);
}
return(_local1);
}
function playSound(id) {
mySound.stop();
mySound = new Sound(this);
mySound.attachSound(id);
mySound.start();
}
stop();
stop();
function init() {
waiterMC._visible = true;
mopMC.startClear();
initTable();
orderDishesArray = createOrderDishesArray();
tableMC.gotoAndStop(1);
levelMC.startBtn.onRelease = function () {
initTable();
this._parent.close();
startGame();
};
}
function initTable() {
mopMC.pauseClear();
successStar_1.gotoAndStop(1);
successStar_2.gotoAndStop(1);
successStar_3.gotoAndStop(1);
successStar_1._visible = false;
successStar_2._visible = false;
successStar_3._visible = false;
nextLevelMC._visible = false;
waiterMC.stand();
}
function startGame() {
waiterMC.init();
hurryMC.gotoAndStop(1);
scoretxt.text = "00000";
ClockMC.init(_global.LEVELTIME[_global.SUBLEVEL - 1]);
trace("time :" + _global.LEVELTIME[_global.SUBLEVEL]);
aaa.text = _global.SUBLEVEL;
startClock = true;
mopMC.startClear();
orderDishes(orderDishesArray[currentOrder]);
var _local3 = 1;
while (_local3 <= 4) {
this["food" + _local3].init();
_local3++;
}
}
function orderDishes(id) {
tableMC.customer1.gotoAndStop("sit");
tableMC.customer2.gotoAndStop("sit");
tableMC.customer3.gotoAndStop("sit");
currentFoodArray = ceaterRandom(_global.LEVELFOODARRAY[_global.LEVEL].slice(0, _global.LEVELFOODARRAY[_global.LEVEL].length - 2), 4);
scoreTempArray = currentFoodArray;
for (var _local3 in currentFoodArray) {
tempCurrentArray.push(currentFoodArray[_local3]);
}
this.tableMC["customer" + id].foodArray = currentFoodArray;
waiterMC.rightFoodArray = scoreTempArray;
tableMC["customer" + id].gotoAndPlay("ask");
initFallFood(currentFoodArray);
}
function initFallFood(array) {
var i = 1;
var tempNum = 0;
var stepNum = 3;
onEnterFrame = function () {
tempNum++;
if (tempNum == stepNum) {
tempNum = 0;
if (i <= array.length) {
var tempNum = getRandomFood();
this["food" + i].foodMC.gotoAndStop(tempNum);
this["food" + i].fall();
i++;
} else {
delete this.onEnterFrame;
}
}
};
}
function addToScore(id, num) {
num = (num ? (num) : (stepScore));
scoreNum = scoreNum + num;
if (num >= 200) {
if (mainLevel._currentframe == 1) {
var _local4 = this.attachMovie("right", "rightMC", this.getNextHighestDepth());
_local4._x = waiterMC._x - 30;
_local4._y = waiterMC._y - 50;
_local4 = this.attachMovie("right", "rightMC", this.getNextHighestDepth());
_local4._x = waiterMC._x - 80;
_local4._y = waiterMC._y - 130;
_local4 = this.attachMovie("right", "rightMC", this.getNextHighestDepth());
_local4._x = waiterMC._x - 70;
_local4._y = waiterMC._y - 150;
_local4 = this.attachMovie("greatgoing", "greatgoing", this.getNextHighestDepth());
_local4._x = waiterMC._x;
_local4._y = waiterMC._y - 80;
}
}
if (num > 0) {
scoreEffectMC.gotoAndPlay(1);
}
scoreNum = ((scoreNum <= 0) ? 0 : (scoreNum));
scoreTxt.text = scoreNum;
scoretxt.text = formatNum(scoreNum - Number((everyRoundScoreArray[everyRoundScoreArray.length - 1] ? (everyRoundScoreArray[everyRoundScoreArray.length - 1]) : 0)));
_root.score = scoreNum;
_root.partner_score = scoreNum;
}
function countScore(num) {
if (num > 0) {
var _local1 = 0;
while (_local1 < num) {
addToScore(id, 100);
_local1++;
}
} else {
var _local1 = num;
while (_local1 < 0) {
addToScore(id, -50);
_local1++;
}
}
}
function getSlow() {
var _local2 = this.attachMovie("slow", "slow", this.getNextHighestDepth());
_local2._x = waiterMC._x - 20;
_local2._y = waiterMC._y - 100;
waiterMC.updataSpeed(1);
trace("get slow ");
}
function tableHaveFood(id) {
return(tableMC.getPassFoodMC(id));
}
function fallFood(_num, __mc) {
__mc.totalNum = 1;
if (!waiterMC.sending) {
var _local2 = 1;
while (_local2 <= _num) {
if (__mc["food" + _local2]) {
var _local4 = String("obj" + _local2);
_local4 = new Object();
_local4.x = __mc["food" + _local2]._x;
_local4.y = __mc["food" + _local2]._y;
__mc["food" + _local2].localToGlobal(_local4);
var _local3 = this[(("garbage" + _local2) + "_") + __mc._name];
_local3.foodMC.gotoAndStop(__mc["food" + _local2]._currentframe);
_local3._rotation = __mc["food" + _local2]._rotation;
_local3._x = _local4.x - this._x;
_local3._y = _local4.y - this._y;
_local3.displayWrong = true;
_local3.isGarbage = true;
_local3.fall();
addToScore(id, -50);
}
_local2++;
}
}
waiterMC.fallInit();
}
function getBonus() {
trace("getbonus...............");
var _local2 = this.attachMovie("Bonus", "Bonus", this.getNextHighestDepth());
_local2._x = waiterMC._x - 50;
_local2._y = waiterMC._y - 100;
addToScore(id, 300);
waiterMC.getBonus(id);
}
function getRightFood(id) {
playSound("rightSound");
var _local2 = this.attachMovie("right", "rightMC", this.getNextHighestDepth() + random(100));
_local2._x = waiterMC._x - 30;
_local2._y = waiterMC._y - 100;
tableMC.getRightFoodArray.push(id);
addToScore(0, 100);
}
function getWrongFood() {
playSound("wrongSound");
var _local2 = this.attachMovie("wrong", "wrongMC", this.getNextHighestDepth() + random(100));
_local2._x = waiterMC._x - 30;
_local2._y = waiterMC._y - 100;
addToScore(0, -50);
}
function halfTime() {
hurryMC.gotoAndPlay(2);
}
function sendFood(_sendArray) {
waiterMC.sending = true;
waiterMC._visible = false;
mouseControl = false;
tableMC.gotoAndPlay("send0" + orderDishesArray[currentOrder]);
tableMC.rightFoodArray = tempCurrentArray;
tableMC.foodArray = _sendArray;
tableMC.displayFood(_sendArray);
waiterMC.init();
waiterMC._visible = false;
}
function sendFoodFinish(_array) {
waiterMC.sending = false;
if (_array.length && (!tableMC.isFinish())) {
waiterMC._visible = true;
} else {
nextLevel();
}
}
function nextLevel(boolean) {
trace(_global.SUBLEVEL + " _root.current_level");
gameoverBoolean = false;
if ((!boolean) || (tableMC.lessFoodArray.length == 0)) {
if (_global.SUBLEVEL == 4) {
_global.LEVEL = 1;
trace("---------------------------------------big round");
} else if (_global.SUBLEVEL >= 8) {
trace("------------------------------------all finished");
_global.SUBLEVEL = 0;
gameoverBoolean = true;
mainLevel.gotoAndStop("login_screen");
gotoAndStop ("lblgameintro");
waiterMC._visible = false;
} else {
trace("-------------------------------------small round");
}
everyRoundScoreArray.push(scoreNum);
myNewCurrentOrder++;
pauseGame();
this["successStar_" + orderDishesArray[currentOrder]]._visible = true;
this["successStar_" + orderDishesArray[currentOrder]].gotoAndPlay(1);
playSound("success");
currentOrder = _global.SUBLEVEL;
levelMC.init(_global.LEVEL + 2, _global.SUBLEVEL + 1);
((_global.SUBLEVEL >= 5) ? (waiterMC.waiterLevel2()) : (waiterMC.waiterLevel1()));
score = scoreNum;
_root.score = scoreNum;
_root.partner_score = scoreNum;
trace("game over " + tableMC.lessFoodArray.length);
_global.SUBLEVEL++;
levelLabelStr = "lblevel" + _global.SUBLEVEL;
_root.current_level = levelLabelStr;
trace("levelLabelStr " + levelLabelStr);
mopMC.pauseClear();
} else {
trace("timeout");
timeOut();
}
}
function timeOut() {
((_global.SUBLEVEL >= 5) ? (waiterMC.waiterLevel2()) : (waiterMC.waiterLevel1()));
pauseGame();
score = scoreNum;
_root.score = scoreNum;
_root.partner_score = scoreNum;
ClockMC.clearTime();
mopMC.clearTime();
mainLevel.gotoAndStop("login_screen");
gotoAndStop ("lblgameintro");
levelMC.init(_global.LEVEL + 2, _global.SUBLEVEL);
waiterMC._visible = false;
}
function resetGame(num) {
trace("num :" + num);
if ((_global.SUBLEVEL >= 8) && (gameoverBoolean)) {
_global.SUBLEVEL = 1;
levelLabelStr = "lblevel" + _global.SUBLEVEL;
_root.current_level = levelLabelStr;
gotoAndStop(levelLabelStr);
} else {
initLEVEL(num);
levelMC.init(_global.LEVEL + 2, _global.SUBLEVEL);
}
}
function clearGarbageMC() {
for (var _local1 in garbageMC) {
garbageMC[_local1].removeMovieClip();
}
}
function pauseGame() {
var _local2 = 1;
while (_local2 <= 4) {
this["food" + _local2].init();
this["food" + _local2].stopFall();
_local2++;
}
waiterMC.init();
mopMC.pauseClear();
ClockMC.clearTime();
waiterMC.stopControl();
waiterMC.stand();
}
function initLEVEL(L) {
waiterMC._visible = true;
_global.SUBLEVEL = L;
_global.LEVEL = ((L > 4) ? 1 : 0);
mainOrder = _global.LEVEL;
currentOrder = L - 1;
subOrder = L;
myNewCurrentOrder = currentOrder;
trace("_global.SUBLEVEL " + _global.SUBLEVEL);
waiterMC.stand();
levelLabelStr = "lblevel" + _global.SUBLEVEL;
levelMC.init(_global.LEVEL + 2, _global.SUBLEVEL);
((_global.SUBLEVEL == 1) ? ((scoreNum = 0)) : null);
}
_global.getRightFood = true;
var totalFoodType = 8;
var orderDishesArray;
var currentOrder = 0;
var currentFoodArray;
var mainOrder = 1;
var subOrder = 1;
var scoreNum;
var stepScore = 100;
var scoreArray = [400, 800, 1200, 1600, 2000, 2400, 2800, 3200, 3600, 20, 20];
var GAMEFINISH = false;
var fallFooded = false;
var tempCurrentArray = [];
var everyRoundScoreArray = [];
var myNewCurrentOrder = 0;
var scoreTempArray = new Array();
_global.LEVEL = 0;
_global.totalLevelNum = food1.foodMC._totalframes - 1;
_global.SPEEDFOOD = [2, 2.5, 3, 3.5, 4, 4.5, 5, 5, 5, 5, 5];
_global.SPEEDWAITER = [10, 3];
_global.FOODARRAY = [1, 2, 3, 4];
_global.SUBLEVEL = 1;
levelLabelStr = "lblevel" + _global.SUBLEVEL;
_global.LEVELTIME = [60, 60, 50, 50, 55, 55, 45, 45, 50];
_global.LEVELFOODARRAY = [[2, 3, 4, 5, 6, 7, 8, 9, 10, 20], [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]];
var _this = this;
mainLevel.gotoAndStop(1);
waiterMC._visible = true;
init();
(_root.current_level ? (gotoAndStop(_root.current_level)) : ((scoreNum = 0)));
Symbol 1009 MovieClip Frame 10
stop();
initLEVEL(1);
Symbol 1009 MovieClip Frame 20
stop();
initLEVEL(2);
Symbol 1009 MovieClip Frame 28
stop();
initLEVEL(3);
Symbol 1009 MovieClip Frame 36
stop();
initLEVEL(4);
Symbol 1009 MovieClip Frame 45
stop();
initLEVEL(5);
Symbol 1009 MovieClip Frame 54
stop();
initLEVEL(6);
Symbol 1009 MovieClip Frame 61
stop();
initLEVEL(7);
Symbol 1009 MovieClip Frame 68
stop();
initLEVEL(8);
Symbol 1009 MovieClip Frame 78
gameoverMC.playAgain.onRelease = function () {
gotoAndStop(levelLabelStr);
mainLevel.gotoAndStop(1);
};
gameoverMC.submibBtn.onRelease = function () {
gameoverMC._visible = false;
};
gameoverMC._visible = true;
stopAllSounds();