this is a simple casting engine, this example of it makes shadows from the mouse cursor. You can make this into a good recreation of the early id software build engine by adding a 3d space (2nd 3d griffpatch tutorial) and adding texture scanning.
note -- https://scratch.mit.edu/projects/1256773296 is a much higher quality version of this note -- also a good way to see how weird the mouse hitbox is