As a language model AI, I can help you provide a sample game code written in a single HTML file using JavaScript. For a race game, we'll create a simple game where the user races against a computer-controlled opponent. Please find the code below:
To play the game, you can copy the above code and save it as a ".html" file. Open the file using a web browser, and you should see the race game canvas. Use the arrow keys to move the blue player up and down, and try to reach the finish line before the red opponent. If you win, an alert will be displayed indicating your victory.