I'm making a small horror game, and the main mechanic is to run to a hallway, and then hide behind your hands. Unfortunately, after hours and hours of working on it, I can't get this simple mechanic to function. If anybody would be willing to help me, here is the game so far https://www.dropbox.com/s/3ltateuu120s6j0/fnaf5.capx?dl=0
The goal is to, when the scrape sound is heard (which is random as to whether it will play), or in this case the visual cues for when the scrape sound might play are on screen when the orange box hits the first bumper, you must run to the hall, and within the span of 7 seconds you must hide with space for 3 straight seconds, preventing being jumpscared.
I know it's a lot to ask, but this is the first and last time I will ever post something like this. Thanks to anyone who can help!
Develop games in your browser. Powerful, performant & highly capable.
trigger when player gets to the hallway,
subevent Every 1 second , add 1 to "hiding timer"
on trigger that initiates the scrape sound -> play scrape sound
subevent Every 1 second, add 1 to "hall timer"
if halltimer = 7 and player.hiding = 0 and hiding timer < 3 -> do game over
upon exiting the hallway, set hiding timer and hallway timer to 0
also when they stop hiding, set the hiding timer to 0 as well