Ah ya i can think of about 3 ways to do it and none of them are easy and the cpu way might actually be less work then the rendertarget way.
The problem here is that…
In 3d you use the whole screen or in this case a rendertarget to track depth.
In 2d this is actually kind of a pain to make a depth buffer.
So the first way im thinking is cpu side with a single set data call and use a array over and over.
But like this is something id rather not even try to explain.
The second way would be a special shader a render target and involve repeatedly sending in the render target and reading it while doing fake rendering of a quad and it too would be hell to explain.
The third way and this is kinda weak to be honest.
Is some work as well. It involves not using sprite batch basically or only partially and a custom shader + a rendertarget.
This idea is as follows.
Creating a list of quads to do all the shadowing by finding edges of the rectangle polygons you would draw in your scene.
Via extending them in a pair of lines to the edge of the screen based on the player position, in order to build up a polygon list of darkened areas.
You would then make a render target.
Render this polygon list to it were it just sets a value to say red as 1.
This is then basically a stencil or shadow buffer.
Send that render target back in and draw all your regular map but read the render target with a shader that looks for those red values on it.
If it has a red value of 1 then replace the regular scene drawing color with black.
You could optimize it a bit by saying If all the points of a rectangle aren’t in the current viewing area that you are doing now. You can skip as you already know how to darken that part.
This one would be a bit of work and i don’t think i have time to tackle that.
Edit humm now that i think about it i think someone else did it like this and it probably is the best way.
You could maybe just draw all your scene slightly lifted off the map and with a actual 3d light just slightly higher than that to spread a actual 3d stencil shadow across the screen. Again lot of work though.
Unless someone else can come up with something simpler that’s all i can think of right now.