Question
What are the advantages/disadvantages of Canvas vs. DOM in JavaScript game development?
What are advantages and disadvantages of creating games in 'pure' DOM as compared to using canvas?
45 26660
45
Question
What are advantages and disadvantages of creating games in 'pure' DOM as compared to using canvas?
Solution
canvas pros :
cons:
DOM pros:
cons:
Solution
When you develop with Canvas you will have to use the GameLoop technique which is very painful because you will have to redraw all elements all the time.
When you develop with DOM you will be able to redraw only the objects that have been modified and will leave the hard work for the browser implementation.
If your game has a few modifications per frame then you can use the DOM, otherwise use the Canvas, please! It is so much faster!