Mozilla Demo Studio

  • 送出一個 Demo

Ball Pit

Balls bouncing around on a two-dimensional plane

建立方法 Web Workers, Canvas,

  • 177 個檢視數
  • 0 條回應

作者所寫的更多關於此 Demo 的資訊

This demo demonstrates one very basic way that web workers can be used for simulating physics.

Use tips:try adding 10-100 at a time by entering the number of balls you want to add in the textbox at the top, then click "Add". Also: try resizing the window or zooming in/out.

This demo uses a worker to track ball location and a worker nested in the worker that tracks ball location to detect collisions (for this reason, my demo will not work in chrome/webkit - see:http://code.google.com/p/chromium/issues/detail?id=31666).

還沒有回應

註冊登入 以新增您的回應。

取得原始碼

下載原始碼 10.63 KB · ZIP 格式

此 demo 係以 GPL 條款進行授權。