We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Need help! (Read 627 times)
Need help!
Dec 5th, 2006, 3:54am
 
i know i know. its going to be a stupid question. but i'm tired and i don't know how to do it. i'm VERY new to all this code and such.

wondering how, if using this program:
http://www.processing.org/learning/examples/simpleparticlesystem.html

how to make the balls land on the bottom, and then drag the mouse through to swish them around.

just a starting point would be nice. i'm not asking anyone to write it for me. i'm just so confused.

-kristina.
Re: Need help!
Reply #1 - Dec 5th, 2006, 10:51am
 
A good starting point would be to edit the Particle update() method, to change the y-part of the particle velocity when it gets to the bottom of the screen, which will give the effect of it bouncing.

To get the mouse interaction, you'll have to add some code which pretends that the mouse pointer emits a force that reples the particles, so work out the distance to the mouse pointer, and add some velocity away from the mouse depending on the distance.
Page Index Toggle Pages: 1