this is my code.
boolean checkHit2() {
if (cx < 0 || cx >= 640) {return true;}
if (cy < ground[(int)cx]) {return false;}
if (cx < blue +
This line:
if (cx < blue + 15 && cx > blue - 15){
Should be changed to
if((cx < (blue + 15)) && (cx > (blue -15))){
but I think you should move the comparation out like:
int bluePlus = blue + 15;
int blueMinus = blue - 15;
if(cx < bluePlus && cx > blueMinus){
EDIT: The error means that you miss to return boolean after all. After the if
if(cx < bluePlus && cx > blueMinus){
then you need to add return to the result. Please ignore the first comment.