Sure! Here's a simple text-based game implemented as a single HTML file using JavaScript. It simulates the scenario you described, where Spirit Halloween animatronics come to life and try to get you before midnight. Let's get started:
Spirit Halloween Game
Try to survive until midnight!
In this game, we have three animatronic images representing the Spirit Halloween animatronics. When the player clicks on any of the animatronic images, it triggers the `checkSurvival()` function. This function checks the current time and compares it to midnight. If the current time is greater than or equal to midnight, a "Congratulations!" alert is displayed, indicating that the player survived. If the current time is still before midnight, an "Oh no!" alert is displayed, indicating that the animatronics got the player before midnight.
Please note that you will need to replace the image file names (`emozi_bear.png`, `emozi_chicken.png`, `emozi_rabbit.png`) with actual image files you have or prefer to use.