public boolean checkCollision(GameComponent c, float changeX, float changeY) {

        boolean checkx = ((c.getX() + changeX >= getX()) && (c.getX() + changeX <= getX() + getWidth())) || ((c.getX() + changeX + c.getWidth() >= getX()) && (c.getX() + changeX + c.getWidth() <= getX() + getWidth()));
        boolean checky = ((c.getY() + changeY >= getY()) && (c.getY() + changeY <= getY() + getHeight())) || ((c.getY() + changeY + c.getHeight() >= getY()) && (c.getY() + changeY + c.getHeight() <= getY() + getHeight()));
        if (checkx == true && checky == true) {
            return true;
        } else {
            return false;
        }
    }