Use W,A,S,D to move. Arrow Keys to Turn left and right. Look at Rays physics react to walls. I Recommend using TurboWarp: https://turbowarp.org/635452565?hqpen This Raycaster doesn't use and sprites collisions, it uses complicated math.
This project would not exist without this video: https://www.youtube.com/watch?v=TOEi6T2mtHo I have converted his script to scratch script.