Crossy Road.gitlab ❲Direct Link❳

function update() { // Move obstacles, check collisions if (checkCollision(player, obstacles)) { resetGame(); } draw(); requestAnimationFrame(update); }

Full source available in the repository. Run the game manually, or use a simple headless test: