Skip navigation.

Benjamin Joffe

Colliding Discs

Sometimes it's fun to make little animations in JavaScript, especially when there's physics involved. The latest culmination of my interest in these two topics is Colliding Discs. What should I do with this... make a billiards widget? An incredible machine clone? Or something else?

Today I dream of home...Blue skies are the solution

Comments

EivindFS 16. May 2007, 22:45

Nice work. Add surface friction too, would be cool if they slowed down :-)

Helmers 5. July 2007, 09:42

They seem to slow down and speed up, how do you prevent them from all coming to a halt? :D

Benjamin Joffe 5. July 2007, 09:47

The system has zero energy loss because friction is not considered. The reason it appears to speed up and slow down is because if the large discs get some momentum then they will contain most of the collective energy but be moving slowly. If the tiny balls get knocked then they can go very fast without taking much energy from the system.

At any one point the sum of each ball's mass*velocity is constant.

FataL 17. November 2007, 06:25

You can create simple game from this neat demo probably in just 2-3 hours.
All you need is:
:idea: Add some kind of "cursor", that can be moved by mouse
:idea: Add timer
:idea: Every 3 minutes push new ball to an play arena

Player's mission is run away from balls as long as he can.

Profit! :D

It's a pity that you can't create global top scores board with Opera Widgets...

Write a comment

You must be logged in to write a comment. If you're not a registered member, please sign up.

Download Opera, the fastest and most secure browser
December 2009
M T W T F S S
November 2009January 2010
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31