Sure! Here's an example of a simple 2D horror game implemented as a single HTML file using JavaScript. Please keep in mind that this is just a basic example to give you an idea of how to structure a game. You can further enhance and expand upon it according to your preferences.
In this game, you control a player represented by a filled square using arrow keys. The objective is to avoid the monster represented by a red filled square which initially appears at the bottom-right corner of the canvas. If the player collides with the monster, a game over message pops up.
Please note that this is just a basic implementation. You can enhance the gameplay, graphics, and mechanics according to your preferences and game design.