Sure, here's an example of a simple game in a single HTML file, written in JavaScript and enclosed in script tags:
This game creates a simple canvas where a blue rectangle (player) can be moved using the arrow keys. The game loop constantly updates the canvas to reflect the player's position.
Feel free to modify and add more features to make it a more complete game.