# HELP! p5.js Rect - Rect Collions other!

**URL:** <https://discourse.processing.org/t/help-p5-js-rect-rect-collions-other/27771>\
**Category:** Coding Questions\
**Tags:** homework\
**Created:** [February 12, 2021, 7:14pm UTC](https://discourse.processing.org/t/help-p5-js-rect-rect-collions-other/27771 "2021-02-12T19:14:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zwaan69](https://avatars.discourse-cdn.com/v4/letter/z/22d042/32.png) [@Zwaan69](https://discourse.processing.org/u/Zwaan69)\
**Post date:** [February 12, 2021, 7:14pm UTC](https://discourse.processing.org/t/help-p5-js-rect-rect-collions-other/27771/1 "2021-02-12T19:14:55Z")

</div>

Hi, I have 2 questions that I love to have for making my own fun games like the helicopter.

see picture…

1. Small rectangle to right bosting with large rectangle, but small rect does not stand through, how?  
stuck just like the wall you can’t walk through. stand still. with function Array / object does not work with x = x \* -1 (sometimes it does, but weird x will go through by itself, I don’t want that)

2. Padle on the top of the head like, cannot go down  
but bottom must hit.

How can I get code?  
I spent so many weeks searching. what I want.

Please help ME.

Please code example:

hit = Rectcheck (x1, y1, this.x, this.y, this.w, this.h)  
function Rectcheck (x, y, w, h, x1, y1, w1, h1){  
here code foto 1 or 2  
}  
 ![p5_1](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/6848f60275b68e214d39b94d934c2f401fdc85c7.jpeg)

---

<div class="post-metadata">

**Author:** ![ReyzArtz](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/reyzartz/32/11750_2.png) [@ReyzArtz](https://discourse.processing.org/u/ReyzArtz)\
**Post date:** [February 14, 2021, 3:01pm UTC](https://discourse.processing.org/t/help-p5-js-rect-rect-collions-other/27771/2 "2021-02-14T15:01:19Z")

</div>

if u r trying to make a physics collision system of rectangles  
this video might be of some help

[![](https://img.youtube.com/vi/JV5XBmaQdIA/maxresdefault.jpg "How to create collisions, walls, and barriers in the P5.js programming language") ](https://www.youtube.com/watch?v=JV5XBmaQdIA)
