home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Corrida / amazingrace.swf / scripts / DefineSprite_205 / frame_1 / DoAction.as
Encoding:
Text File  |  2006-06-13  |  830 b   |  35 lines

  1. function addBird()
  2. {
  3.    speed = random(10) / 9 + 0.1;
  4.    speed_x = random(10) / 9 + 0.2;
  5.    b = 0;
  6.    while(b < random(2) + 3)
  7.    {
  8.       birds_mc.inst_bird_mc.duplicateMovieClip("bird_" + birds + "_mc",birds);
  9.       new_bird_mc = eval("birds_mc.bird_" + birds + "_mc");
  10.       bird_scale = random(20) + 60;
  11.       new_bird_mc._xscale = bird_scale;
  12.       new_bird_mc._yscale = bird_scale;
  13.       new_bird_mc._x = 200 + random(50);
  14.       new_bird_mc._y = random(100) + 50;
  15.       new_bird_mc.speed = speed + random(5) / 9;
  16.       new_bird_mc.speed_x = speed_x + random(5) / 9;
  17.       new_bird_mc._visible = true;
  18.       birds++;
  19.       b++;
  20.    }
  21. }
  22. stop();
  23. birds = 0;
  24. times = 0;
  25. birds_mc.onEnterFrame = function()
  26. {
  27.    if(times == 300)
  28.    {
  29.       addBird();
  30.       times = 0;
  31.    }
  32.    times++;
  33. };
  34. addBird();
  35.