Sure! Here's an example of a simple game where the player controls a character named Billy who finds weapons and fights enemies:
In this game, Billy starts with his fists as his weapon. The player can choose to attack an enemy or equip a new weapon by entering the corresponding action number. The enemy's health decreases with each attack, and once an enemy's health reaches zero, they are defeated and removed from the game. The game continues until all enemies are defeated. The current status of the player and enemies is displayed in the console.
Note: To play the game, you can copy the provided code into an HTML file, open it in a web browser, and check the browser console for the game output.