Picture is flickering when collision checked

Hi, I have made it check for collision and the code works but it makes all the image flicker when it runs. Do i need to change the collision checker to not make images flicker?

boolean checkCollision(int bLeft, int bRight, int aX, int aY)
{      //Has to be touching the apple and is in the middle of the basket
    if(aY > 499 && aX < bRight && aX > bLeft)
      return true;
    return false;
}
1 Like

i would think it is not this shown collision logic,
more the program flow where you use that!
like:
in cases where you have a rebounce problem?
what you ( want ) do if aY >= 500 ?

1 Like