Instead of updating the canvas directly on every photon event (collision, expire, ...) we should update an internal state, and let that internal state refresh the view every fixed time interval.
The HTML canvas context help said that it's good to batch canvas draw calls, so this will accomplish that goal & probably help a lot with performance.
Instead of updating the canvas directly on every photon event (collision, expire, ...) we should update an internal state, and let that internal state refresh the view every fixed time interval.
The HTML canvas context help said that it's good to batch canvas draw calls, so this will accomplish that goal & probably help a lot with performance.