Interactive JavaScript project

Lane Racer

Turn discrete input into lane changes and collision rules.

Use Left/Right or A/D while the game has focus, swipe, or press the movement buttons. Each press changes one lane. Avoid rectangular barriers and collect round coins. Progress combines distance and coin bonuses; reach the target before losing three lives.

Use a browser that supports Canvas to run this example.

Build this project

Writing a Simple Game Loop with requestAnimationFrame — the shared scheduler used by this project.

Read and run the source

The engine lives in assets/js/engines/racer.js. The download includes a runnable local page, shared scheduler, and browser controls.

Source is provided for inspection and local learning. See Terms for reuse permissions.