pixel-perfect collision detection in canvas-based html5 games