Exemplo n.º 1
0
 private bool isPickupable(Enemy e)
 {
     return !(e is DogEnemy);
 }
Exemplo n.º 2
0
 private bool intersectsLow(Enemy enemy)
 {
     Vector2 botLeft = new Vector2(Position.X, Position.Y + Height);
     Vector2 botRight = new Vector2(Position.X + Width, Position.Y + Height);
     if ( (botLeft.X >= enemy.Position.X && botLeft.X <= enemy.Position.X + enemy.Width &&
         botLeft.Y >= enemy.Position.Y && botLeft.Y <= enemy.Position.Y + enemy.Height) ||
         (botRight.X >= enemy.Position.X && botRight.X <= enemy.Position.X + enemy.Width &&
         botRight.Y >= enemy.Position.Y && botRight.Y <= enemy.Position.Y + enemy.Height))
     {
         return true;
     }
     return false;
 }