Closed avose closed 10 years ago
The nice thing about svg over canvas is that there's no need to redraw. Removing that redraw loop and making it completely event driven ought to make things perform beautifully. The downside is that as the board fills up we could reach a point where performance begins to suffer due to too many entities. If that happens, we'll need to consider switching to canvas, which doesn't have the benefit of the Dom.
"Removing that redraw loop and making it completely event driven ought to make things perform beautifully." --- Yes, I agree. We should only have a loop for animation, when such is active. The rest should be event driven.
I added animations for flipping and tapping, just as an example of one way to do this. Things should still be made to be event driven when no animations are active, however....
Really, the animation issue is separate from the frame pushing/update issue. I'm closing this and making a new feature entry for the event-driven frame updates.
There is some code in place for some animation, but it's all disconnected and a mess. I think there is even a forced "redraw" every 100ms now. I suppose the forced redraw can stay for a while, it just eats cycles. However, the tap and flip actions could/should have an animation to them. It wouldn't kill us to support this is a minor/simple way.