コード例 #1
0
 //public bool ObjectCollision(Kolobok kolobok, Obstacle obstacle)
 //{
 //    return (Rectangle.Intersect(kolobok.Bounds(), obstacle.Bounds()) != Rectangle.Empty);
 //}
 //public bool ObjectCollision(Tank tank, Obstacle obstacle)
 //{
 //    return (Rectangle.Intersect(tank.Bounds(), obstacle.Bounds()) != Rectangle.Empty);
 //}
 public bool ObjectCollision(BaseObject obj, Obstacle obstacle)
 {
     return(Rectangle.Intersect(obj.Bounds(), obstacle.Bounds()) != Rectangle.Empty);
     //return obj.Bounds().IntersectsWith(obstacle.Bounds());
 }
コード例 #2
0
 public bool ObjectCollision(Bullet bullet, Obstacle obstacle)
 {
     return(Rectangle.Intersect(bullet.Bounds(), obstacle.Bounds()) != Rectangle.Empty);
     //return bullet.Bounds().IntersectsWith(obstacle.Bounds());
 }