Been doing some html5 canvas work. http://fiddle.jshell.net/tLpEV/5/show/
Will post it when I do partitioning :D
Be careful when you are making animations. Set interval is not advised simply because it doesnt actually run it at the time you want it to. If you use request animation frame (http://paulirish.com/2011/requestanimationframe-for-smart-animating/) and then tell your balls to move (milisecondsSinceLastFrame * velocityPerMilisecond) + this.velocity_x
This basically ensures if the starting conditions was the same it would look the same across all computers and platforms. Other than that nice work. Collisions are an absolute pain in the arse.
Here's something similar I did few months back, http://tennis.site40.net/scripts/js/bouncingBalls.html
It doesn't have collision detection. And the code sucks.
@Hawkee that code is at http://jsfiddle.net/tLpEV/5/
@[Plornt] will look into it, thanks
@Conscious EDIT: Just got what you are saying. I believe thats supposed to be position X. Cant remember my trail of thought. Sorry for late reply as I got no email notifications.
I don't understand why things like that fascinate me, I could sit watching for hours :D