/// <summary>
 /// 
 /// </summary>
 /// <param name="b1"></param>
 /// <param name="s1"></param>
 /// <param name="b2"></param>
 /// <returns></returns>
 public static bool colitionTest(BasicObjet b1, Size s1, BasicObjet b2)
 {
     return b2.position.x > b1.position.x + s1.Width         ||
             b2.position.y > b1.position.y + s1.Height       ||
             b1.position.x > b2.position.x + b2.img.Width    ||
             b1.position.y > b2.position.y + b2.img.Height;
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="b1"></param>
 /// <param name="b2"></param>
 /// <returns></returns>
 public static bool colitionTest(BasicObjet b1, BasicObjet b2)
 {
     ///see the PDF about the project
     return  b2.position.x > b1.position.x + b1.img.Width    ||
             b2.position.y > b1.position.y + b1.img.Height   ||
             b1.position.x > b2.position.x + b2.img.Width    ||
             b1.position.y > b2.position.y + b2.img.Height;
 }
        public virtual void fire(BasicObjet fireShip)
        {
            this.live = this.liveOnFire;
            this.position = new Vecteur2D(
                fireShip.position.x-this.img.Width/2 +fireShip.img.Width/2
               ,fireShip.position.y - this.img.Height -1);

            misileList.Add(this);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="deltaT">time to move </param>
        /// <param name="keyPressed"> list of key press</param>
        /// <param name="fireship"> the fire ship</param>
        public void move(double deltaT, HashSet<Keys> keyPressed,BasicObjet fireship)
        {
            if (keyPressed.Contains(Keys.Space) &&! this.listMissile[this.curentChose].Item1.alive  && ( this.listMissile[this.curentChose].Item2[0]>0 || this.listMissile[this.curentChose].Item2[0] == -1))
            {
                this.listMissile[this.curentChose].Item1.fire(fireship);
                if(this.listMissile[this.curentChose].Item2[0]!= -1)
                    this.listMissile[this.curentChose].Item2[0]--;
            }

            if (keyPressed.Contains(Keys.A) && keyPressTime <0)
            {

                this.curentChose = (this.curentChose + 1 + this.listMissile.Count) % this.listMissile.Count;
                keyPressTime = 0.3;
            }

            if (keyPressed.Contains(Keys.Z)&&keyPressTime < 0)
            {
                keyPressTime = 0.3;
                this.curentChose = (this.curentChose - 1 + this.listMissile.Count) % this.listMissile.Count;
            }
            keyPressTime -= deltaT;
        }
 public override void fire(BasicObjet fireShip)
 {
     base.fire(fireShip);
     this.brotherLeft.fire(fireShip);
     this.brotherRight.fire(fireShip);
 }
 public void colitionPlayer(BasicObjet bs)
 {
     foreach (BasicObjet en in listSpaceship)
         if (!BasicObjet.colitionTest(bs, en)) {
             int old;
             old = en.live;
             en.live -= bs.live;
             bs.live -= old;
         }
 }