While googling about how to do lighting and shadows in a 2D game, I stumbled upon this great blog post from the devs of "Graveyard Keeper", I highly recommend the reading: https://www.gamedeveloper.com/programming/graveyard-keeper-how-the-graphics-effects-are-made