A simple raycaster made in Vanilla JavaScript.
A player is put into a 2d map. The play sends out rays at a certain field of view. These rays then shoot forward until they hit a surface or until they hit a certain distance. Their distance is saved. A loop loops though all these distances and draws a line in the screen, a long line if the distance is small, and if the distance is big, it draws a smaller line.
Monday, February 28, 2022