public boolean colide(Feature feature) { return CollisionDetector.collideRectRect(x, y, width, height, feature.x, feature.y, feature.width, feature.height); }
/** * @param bx * @param by * @param bw * @param bh * @return */ public boolean collideRectRect(int bx, int by, int bw, int bh) { return CollisionDetector.collideRectRect(getX(), getY(), getW(), getH(), bx, by, bw, bh); }
public boolean collide(Layer b) { if (getAngle() == 0 && b.getAngle() == 0) { return CollisionDetector.collideRectRect(getX(), getY(), getW(), getH(), b.getX(), b.getY(), b.getW(), b.getH()); } else { return CollisionDetector.collidePolygon(getX(), getY(), getW(), getH(), getAngle(), b.getX(), b.getY(), b.getW(), b.getH(), b.getAngle()); } } }