Why does this raycaster slow down whenever the player is near a wall?
I am writing a 2.5d game and I have noticed that whenever I am up close to and facing a wall, the game slows down tremendously. This was exacerbated when I added in textures. I am using an inefficient rendering method and have researched how to improve it, so this question is not about how to make it faster in general. My original thought was that it was simply because there was more on the screen. This was partially correct, however I made sure that the renderer would clip off anything not on the screen. I also added a check to see how many pixels (rectangles) were being drawn per frame. When I did this, I noticed I would still get slower and slower as I got closer and closer, even with the rectangle count being the exact same. Why is this code slowing down even when drawing the same amount of rectangles?