Example #1
0
        protected Rectangle CanWallJump(WallMap wallMap)
        {
            Rectangle futureBoundingBox = new Rectangle((int)(BoundingBox.X + (1 * direction.X)),
                                                        (int)(BoundingBox.Y + 4),
                                                        (int)(BoundingBox.Width),
                                                        (int)(BoundingBox.Height - 14));


            return(wallMap.CheckCollision(futureBoundingBox));
        }
Example #2
0
        protected Rectangle OnGround(WallMap wallMap)
        {
            Rectangle futureBoundingBox = new Rectangle((int)((BoundingBox.X)),
                                                        (int)((BoundingBox.Y) + (1)),
                                                        (int)(BoundingBox.Width),
                                                        (int)(BoundingBox.Height));


            return(wallMap.CheckCollision(futureBoundingBox));
        }
Example #3
0
 protected Rectangle OneEdgeOfGround(WallMap wallMap)
 {
     if (direction.X == 1)
     {
         Rectangle futureBoundingBox = new Rectangle((int)((BoundingBox.X + BoundingBox.Width)),
                                                     (int)((BoundingBox.Y + 1)),
                                                     (int)(BoundingBox.Width),
                                                     (int)(BoundingBox.Height));
         return(wallMap.CheckCollision(futureBoundingBox));
     }
     else
     {
         Rectangle futureBoundingBox = new Rectangle((int)((BoundingBox.X - BoundingBox.Width)),
                                                     (int)((BoundingBox.Y) + (1)),
                                                     (int)(BoundingBox.Width),
                                                     (int)(BoundingBox.Height));
         return(wallMap.CheckCollision(futureBoundingBox));
     }
 }