Frame 1
stopAllSounds();
this.stop();
Frame 9
function DispatchGameData(point, score) {
var _local1 = new LoadVars();
_local1.code = "foods";
_local1.point = point;
_local1.score = score;
_local1.sendAndLoad("./getpoint.php", _local1, "POST");
_local1.onLoad = function () {
if (_root.rtnurl.length > 2) {
getURL (_root.rtnurl);
} else {
getURL ("../");
}
};
}
function soundPlay(name, loop) {
var _local1 = this;
if (_local1.gameVolume > 0) {
_local1.soundObj[name].start(0, loop);
_local1.soundObj[name].setVolume(_local1.gameVolume);
}
}
function soundStop(name) {
this.soundObj[name].stop(name);
}
var soundName = ["yes", "no", "tik", "ok", "end"];
var soundObj = Array();
var gameVolume = 100;
var i = 0;
while (i <= soundName.length) {
soundObj[soundName[i]] = new Sound();
soundObj[soundName[i]].attachSound(soundName[i]);
i++;
}
Symbol 15 Button
on (release) {
this._visible = false;
_root.HELP._visible = true;
}
Symbol 21 Button
on (release) {
_root.gotoAndStop("GAME");
}
Symbol 33 Button
on (release) {
this._visible = false;
_root.GAME._visible = true;
}
Symbol 34 MovieClip Frame 1
this._visible = false;
this.stop();
Symbol 45 MovieClip Frame 1
this.stop();
Symbol 50 MovieClip Frame 1
this.stop();
Symbol 54 Button
on (press) {
if (this.FOOD._visible == true) {
this.depths = this.getDepth();
this.FOOD._xscale = (this.FOOD._yscale = 100);
this.swapDepths(-1);
this.FOOD.startDrag();
_root.soundPlay("tik", 1);
}
}
on (release, releaseOutside) {
this.FOOD.stopDrag();
this.FOOD._x = 0;
this.FOOD._y = 0;
this.FOOD._xscale = (this.FOOD._yscale = 40);
this.swapDepths(this.depths);
var i = 1;
while (i <= 10) {
if (_root["D" + i].hitTest(_root._xmouse, _root._ymouse, true)) {
if (this.FOOD._currentframe == _root["D" + i].FOOD._currentframe) {
_root["D" + i].FOOD._visible = true;
this.FOOD._visible = false;
_root.AS.Check_Food();
_root.soundPlay("yes", 1);
break;
}
_root.AS.Life_Del();
_root.soundPlay("no", 1);
break;
}
i++;
}
}
Symbol 66 MovieClip Frame 1
this.stop();
Symbol 67 MovieClip Frame 1
this.depths = this.getDepth();
this.stop();
Symbol 72 MovieClip Frame 1
this.stop();
Symbol 78 MovieClip Frame 1
this.stop();
Symbol 80 MovieClip Frame 1
function shuffle(Arr, Cnt) {
var _local1 = Arr;
var len = _local1.length;
if (Cnt == undefined) {
Cnt = len;
}
var _local2 = 0;
while (_local2 < Cnt) {
var x = random(len);
var _local3 = random(len);
var z = _local1[x];
_local1[x] = _local1[_local3];
_local1[_local3] = z;
_local2++;
}
}
function Dset(tMC, view, scale, x, y) {
var _local1 = tMC;
_local1._x = x;
_local1._y = y;
_local1._xscale = (_local1._yscale = scale);
_local1.FOOD._visible = true;
_local1._visible = view;
}
function stageSetup() {
var _local1 = _parent;
var _local2 = this;
var foods = [];
var foods2 = [];
var _local3 = 1;
while (_local3 <= 12) {
foods[_local3 - 1] = _local3;
foods2[_local3 - 1] = _local3;
_local3++;
}
_local2.shuffle(foods, 30);
_local2.shuffle(foods2, 30);
_local3 = 1;
while (_local3 <= 10) {
_local1["D" + _local3].FOOD.gotoAndStop(foods2[_local3 - 1]);
_local2.Dset(_local1["D" + _local3], false, 10, -100, -100);
_local3++;
}
_local3 = 1;
while (_local3 <= 12) {
_local1["C" + _local3].FOOD.gotoAndStop(foods[_local3 - 1]);
_local1["C" + _local3].FOOD._visible = true;
_local1["C" + _local3].BUTTON._visible = false;
_local3++;
}
if (_local2.lev == 1) {
_local2.Dset(_local1.D1, true, 100, 300, 90);
_local2.Dset(_local1.D2, true, 100, 200, 210);
_local2.Dset(_local1.D3, true, 100, 400, 210);
} else if (_local2.lev == 2) {
_local2.Dset(_local1.D1, true, 80, 300, 70);
_local2.Dset(_local1.D2, true, 80, 220, 155);
_local2.Dset(_local1.D3, true, 80, 380, 155);
_local2.Dset(_local1.D4, true, 80, 150, 240);
_local2.Dset(_local1.D5, true, 80, 300, 240);
_local2.Dset(_local1.D6, true, 80, 450, 240);
} else if (_local2.lev == 3) {
_local2.Dset(_local1.D1, true, 60, 300, 60);
_local2.Dset(_local1.D2, true, 60, 240, 120);
_local2.Dset(_local1.D3, true, 60, 360, 120);
_local2.Dset(_local1.D4, true, 60, 185, 180);
_local2.Dset(_local1.D5, true, 60, 300, 180);
_local2.Dset(_local1.D6, true, 60, 415, 180);
_local2.Dset(_local1.D7, true, 60, 120, 250);
_local2.Dset(_local1.D8, true, 60, 240, 250);
_local2.Dset(_local1.D9, true, 60, 360, 250);
_local2.Dset(_local1.D10, true, 60, 480, 250);
}
_local1.LEVBOX.gotoAndStop(_local2.lev);
_local1.TIMEBAR.TXT = _local2.maxTime;
_local1.TIMEBAR.BAR.gotoAndStop(1);
_local1.TIMEBAR.BAR._yscale = 100;
_local1.VIEWMC.gotoAndStop(1);
_local1.VIEWMC._visible = false;
_local1.LEVMC._xscale = (_local1.LEVMC._yscale = 10);
_local1.LEVMC.gotoAndStop(_local2.lev);
_local1.LEVMC._visible = true;
_local2.timecount = false;
_local2.ts = getTimer();
_local3 = 1;
while (_local3 <= 10) {
_local1["D" + _local3]._visible = false;
_local3++;
}
}
function Setup() {
var _local1 = this;
_parent.LEVMC._visible = false;
_local1.score = 0;
_local1.lev = 1;
_local1.life = 3;
_local1.Life_Display();
_local1.stageSetup();
_local1.gameplay = true;
}
function Life_Del() {
var _local1 = this;
_local1.life--;
_local1.Life_Display();
if (_local1.life < 1) {
_local1.GameOver();
}
}
function Life_Display() {
var _local2 = _parent;
var _local3 = this;
var _local1 = 1;
while (_local1 <= 3) {
if (_local3.life < _local1) {
_local2["H" + _local1].gotoAndStop(2);
} else {
_local2["H" + _local1].gotoAndStop(1);
}
_local1++;
}
}
function Check_Food() {
var _local2 = this;
var _local3 = _parent;
var num = 0;
var _local1 = 1;
while (_local1 <= 10) {
if ((_local3["D" + _local1]._visible == true) && (_local3["D" + _local1].FOOD._visible == true)) {
num++;
}
_local1++;
}
trace((_local2.lev + " : ") + num);
var t = (_local2.maxTime - ((getTimer() - _local2.ts) / 1000));
if ((_local2.lev == 1) && (num == 3)) {
if (t >= 21) {
_local2.score = _local2.score + 15;
} else if (t >= 11) {
_local2.score = _local2.score + 10;
} else {
_local2.score = _local2.score + 5;
}
_root.soundPlay("ok", 1);
_local2.lev = 2;
_local2.stageSetup();
} else if ((_local2.lev == 2) && (num == 6)) {
if (t >= 21) {
_local2.score = _local2.score + 20;
} else if (t >= 11) {
_local2.score = _local2.score + 15;
} else {
_local2.score = _local2.score + 10;
}
_root.soundPlay("ok", 1);
_local2.lev = 3;
_local2.stageSetup();
} else if ((_local2.lev == 3) && (num == 10)) {
if (t >= 21) {
_local2.score = _local2.score + 50;
} else if (t >= 11) {
_local2.score = _local2.score + 30;
} else {
_local2.score = _local2.score + 20;
}
_local2.GameOver();
}
}
function GameOver() {
var _local2 = _root;
var _local3 = _parent;
var _local1 = 1;
while (_local1 <= 12) {
_local3["C" + _local1].BUTTON._visible = false;
_local1++;
}
_local2.POPUP.levTXT = this.lev;
_local2.POPUP.point = (_local2.POPUP.score = this.score);
_local2.POPUP.pointTXT = _local2.POPUP.point;
_local2.POPUP._visible = true;
this.gameplay = false;
_local2.soundPlay("end", 1);
}
this.score = 0;
this.lev = 1;
this.life = 3;
this.maxTime = 30;
this.timeArr = [50, 100, 150];
this.timecount = false;
this.ts = getTimer();
this.gameplay = false;
this.onEnterFrame = function () {
var _local1 = _parent;
var _local3 = this;
if (_local3.gameplay == true) {
if (_local3.timecount == true) {
var tMC = _local1.TIMEBAR;
var t = (_local3.maxTime - ((getTimer() - _local3.ts) / 1000));
if (t > 0) {
tMC.TXT = Math.ceil(t);
tMC.BAR._yscale = Math.ceil(t / (_local3.maxTime / 10)) * 10;
if (t > 12) {
tMC.BAR.gotoAndStop(1);
} else {
tMC.BAR.gotoAndStop(2);
}
} else {
tMC.TXT = 0;
tMC.BAR._yscale = 0;
_local3.GameOver();
}
} else if (_local1.LEVMC._visible == true) {
_local1.LEVMC._xscale = (_local1.LEVMC._yscale = _local1.LEVMC._xscale + 6);
if (_local1.LEVMC._xscale >= 100) {
_local1.LEVMC._xscale = (_local1.LEVMC._yscale = 100);
_local1.LEVMC._visible = false;
if (_local3.lev == 1) {
var _local2 = 1;
while (_local2 <= 3) {
_local1["D" + _local2]._visible = true;
_local2++;
}
} else if (_local3.lev == 2) {
var _local2 = 1;
while (_local2 <= 6) {
_local1["D" + _local2]._visible = true;
_local2++;
}
} else {
var _local2 = 1;
while (_local2 <= 10) {
_local1["D" + _local2]._visible = true;
_local2++;
}
}
_local3.ts = getTimer();
_local1.VIEWMC._visible = true;
}
} else {
var t = ((getTimer() - _local3.ts) / 100);
if (t >= _local3.timeArr[_local3.lev - 1]) {
var _local2 = 1;
while (_local2 <= 10) {
_local1["D" + _local2].FOOD._visible = false;
_local2++;
}
_local2 = 1;
while (_local2 <= 12) {
_local1["C" + _local2].BUTTON._visible = true;
_local2++;
}
_local1.VIEWMC._visible = false;
_local3.timecount = true;
_local3.ts = getTimer();
} else if (t > (_local3.timeArr[_local3.lev - 1] - 5)) {
_local1.VIEWMC.gotoAndStop(3);
} else if (t > (_local3.timeArr[_local3.lev - 1] - 15)) {
_local1.VIEWMC.gotoAndStop(2);
} else {
_local1.VIEWMC.gotoAndStop(1);
}
}
}
};
this.Setup();
this._visible = false;
this.stop();
Symbol 85 MovieClip Frame 1
this.stop();
Symbol 89 MovieClip Frame 1
this.stop();
Symbol 99 Button
on (release) {
_root.gotoAndStop("INTRO");
}
Symbol 101 MovieClip Frame 1
this._visible = false;
this.stop();