Bouncy Balls

To add random balls hit +/-. Otherwise use the mouse. All user actions are
displayed in the console. Most involve holding a key down and then using the arrow keys.
Selecting balls with the mouse works as follows

IF PAUSED
  • click and release to select a ball
    • spawns a new ball if clicked on background
  • move mouse to move ball around
  • hold shift to update ball velocity
    • hold option to snap
    • deselects ball upon release
  • click again to deselect ball

IF RUNNING
  • click and drag to select a ball and move it around
    • spawns a new ball if clicked on background

Hit the "Source" button to edit and run your own version of the code.
The values shown in console are all editable at the top of the file.
Any changes will be reset upon page refresh.

Source