Html5 Canvas Vs Svg. So it can be printed with high quality at any resolution. Canvas gives better performance with smaller surface or larger number of objects.
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.
There are excellent gaming libraries for canvas impactjs is one of them. Canvas has poor scalability. So it can be printed with high quality at any resolution. Event modeluser interaction is granular xy Performance is better with smaller surface a larger number of objects 10k or both.