Conservation of Energy: The Bouncing Ball

A ball falls, hits the floor, loses some energy as sound and bounces back.

建立方法 JavaScript, HTML5, Canvas, 音频,

  • 161 次观看
  • 0 个评论


The ball, when dropped, hits the floor and makes sound. The loss of energy in the form of sound, determines the bouncing height. After a series of falls, the ball eventually comes to a halt as it loses all of its energy.
The animation is developed on HTML5 canvas, only using code; no external images are used.
The sound effect is created by a wave file.
It works perfectly well with all major browsers; the sound effect, however, may not work in IE and Safari.




下载源代码 4.93 KB · ZIP 格式

Browse the Source

此演示发布于 MPL/GPL/LGPL 授权之下。

Vivax-Solutions 的更多作品