Implementation of shadowcasting in Love2D.
Install love. Run love with the folder as the argument.
Left click to insert boxes, right click to insert lights. Press space to toggle gravity.
For each light source :
- Record the angle from light to each vertex of every box.
- Sort the above array.
- Iterate through the array, raycasting from the light source towards each angle, recording the hit positions.
- Draw triangles using above information.