This is just a very basic horror game. You can add many more features, such as:
Different types of enemies with different abilities. Environmental hazards, such as traps and darkness. A storyline and puzzles. Different game modes, such as a campaign mode and a survival mode. Coding a complex horror game is a very challenging task, but it is also very rewarding. If you are interested in developing horror games, I encourage you to do your research and learn from the best. There are many resources available online and in libraries.
Here are some additional tips:
Create a sense of atmosphere. This can be done through the use of dark lighting, eerie sound effects, and disturbing imagery. Use suspense to build tension. This can be done by placing the player in dangerous situations and slowly revealing the horrors that await them. Give the player a sense of vulnerability. This can be done by making the player character weak and defenseless. Play with the player's expectations. This can be done by subverting the player's expectations and creating a sense of unease. Coding a complex horror game is a challenging task, but it is also very rewarding. With hard work and dedication, you can create a game that will terrify players and leave them wanting more.