The mechanics are simple: close the door when you see someone.
I got inspired from Five Nights at Taylet's and Five Nights at Sonic's. Scott Cawthon is the creator of FNaF