Sure! Here's an example of a basic 3D racing game implemented as a single HTML file using JavaScript:
This simple game creates a canvas element and draws a red car and a blue obstacle. The player can control the car using the left and right arrow keys. The game loop continuously updates the canvas, moving the obstacle downwards and checking for collisions with the car. When a collision occurs, the game over function is called, and the player is prompted to try again.
Please note that this is just a basic example, and you can further enhance and customize the game as per your requirements.