Sure! Here's an example of a simple horror game implemented as a single HTML file using JavaScript:
This game sets up a simple scenario where the player (represented by a red square) needs to avoid a ghost (represented by a white square). The player can control their character using arrow keys, and if the player collides with the ghost, a "Game Over!" alert is shown. The game runs in a continuous loop using the `requestAnimationFrame` method.
Please note that this is a very basic example and can be expanded upon to create a more complex horror game.