I had a lot of fun with this game. I know it's been a while since you made it, but I would like to know how it works. Unfortunately, I don't know lua, but if you could tell me the basic formula, or point me to a tutorial, I would be very thankful.
Hi! This response has been a long time coming.
You can access the source code here: https://www.lexaloffle.com/bbs/?tid=32397. Unfortunately, I made my own method for this, and it is pretty hard to follow.
If I come up with a cleaner way to make these visuals, I will probably make a notice/post on this game, so stay tuned here. Otherwise, I recommend reading up on "raycasters," which can give you a very similar effect: https://lodev.org/cgtutor/raycasting.html