home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 145 / MOBICLIC145.ISO / pc / DATA / DSS145 / DSS145_12 / DSS145_12.swf / scripts / dss145_12 / AttackSequence.as next >
Text File  |  2012-07-19  |  3KB  |  83 lines

  1. package dss145_12
  2. {
  3.    import flash.geom.Point;
  4.    
  5.    public class AttackSequence
  6.    {
  7.        
  8.       
  9.       public var timeActual:Number = 0;
  10.       
  11.       public var params:Object;
  12.       
  13.       public var attacks:Array;
  14.       
  15.       public function AttackSequence()
  16.       {
  17.          this.attacks = [];
  18.          super();
  19.       }
  20.       
  21.       public function add(param1:Object) : void
  22.       {
  23.          var _loc3_:Number = NaN;
  24.          var _loc4_:Point = null;
  25.          param1.done = false;
  26.          if(param1.speedX != undefined && param1.speedX != 0)
  27.          {
  28.             if(param1.speedX > 0)
  29.             {
  30.                param1.startPoint = new Point(param1.repere.x,param1.repere.y);
  31.                param1.endPoint = new Point(param1.repere.x + param1.repere.width,param1.repere.y);
  32.             }
  33.             else
  34.             {
  35.                param1.startPoint = new Point(param1.repere.x + param1.repere.width,param1.repere.y);
  36.                param1.endPoint = new Point(param1.repere.x,param1.repere.y);
  37.             }
  38.          }
  39.          if(param1.speedY != undefined && param1.speedY != 0)
  40.          {
  41.             if(param1.speedY > 0)
  42.             {
  43.                if(param1.type == "LAVE")
  44.                {
  45.                   _loc3_ = Math.random() * 700 + 50;
  46.                   _loc4_ = new Point(_loc3_,-50);
  47.                   (_loc4_ = param1.repere.parent.globalToLocal(_loc4_)).x = _loc3_;
  48.                   param1.startPoint = _loc4_;
  49.                   _loc4_ = new Point(_loc3_,700);
  50.                   (_loc4_ = param1.repere.parent.globalToLocal(_loc4_)).x = _loc3_;
  51.                   param1.endPoint = _loc4_;
  52.                }
  53.                else
  54.                {
  55.                   param1.startPoint = new Point(param1.repere.x,param1.repere.y);
  56.                   param1.endPoint = new Point(param1.repere.x,param1.repere.y + param1.repere.height);
  57.                }
  58.             }
  59.             else
  60.             {
  61.                param1.startPoint = new Point(param1.repere.x,param1.repere.y + param1.repere.height);
  62.                param1.endPoint = new Point(param1.repere.x,param1.repere.y);
  63.             }
  64.          }
  65.          var _loc2_:Boolean = param1.convertOnlyWithoutAdd == undefined ? false : true;
  66.          if(_loc2_ == false)
  67.          {
  68.             this.attacks.push(param1);
  69.          }
  70.       }
  71.       
  72.       public function reset() : void
  73.       {
  74.          var _loc1_:int = 0;
  75.          while(_loc1_ < this.attacks.length)
  76.          {
  77.             this.attacks[_loc1_].done = false;
  78.             _loc1_++;
  79.          }
  80.       }
  81.    }
  82. }
  83.