# Help me with collision detection with screen walls

**URL:** <https://discourse.processing.org/t/help-me-with-collision-detection-with-screen-walls/24248>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [September 30, 2020, 6:46pm UTC](https://discourse.processing.org/t/help-me-with-collision-detection-with-screen-walls/24248 "2020-09-30T18:46:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [September 30, 2020, 7:30pm UTC](https://discourse.processing.org/t/help-me-with-collision-detection-with-screen-walls/24248/2 "2020-09-30T19:30:55Z")

</div>

you can check for the screen border with `if(x<size)............` and `if (x>width-size)................`

see [How do I get my shapes to move/animate around the canvas on p5.js?](https://discourse.processing.org/t/how-do-i-get-my-shapes-to-move-animate-around-the-canvas-on-p5-js/24233)

---

_[View the full topic](https://discourse.processing.org/t/help-me-with-collision-detection-with-screen-walls/24248)._
