Exemple #1
0
        public bool IsNearRotated(BaseObject r, float factor)
        {
            Rectangle inflatedRectangle = new Rectangle(X, Y, Width, Height);

            inflatedRectangle.Inflate((int)(Width * factor), (int)(Height * factor));
            return(r.Intersects(inflatedRectangle));
        }
Exemple #2
0
 void checkForSledgeHammerHits()
 {
     if (sledgeHammerInUse)
     {
         if (alex is AlexEnchanter && ((AlexEnchanter)alex).HasPeanutShield)
         {
             if (sledgeHammer.Intersects(alex))
             {
                 ((AlexEnchanter)alex).BreakPeanutShield();
                 soundEffectManager.Play(peanutShieldBreakSound, .25f);
             }
         }
     }
 }
Exemple #3
0
 void checkForSledgeHammerHits()
 {
     if (sledgeHammerInUse)
     {
         for (int i = 0; i < Bullet.Cans.Count;)
         {
             Bullet b = Bullet.Cans[i];
             if (sledgeHammer.Intersects(b))
             {
                 soundEffectManager.Play(canDeath, .5f);
                 Bullet.Cans.Remove(b);
             }
             else
             {
                 i++;
             }
         }
     }
 }
Exemple #4
0
 public bool IsNearRotated(BaseObject r, float factor)
 {
     Rectangle inflatedRectangle = new Rectangle(X, Y, Width, Height);
     inflatedRectangle.Inflate((int)(Width * factor), (int)(Height * factor));
     return r.Intersects(inflatedRectangle);
 }