home *** CD-ROM | disk | FTP | other *** search
- function place_flies()
- {
- var chips = duchan.all_salads.all_chips.quantity;
- var falafel = duchan.all_salads.all_falafel.quantity;
- var humus = duchan.all_salads.all_humus.quantity;
- var salad = duchan.all_salads.all_salad.quantity;
- var max1 = Math.max(chips,falafel);
- var max2 = Math.max(humus,salad);
- var finalMax = Math.max(max1,max2);
- if(finalMax != 0)
- {
- if(finalMax == chips)
- {
- fly_X = duchan.all_salads.all_chips.my_X;
- fly_Y = duchan.all_salads.all_chips.my_Y;
- _root.currentFly = "chips";
- }
- else if(finalMax == falafel)
- {
- fly_X = duchan.all_salads.all_falafel.my_X;
- fly_Y = duchan.all_salads.all_falafel.my_Y;
- _root.currentFly = "falafel";
- }
- else if(finalMax == humus)
- {
- fly_X = duchan.all_salads.all_humus.my_X;
- fly_Y = duchan.all_salads.all_humus.my_Y;
- _root.currentFly = "humus";
- }
- else
- {
- fly_X = duchan.all_salads.all_salad.my_X;
- fly_Y = duchan.all_salads.all_salad.my_Y;
- _root.currentFly = "salad";
- }
- flies._visible = 1;
- flies.gotoAndPlay("Active");
- flies._x = fly_X;
- flies._y = fly_Y;
- }
- }
- function manageFlies()
- {
- if(0 < eval("duchan.all_salads.all_" add _root.currentFly).quantity)
- {
- _root.manageElements(eval("duchan.all_salads.all_" add currentFly));
- _root.score -= 1;
- if(_root.points_clip._visible == 0)
- {
- tellTarget("_root.points_clip")
- {
- _visible = 1;
- points = "-1";
- _X = _root.flies._x;
- _Y = _root.flies._y;
- gotoAndStop("red");
- play();
- }
- }
- else
- {
- tellTarget("_root.points_clip2")
- {
- _visible = 1;
- points = "-1";
- _X = _root.flies._x;
- _Y = _root.flies._y;
- gotoAndStop("red");
- play();
- }
- }
- }
- else
- {
- _root.place_Flies();
- }
- }
- function showPoints(howMuch)
- {
- var theXmouse = _root._xmouse;
- var theYmouse = _root._ymouse;
- if(_root.points_clip._visible == 0)
- {
- tellTarget("_root.points_clip")
- {
- _visible = 1;
- points = howmuch;
- _X = theXmouse;
- _Y = theYmouse;
- if(0 < Number(points))
- {
- gotoAndStop("green");
- play();
- }
- else
- {
- gotoAndStop("red");
- play();
- }
- }
- }
- else
- {
- tellTarget("_root.points_clip2")
- {
- _visible = 1;
- points = howmuch;
- _X = theXmouse;
- _Y = theYmouse;
- if(0 < Number(points))
- {
- gotoAndStop("green");
- play();
- }
- else
- {
- gotoAndStop("red");
- play();
- }
- }
- }
- }
-