This isn't really an SFML question, more of an algorithm/physics one. I'm wondering how I would be able to make a 'field of view' for a top down player. More specifically, This is how I think I would do it:
- Draw aseries of lines between two angles on each side of the player until it hits a solid object
- Change the colour of/brighten everything between these lines(like a flashlight)
The problem with the above is:
I don't know how I would get all the pixels between the lines, and I'm not sure how I would draw a lines that are stopped when it hits a pixel which is 'solid'(Or how I would add this property to all the pixels).
A baldy drawn example of the effect I'm trying to achive here:
http://imgur.com/a/9NDBqAny help