w to move forward s to move backward a to turn left d to turn right
i made this in about 30 minutes, so it's not optimized. any variables with the prefix "user_" are for moving and turning and stuff, whereas "ray" and "ray dist" are actually the ones responsible for calculating and drawing. feel free to take this code any make it better in a remix :) i saw one of my friends watching a tutorial of how to make this, and i kind of understood what the person was saying so i tried making my own. credit to griffpatch i think the coloring is based on depth. also, you are bounded to scratch's 480x360 canvas, so you can't move too far. try walking through a wall and turning around to test this.