public boolean collides(final double x,final double y,final double w,final double h){
  if ((x < 0) || (x + w > width)) {
    return true;
  }
  if ((y < 0) || (y + h > height)) {
    return true;
  }
  int iHeight=(int)Math.ceil(Math.ceil(y + h) - y);
  int iWidth=(int)Math.ceil(Math.ceil(x + w) - x);
  return map.collides((int)x,(int)y,iWidth,iHeight);
}

public boolean collides ( final double x , final double y , final double w , final double h ) { if ( ( x < 0 ) || ( x + w > width ) ) { return true ; } if ( ( y < 0 ) || ( y + h > height ) ) { return true ; } int iHeight = ( int ) Math . ceil ( Math . ceil ( y + h ) - y ) ; int iWidth = ( int ) Math . ceil ( Math . ceil ( x + w ) - x ) ; return map . collides ( ( int ) x , ( int ) y , iWidth , iHeight ) ; }
check if a rectangle overlaps colliding areas .
