This is what I'm working on in my game. I want to have the player only able to see a square or so in front of them.
How I'm doing it is I just have a sprite that's all black except for the center, and I have it move along with the player's position. It works, until the sprite boundaries hit the window boundaries (since this sprite has to be rather large to stay black no matter where the player is on the map), and then the sprite doesn't display in this case.
This is all framed within the rest of the screen, so everything else is going on top of it to hide the edges of the "blackness."
I could only think of one option to fix this:
1) Make 4 differently shaped "blackness" sprites, and change between which is displayed depending on where the player is on the map (divide it into 4 quadrants). This way would work, but it would be a pain in the butt to do and take a long time to implement.
I wish there was some way I could just fill the map area of the screen with black, then remove a hole in the area of the sprite, and have that hole move around. Is there someway I can do that?
Or, is there a better way you think I could do this?
Thank you for your help.