Sure! Here's a simple example of a text-based rogue-like game implemented as a single HTML file using JavaScript:
In this example, the game starts by displaying an introduction message and then prompts the user to select their desired player class. Based on the user's input, the game assigns the chosen class to the `playerClass` variable and sets an initial health value for the player.
After the player class selection, the game starts the adventure by displaying a message. You can add your own game mechanics and further develop the game logic within the `startAdventure()` function.
Please note that the provided example is just a starting point, and you can expand upon it to create a more complex and engaging rogue-like game.