示例#1
0
 public void CheckMarioEnemyCollision(Rectangle marioBox, IWorld Level)
 {
     foreach (IEnemy enemy in Level.Enemies)
     {
         Rectangle enemyBox        = enemy.Rectangle;
         Rectangle intersectionBox = Rectangle.Intersect(enemyBox, marioBox);
         if (!intersectionBox.IsEmpty)
         {
             Direction direction = AllCollisionHandler.GetCollisionDirection(intersectionBox, marioBox, enemyBox);
             MarioEnemyHandler.HandleCollision(Level.Mario, enemy, direction);
         }
     }
 }