This is a 4k js / canvas demo that I wrote for experimenting with a 2d context ( here is a video if your browser is down). I tested it only on chrome, opera, firefox, safari and a browser for the same browser.
Please note that external resources are not loading (i.e. texture and raytraced envmap are dynamically created), so this is just one stand-alone 4096-byte HTML file.
Can you do something similar with DIVs?
But I really agree that the game you linked to IMO with can also be played with DIV; apparently there are no transformations β not even in the falling scene of the daisy loading β and the action areas for the pirates are just circles. Not sure, but it may be that even shooting occurs only at fixed angles.
Instead, Canvas could be used to:
- Drawing common oblique lines and polygons (a map can be created dynamically from a compact description or can be created randomly). Shooting can be done at any angle ...
- Procedural image creation (for example, textures or special pixel effects)
- Gradients mapping texture
- General 2d matrix transformations
Of course, a game using the image + DIVs approach is probably easier to do (lots of photoshop and simple xy animation).
source share