We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I am new to processing and I have to submit an assignment regarding motion so I decided to do a moving umbrella under the rain... Now, what I would like and have no idea how to do is to check for collisions between each drop of rain against the umbrella so that they can bounce every time they hit it.
Here is my code
Answers
Please don't paste images of code. Are we meant to retype them I'm order to run them?
Read the collision detection faq in the "common questions" section of the forum.
You can format code by pasting it with a line of space above and below the code, select you code and hit ctrl+o or the "C" button in the toolbar.
How to edit your post and replace your images with the actual code (so that people can run it):
Advice on collision detection in Processing:
...specifically, modeling raindrop and umbrella as a point and a circle...
http://www.jeffreythompson.org/collision-detection/point-circle.php
...except add one extra condition -- that a collision must occur above a certain y-height (so the umbrella is a circle, but only the curved top edge of a cropped circle is drawn, and only that part counts for collisions).
@mcendon --
Also, if you want to use a library rather than developing your own raindrops and collision code from scratch, try installing Box2D through PDE and looking at some of the demos that involve falling objects:
Please don't forget to remove those images and instead, add your code and don't forget to format it to the forum's standards as mentioned in prev comments.
Kf