Javascript Canvas Vs Svg. Canvas draws 2D graphics on the fly with a JavaScript. 4 At first glance SVG seems like a strong contender.

Snake and Pacman would be better suited for canvas you control everything with your keyboard and painting to canvas is less expensive than moving elements around in SVG. Vector based composed of shapes Raster based composed of pixel Multiple graphical elements which become the part of the pages DOM tree. Grab your interactive glossy buttons.
Vector based composed of shapes Raster based composed of pixel Multiple graphical elements which become the part of the pages DOM tree.
Hence it is not suitable for printing on higher resolution. Canvas rendering performance seems to degrade linearly in the number of pixels in the canvas area. For instance a Canvas-based game could implement sprites from SVG images generated by a vector editing program to take advantage of the scalability and reduced download size compared. Var ctx new C2S500500.