Sure, here's an example of a simple text-based game where you can play as the hero and defeat the villains. The game will be implemented as a single HTML file with JavaScript code inside script tags:
In this game, the hero and the villain each start with 100 health points. You can click the "Attack" button to attack the villain, and the villain will attack back with a random amount of damage. The game continues until either the hero's health or villain's health reaches 0.
Keep in mind that this is a very basic implementation, and you can extend it with additional features, visuals, or improvements as per your requirements.