Sure! Here's an example of a simple 2D racing game implemented in a single HTML file using JavaScript. The game will simulate a car racing through a track with arrow keys to control the car's movement.
Feel free to run this code in your browser and you will see a simple 2D racing game where you can control a car using the left and right arrow keys. The game will run in a loop, continually updating and rendering the game state. The car is represented by a white rectangle, and the track is drawn using rectangular shapes.