Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Ghouls should work like this. 

When you enter a cave, a hidden variable will start increasing by 1 every ten seconds. Once it reaches certain number, a ghoul will spawn. You will hear a sound to signalise that.

Ghouls are very slow, but they always know where you are and they will follow you untill you leave the area. Once they get close to you (about three tiles), they make a sound and start sprinting. Killing the ghoul makes it dissapear from that area, but entering it again will make him appear once more. 

When you sleep  or work, the variable resets and you can enter the caves again without ghouls appearing instantly. Each cave area also needs different value for that variable to spawn ghouls. Outer caves, like the beach cave or the rope cave spawn ghouls after about 100 seconds. Deeper cave, like the one with the bloodstone spawns one after about 50.

Bear in mind that this variable counts for all caves at once. If you spend 100 seconds in the beach cave, the ghoul will spawn. If you kill it and go to another cave right away, the ghoul in that cave will spawn instantly because you spent 100 seconds in the caves in total. Doesn't matter which one.