Here is an example of a simple game implemented in a single HTML file with JavaScript:
This code creates a simple game where the player can move left and right to dodge enemies and shoot projectiles. The player can score by hitting enemies with projectiles. The game ends if an enemy reaches the bottom of the screen.