home *** CD-ROM | disk | FTP | other *** search
- function playNumberSalad(howMany)
- {
- if(howMany == 8)
- {
- audio.gotoAndPlay(fruitAdd8[salad_menu.got_fruit] + "_up");
- }
- else if(howMany == 7)
- {
- audio.gotoAndPlay(fruitAdd7[salad_menu.got_fruit] + "_up");
- }
- else if(howMany == 6)
- {
- audio.gotoAndPlay(fruitAdd6[salad_menu.got_fruit] + "_up");
- }
- else if(howMany == 5)
- {
- audio.gotoAndPlay(fruitAdd5[salad_menu.got_fruit] + "_up");
- }
- else if(howMany == 4)
- {
- audio.gotoAndPlay(fruitAdd4[salad_menu.got_fruit] + "_up");
- }
- else if(howMany == 3)
- {
- audio.gotoAndPlay(fruitAdd3[salad_menu.got_fruit] + "_up");
- }
- else if(howMany == 2)
- {
- audio.gotoAndPlay(fruitAdd2[salad_menu.got_fruit] + "_up");
- }
- if(salad_menu.got_fruit == 0)
- {
- iDelayer.addDelayedEvent(18,OnPlayClip,"l" + salad_menu.which_fruit + "Sound");
- }
- }
- function playNumber()
- {
- audio.gotoAndPlay(fruitNumber[salad_menu.got_fruit + 1] + "_up");
- }
- function playNumber2()
- {
- stopAllSounds();
- var num = salad_menu.got_fruit + 1;
- snd = new Sound();
- snd.attachSound("sNumber" + num);
- snd.start();
- }
- function playFruit()
- {
- if(payoff_anim.payoffAudioAdj == true)
- {
- if(salad_menu.howManyFruit == salad_menu.got_fruit + 1)
- {
- audio.gotoAndPlay(salad_menu.which_fruit + "_flat");
- }
- else
- {
- audio.gotoAndPlay(salad_menu.which_fruit + "s_up");
- }
- }
- else if(audioPhrase.temp == false)
- {
- if(1 >= salad_menu.got_fruit)
- {
- audio.gotoAndPlay(salad_menu.which_fruit + "_flat");
- }
- else
- {
- audio.gotoAndPlay(salad_menu.which_fruit + "s_up");
- }
- }
- else
- {
- audio.gotoAndPlay(salad_menu.which_fruit + "s_flat");
- }
- }
- function playCharacter()
- {
- audio.gotoAndPlay(my_char + "_flat");
- }
- function fadeOut(whatFade)
- {
- objectAlpha = getProperty(eval(whatFade), _alpha);
- if(0 < objectAlpha)
- {
- setProperty(eval(whatFade), _alpha, objectAlpha - 1);
- fadeOut(whatFade);
- }
- }
- function fadeIn(whatFade)
- {
- objectAlpha = getProperty(eval(whatFade), _alpha);
- if(objectAlpha < 100)
- {
- setProperty(eval(whatFade), _alpha, objectAlpha + 1);
- fadeIn(whatFade);
- }
- }
- function init_game()
- {
- my_char = "miffy";
- salad_index = 0;
- salad_master = new Array("carrot","orange","tomato","apple");
- salad_nums_master = new Array(4,4,3,6);
- salad_things = new Array();
- salad_nums = new Array();
- salad_got = new Array();
- createSaladArray();
- audioPhraseFull = true;
- initGardenMap(salad_things,salad_nums);
- isFirstRound = true;
- }
- function createSaladArray()
- {
- if(totalLoops < 4)
- {
- var j = random(4);
- if(j == loop0)
- {
- salad_things.push(salad_master[j]);
- var num = Math.floor(Math.random() * (salad_nums_master[j] - 1)) + 2;
- salad_nums.push(num);
- loop0 = "off";
- totalLoops++;
- createSaladArray();
- }
- else if(j == loop1)
- {
- salad_things.push(salad_master[j]);
- var num = Math.floor(Math.random() * (salad_nums_master[j] - 1)) + 2;
- salad_nums.push(num);
- loop1 = "off";
- totalLoops++;
- createSaladArray();
- }
- else if(j == loop2)
- {
- salad_things.push(salad_master[j]);
- var num = Math.floor(Math.random() * (salad_nums_master[j] - 1)) + 2;
- salad_nums.push(num);
- loop2 = "off";
- totalLoops++;
- createSaladArray();
- }
- else if(j == loop3)
- {
- salad_things.push(salad_master[j]);
- var num = Math.floor(Math.random() * (salad_nums_master[j] - 1)) + 2;
- salad_nums.push(num);
- loop3 = "off";
- totalLoops++;
- createSaladArray();
- }
- else
- {
- createSaladArray();
- }
- }
- else
- {
- totalLoops = 0;
- loop0 = 0;
- loop1 = 1;
- loop2 = 2;
- loop3 = 3;
- }
- }
- function init_garden()
- {
- click = false;
- garden_character.gotoAndStop(my_char);
- num_fruits = salad_nums[salad_index];
- salad_menu.num_fruit = num_fruits;
- salad_menu.got_fruit = 0;
- salad_menu.which_fruit = salad_things[salad_index];
- var menu_label = num_fruits + salad_things[salad_index];
- salad_menu.gotoAndStop(menu_label);
- }
- function clicked_on(what)
- {
- if(click == true)
- {
- stopAllSounds();
- audioPhrase.gotoAndStop(1);
- timer.gotoAndStop(1);
- audioPhrase.temp = false;
- if(what == salad_things[salad_index])
- {
- if(salad_menu.got_fruit < salad_menu.num_fruit)
- {
- playNumber2();
- garden_character.iCharacter.gotoAndPlay("pos");
- audioFruit.play();
- salad_menu.add_one();
- removeGardenObject(what);
- return true;
- }
- garden_character.iCharacter.gotoAndPlay("neg");
- audio.gotoAndPlay("oops");
- return false;
- }
- garden_character.iCharacter.gotoAndPlay("neg");
- audio.gotoAndPlay("oops");
- return false;
- }
- }
- function got_all_fruit()
- {
- click = false;
- salad_got.push(salad_menu.got_fruit);
- salad_index += 1;
- iDelayer.addDelayedEvent(15,OnPayOff);
- }
- var fruitNumber = new Array("","one","two","three","four","five","six","seven","eight");
- var fruitAdd8 = new Array("eight","seven","six","five","four","three","two","one");
- var fruitAdd7 = new Array("seven","six","five","four","three","two","one");
- var fruitAdd6 = new Array("six","five","four","three","two","one");
- var fruitAdd5 = new Array("five","four","three","two","one");
- var fruitAdd4 = new Array("four","three","two","one");
- var fruitAdd3 = new Array("three","two","one");
- var fruitAdd2 = new Array("two","one");
- if(gQuitUrl == undefined)
- {
- gQuitUrl = "http://noggin.com";
- }
- var loop0 = 0;
- var loop1 = 1;
- var loop2 = 2;
- var loop3 = 3;
- var totalLoops = 0;
-