How do I fix this problem? (image in post)
I am currently trying out a bit of "ray tracing" by following this example, but I am stumped on a problem that I haven't been able to iron out.
Here's an image of the problem.
I've tried adjusting the angle that I use to find the vertices, I've tried using some maths to sorta extend the sides of the shadows so they meet, but I still end up with this problem to varying degrees. The only way I can fix it is by extending the walls to overlap in the room editor, but I would rather not have to do this (due to some walls being move-able, etc).
Thanks for your time!
Posted Aug 26, 2019, 12:30 AM UTC · edited
I would need to look at code to give a sure fix, but I might be able to provide a workaround without changing code. It appears you are using multiple square wall objects placed side-by-side to create your walls. Try using a single wall object and stretching it to the desired length of the wall. I think that will fix your shadow issue, but it will also stretch your wall texture. You could either make the wall objects invisible and use tiles to show the walls or create multiple wall objects of varying lengths to not have stretched wall sprites.
That does fix my shadow issue, but I'd rather not have to do that due to gameplay reasons (some walls are stand-alone/movable/etc). Thanks for the thought though!