# Balls

<COMMENT> </COMMENT>

This applet demonstrates some simple concurrent animation. Each ball is a process writing to its own slot of a shared display channel (`jcsp.awt.DisplayList)`, whose other end is serviced by a `jcsp.awt.ActiveCanvas`. There are no GUI controls, but the number of balls in the display is specified by the applet balls parameter and their speed (movements per second) by speed. Each ball has its own (random) colour, starting position, size and initial direction vector.

Useful extensions to this applet would be: GUI controls for adjusting temperature (i.e. speed) and displaying pressure (i.e. bounces per second off the walls), changing the size of the containment canvas, zapping existing balls and adding new ones, varying the mass and size of the balls, freezing and resuming the animation, collision detection and bouncing, adding resistance to motion and gravity, ...