Hacker News new | ask | show | jobs
by peey 967 days ago
That's incredibly concise. I see you're perturbing vx and vy randomly and updating location accordingly on every frame. Is the perturbation also per-frame or is that block of code just executed once? Is randomf a floating-point number between 0 and 1?
1 comments

After all, there are 6000 particles in total. Their positions are updated depending on the speed at every frame. Also the speed of each particle changes because of the gravity. Only the oldest about 30 particles, which have already fallen down, are shot away again from the position (50,0), whereby the position and the velocity vary slightly. Yes, randomf returns a value between 0 and 1.