Esempio n. 1
0
 private void HandleCollision(IPlayer mario, FireHell fireHell, Direction direction)
 {
     fireHell.IsRemove = true;
     if (!(mario.CurrentPowerState is MarioStarBigState || mario.CurrentPowerState is MarioStarSmallState))
     {
         mario.TakeDamage();
     }
 }
Esempio n. 2
0
        public void FireHellHandleLoop(IPlayer mario, FireHell fireHell)
        {
            Rectangle marioBox        = mario.Rectangle;
            Rectangle intersectionBox = Rectangle.Intersect(marioBox, fireHell.Rectangle);

            if (!intersectionBox.IsEmpty)
            {
                Direction direction = AllCollisionHandler.GetCollisionDirection(intersectionBox, mario.Rectangle, fireHell.Rectangle);
                HandleCollision(mario, fireHell, direction);
            }
        }