home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / squadron_angel.swf / scripts / frame_20 / DoAction.as
Encoding:
Text File  |  2007-03-20  |  1.9 KB  |  67 lines

  1. gagne = 1;
  2. plane.plane.plane.plane.stop();
  3. fuelAlarma.gotoAndStop(1);
  4. initSpeed = vitesseScroll / 2;
  5. consigneDecor = - lastDecor._x - 200;
  6. initX = plane._x;
  7. initY = plane._y;
  8. amplitudeV = hauteurJeu - initY;
  9. amplitudeH = 250;
  10. angle = -90;
  11. speedAtterissage = 3;
  12. this.onEnterFrame = function()
  13. {
  14.    var _loc1_ = this;
  15.    scrollDecor();
  16.    if(decor1._x < consigneDecor)
  17.    {
  18.       decor1._x = consigneDecor;
  19.    }
  20.    trace(consigneDecor);
  21.    if(decor1._x - 300 > consigneDecor)
  22.    {
  23.       vitesseScroll = initSpeed;
  24.       scrollDecor();
  25.       plane._rotation += (- plane._rotation) / 20;
  26.       plane.angle += (- plane.angle) / 10;
  27.       plane._y += plane.gaz * Math.sin(plane.angle);
  28.       plane._y = Math.min(plane._y,hauteurJeu);
  29.       plane._y = Math.max(plane._y,50);
  30.    }
  31.    else
  32.    {
  33.       initX = plane._x;
  34.       initY = plane._y;
  35.       amplitudeV = hauteurJeu - plane._y;
  36.       _loc1_.onEnterFrame = function()
  37.       {
  38.          vitesseScroll = initSpeed;
  39.          scrollDecor();
  40.          if(decor1._x < consigneDecor)
  41.          {
  42.             decor1._x = consigneDecor;
  43.          }
  44.          plane._y = (Math.sin(angle / 180 * 3.141592653589793) + 1) / 2 * amplitudeV + initY;
  45.          plane._x = (angle + 90) / 180 * amplitudeH + initX;
  46.          coefRot = Math.min(1,amplitudeV / 500);
  47.          plane._rotation = Math.cos(angle / 180 * 3.141592653589793) * 50 * coefRot;
  48.          angle += 3;
  49.          if(angle >= 90)
  50.          {
  51.             play();
  52.             this.onEnterFrame = function()
  53.             {
  54.                valSound = Math.max(0,motorSND.getVolume() - 1);
  55.                motorSND.setVolume(valSound);
  56.                plane._x += speedAtterissage;
  57.                speedAtterissage /= 1.01;
  58.                if(decor1._x == consigneDecor && Math.round(speedAtterissage * 10) == 0)
  59.                {
  60.                   this.onEnterFrame = null;
  61.                }
  62.             };
  63.          }
  64.       };
  65.    }
  66. };
  67.