Template for bouncing balls simulation.