Sure, here's a simple example of a text-based game implemented as a single HTML file using JavaScript:
To play the game, open this HTML file in a web browser (preferably on a smartphone for a better experience). You'll see a game grid represented by pictograms. Your character, depicted as a robot ("
🤖"), can be moved left and right using the arrow keys. Meanwhile, the enemy character, depicted as an alien ("
👾"), moves randomly. If the player character and the enemy character collide, it's game over and a "Game Over!" message is logged in the console.