Here is an example of a simple game implemented in a single HTML file using JavaScript:
This code sets up a simple game where the player can move a blue square left and right using arrow keys. The game loop continuously updates the player's position and redraws the canvas. You can add more features to this game such as obstacles, scoring, or levels to make it more engaging.