home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / AitchuTheAbduction.swf / scripts / frame_15 / DoAction.as
Encoding:
Text File  |  2005-11-10  |  1.0 KB  |  38 lines

  1. Monstre4 = function()
  2. {
  3.    super();
  4.    this.vitesse = 10;
  5.    this.vie = 2000;
  6. };
  7. Monstre4.prototype = new Ennemi();
  8. Object.registerClass("Monstre4Clip",Monstre4);
  9. Monstre4.prototype.onEnterFrame = function()
  10. {
  11.    super.onEnterFrame();
  12.    this._rotation += 8;
  13. };
  14. Monstre4.prototype.tirnormal = function()
  15. {
  16.    if(random(3) == 0)
  17.    {
  18.       var teta = this._rotation * 2 * 3.141592653589793 / 360;
  19.       var j = 0;
  20.       while(j < 8)
  21.       {
  22.          var i = this.chercheTirLibre();
  23.          if(i == -1)
  24.          {
  25.             return 0;
  26.          }
  27.          this._parent.tirEnnemiClip.attachMovie("TirDirigeClip","tirEnnemi" + i,_global.tirEnnemiDepth + i);
  28.          var clip = this._parent.tirEnnemiClip["tirEnnemi" + i];
  29.          clip._x = this._x + this._width / 2 * Math.cos(teta);
  30.          clip._y = this._y + this._height / 2 * Math.sin(teta);
  31.          clip.angle = Math.atan2(clip._y - this._y,clip._x - this._x);
  32.          clip.vitesse = 15;
  33.          teta += 0.7853981633974483;
  34.          j++;
  35.       }
  36.    }
  37. };
  38.