# Picture is flickering when collision checked

**URL:** <https://discourse.processing.org/t/picture-is-flickering-when-collision-checked/12414>\
**Category:** Coding Questions\
**Created:** [June 30, 2019, 8:56pm UTC](https://discourse.processing.org/t/picture-is-flickering-when-collision-checked/12414 "2019-06-30T20:56:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SunnyPlayz](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@SunnyPlayz](https://discourse.processing.org/u/SunnyPlayz)\
**Post date:** [June 30, 2019, 8:56pm UTC](https://discourse.processing.org/t/picture-is-flickering-when-collision-checked/12414/1 "2019-06-30T20:56:41Z")

</div>

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?

```auto
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;
}

```

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [July 1, 2019, 12:21am UTC](https://discourse.processing.org/t/picture-is-flickering-when-collision-checked/12414/2 "2019-07-01T00:21:42Z")

</div>

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 ?
