Hello,
I'm working on a tile based engine in HTML5+canvas.
I currently made every single tile in the world its own little canvas. The reason is, I make two canvases per tile, and depending on state display one of the other. This allows fast switching between the two with style.display.visiblity.
However, while that actual showing and swapping visibility goes fast, what goes slow is creating them at the start of the game, in Firefox at least. In Chrome, this all goes super fast. In firefox, simply creating a couple of thousand canvases, especially calling getContext('2d') on each of them, goes super slow.
Is there any alternative better way to have a 2D tile based engine where each tile can efficiently swap between two different graphics?
Thanks!