2D Ray Casting made to practice C++.
Other rendering modes are available using the 1, 2, 3, and 4 keys. Mode 1 is the final result of casting rays to endpoints and using a triangle fan to fill the light. Mode 2 is the rays cast to the endpoints before the triangle fan fill. Mode 4 shows rays cast at specified angles, and mode 3 is a triangle fan fill using these rays. Modes 3 and 4 represent a more naive attempt at light fill.
The rendering of the boundaries can be toggled using the B key.
The Space key toggles whether the casters follow the mouse.
Based on Daniel Shiffman's P5.js Ray Casting 2D