Sure! Here's a simple text-based game that meets your requirements:
This HTML file contains JavaScript code enclosed in `
` tags. When you open the HTML file in a web browser, it will display a series of alerts as the game progresses. You can interact with the game by typing any input in the prompts, and various outcomes will occur based on your actions.
In this game, the main objective is to find the yellow key and escape the house before the monster catches you. The user is allowed to type anything to make things happen. The game loop continues until the player either escapes or runs out of steps.
Please note that playing this game on a smartphone may require adjusting the prompt/alert behavior for better user experience.