Example #1
0
        public override bool VerifyCollision(ITouchable other)
        {
            var colliding = CollisionBounds.IntersectsWith(other.CollisionBounds);

            if (!(other is Shape) && colliding)
            {
                this.colliding = true;
            }
            return(colliding);
        }
Example #2
0
 public bool VerifyCollision(ITouchable other)
 {
     if (other is Shoot shoot)
     {
         if (shoot.Cannon.Support == this)
         {
             return(false);
         }
     }
     return(CollisionBounds.IntersectsWith(other.CollisionBounds));
 }
Example #3
0
        public override bool VerifyCollision(ITouchable other)
        {
            var colliding = CollisionBounds.IntersectsWith(other.CollisionBounds);

            if (!(other is Block) && colliding)
            {
                return(this.colliding = true);
            }
            else
            {
                return(colliding);
            }
        }
Example #4
0
 public override bool VerifyCollision(ITouchable other)
 {
     return(CollisionBounds.IntersectsWith(other.CollisionBounds));
 }
Example #5
0
 /// <summary>
 ///     Kolize s obdelnikem
 /// </summary>
 /// <param name="rectangle">
 ///     Bounding box objektu se kterym se kontroluje kolize
 /// </param>
 /// <returns></returns>
 public virtual bool RectIntersects(Rect rectangle)
 {
     return(CollisionBounds.IntersectsWith(rectangle));
 }
Example #6
0
 /// <summary>
 ///     Kontrola jestli doslo ke kolizi
 /// </summary>
 /// <param name="gameObject">
 ///     Objekt se kterym doslo ke kolizi
 /// </param>
 /// <returns></returns>
 public virtual bool Intersects(IGameObject gameObject)
 {
     return(CollisionBounds.IntersectsWith(gameObject.CollisionBounds));
 }