Sure, here's an example of a simple text-based game implemented as a single HTML file using JavaScript:
This game simulates a basic life simulator where you can choose actions to eat, party, or sleep. Each action affects your health, happiness, and energy levels. If your health reaches 0, it's game over and you can choose to play again. The game interface is displayed using HTML elements and the JavaScript code handles the game logic and updates the UI.