UPDATE: There is a new and improved version. Check it out! https://scratch.mit.edu/projects/1235104801/ There is a weird bug. To avoid the bug, follow these steps: turn on full screen, turn on turbo mode (shift + click flag), press space, wait a second, press space again, and then turn off turbo mode. The bug causes the <touching ()?> block not work for some reason. I think it's a problem with Scratch. Press space to see it happen in slow motion! I made this and then realized that it does not improve performance very much when compared to a typical ray casting system. I'm sharing it anyways, just because it may be interesting. One idea for improvement is to make it start searching near where the last ray hit. This could reduce the total number of iterations needed to find the intersection.