Esempio n. 1
0
 public Level(GameplayScreen pParent)
 {
     m_pBounds = new Circle(Vector2.Zero, 10);
     Console.WriteLine(m_pBounds.Center.ToString());
     m_pBoundingBox = new BoundingBox2D(0, 0, 62, 62);
     Console.WriteLine(m_pBoundingBox.ToString());
 }
Esempio n. 2
0
        public bool Intersects(BoundingBox2D pOther)
        {
            /*
             * Kolla ifall vi intersektar med den!
             */
            /*
            if (this.Bottom < pBoundingBox.Top) return false;
            if (this.Top > pBoundingBox.Bottom) return false;
            if (this.Right < pBoundingBox.Left) return false;
            if (this.Left > pBoundingBox.Right) return false;

            return true;*/
            return !(this.Left > pOther.Right || this.Right < pOther.Left ||
                this.Top > pOther.Bottom || this.Bottom < pOther.Top);
        }