CodeBounce Applet

CodeBounce is a small screen-saver-like Java applet, in which number of (rubber?) balls of different sizes and velocities (but identical masses, I think -- it has been a while since it was written) are bouncing in the applet window. Trajectories are calculated using just basic simple Newtonian physics (and assumption on kinetic-preserving collisions); all of which is just to make it look like we have a few elastic rubber balls bouncing around.

Look here to see an example with 20 balls (wonder why I didn't make it easier to change number of balls? it should be easy).


Java code is licensed under plain old BSD license. Share and Enjoy. Author does not mind contributions to the code base.

Downloadable artifacts are:

Notes of historical interest

This simple applet was originally written in late 1999 or early 2000 as a tiny fun side project, when I was about leave my job at Quark. This was at the end of development cycle for Quark's flagship product, Quark XPress, version 5.0.

In addition to fun of it, applet was to be used to verify that such kinetic simulation works nicely for producing simple but pleasing effects -- idea was to use it as a proof-of-concept for an Easter Egg to be released with 5.0. That's not quite how things happened: in the end, Easter Eggs were indeed written (and shipped up until, I have heard, version 5.1), but they used even simpler effects, mostly due to time constraints and my limited command of intersection Windows / MacOS core graphics libraries. None of the code would have been used directly anyway as XPress did not use Java back then.

The name of the applet is an inside play on the term used for code reviews back then ("code bouncing")

Back to Hatchery page.