Sure! Here's an example of how you could create a simplified text-based game inspired by Five Nights at Freddy's (Fnaf) using JavaScript within a single HTML file:
Fnaf Game
Press any key to start the game!
This is a simple game where the player has four possible actions: hiding in the office, checking the cameras, winding up the music box, or exiting the game. The game continues until the player chooses to exit. At the end, a specific ending message is shown based on the player's choices during the game.
Please note that this is a simplified example and doesn't include complex game mechanics or graphics like the actual Fnaf game.