/* Shugo Tanaka
This program does a buncha fun awesomeness in a box!
int ballCount = 100;
float x = new float[ballCount];
float y = new float[ballCount];
float speed = new float[ballCount];
color ballColor = new color[ballCount];
float gravity = 0.1;
float dampening = -0.85;
int i = 0;
int ballNum = 0;
colorMode(RGB, 255, 255, 255, 255);
// Initializes array
for (i = 0; i<ballCount; i++)
y[i] += speed[i];
speed[i] += gravity;
if (y[i] >= height-5)
speed[i] *= dampening;
ellipse(x[i], y[i], 10, 10);
y[ballNum] = mouseY;
x[ballNum] = mouseX;
speed[ballNum] = 0;
c = color(random(255),random(255),random(255),random(75,100));
if (ballNum == (ballCount-1))
ballNum = 0;
ballNum = 0;
This sketch is running
as Java applet, exported from Processing.
Report for inappropriate content
Your have successfully reported the sketch. Thank you very much for helping to keep OpenProcessing clean and tidy :)
Make a Copyright Infringement claim
Draw a line to create a series of bouncing balls!
(Gravity code used from Daniel Shiffman in Learning Processing. Used for educational purposes only.)
To tweak this sketch, first download it.
Make your updates, then upload your tweak!
OpenProcessing is an online community platform devoted to sharing and discussing Processing sketches in a collaborative, open-source environment.
To contact, send an email to:
Follow OpenProcessing on Twitter!
Blog - Feedback forum
Sketches and source code of free membership users are licensed under CC and GNU GPL.
Plus+ member sketches may
include a different license.
Most icons by somerandomdude.
Syntax highlighting and Processing brush under LGPL 3.