acmpesuecc / boomcaster

A simple doom-esque game built with pygame and a custom coded raycaster
0 stars 16 forks source link

Optimize raycasting performance by pre-calculating trigonometric values #6

Closed kevalpattani closed 6 days ago

kevalpattani commented 1 week ago

This pull request optimizes the raycasting system by reducing the computational overhead associated with trigonometric calculations. The primary change involves pre-calculating sine and cosine values for a range of angles used in the raycasting process. This eliminates the need to repeatedly compute these values during the main game loop, resulting in a significant performance improvement.

Additionally, the code includes a new set of unit tests to ensure the correctness and robustness of the raycasting functionality. These tests cover various aspects of the raycasting calculations, such as ray direction, wall collisions, ray length, wall hit angles, projected heights, and lighting colors. #2

bunsamosa-bot[bot] commented 1 week ago

Thank you from Opening this Pull Request, @kevalpattani ! A Maintainer will review it soon!

Icarus131 commented 6 days ago

Does not run! Closing PR.