Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+1)

I can give you the project files if you want.

But in short, I use two additional viewports. The first one is just a black screen, where I draw white circles on whenever a pellet "pops". The circles radius is tweened, so it isn't revealed all at once. The second viewport just contains a copy of the dark tilemap with a different tileset and the background. I then use the texture of the second viewport as a sprite, which I put between the player character and the dark map . The texture of the first viewport with the white circles is then applied to the second viewport as a mask with a shader, showing only pixels where the texture of the first viewport is white.

It's really complicated and inefficient, though. There are probably a dozen easier and less resource hungry methods to do something like this.

(+1)

Wow! Thank you for such a detailed explanation! (I have no idea what the viewports are, but you made me understand now, thanks.)

Since the game was running fine on HTML5, I do not worry about how hungry it came out as hehehe