Example #1
0
 public void checkForHit() {
   if (topWall.getTopBounds().intersects(bird.getBounds())
       || bottomWall.getTopBounds().intersects(bird.getBounds())
       || topWall.getBottomBounds().intersects(bird.getBounds())
       || bottomWall.getBottomBounds().intersects(bird.getBounds())
       || bird.getBounds().intersects(new Rectangle2D.Double(0, 600, 800, 10))) {
     isDead = true;
   }
 }