Sure! Here's a simple example of a text-based game using JavaScript that meets your requirements:
This game follows a simple concept where the player, represented as a little kid in a barrel, goes on quests to gain experience and defeat bosses. The player is prompted to enter their name and then the game begins. The player's level and experience are tracked throughout the game. Quests and boss fights are randomly generated, and the player gains experience based on quest difficulty and result. If the player's level is a multiple of 5, they will encounter a boss fight. If the player defeats the boss, they gain a level. If the player loses the boss fight, the game restarts.