Look inside for instructions and how it works. Use arrow keys to move. For wall detection, you can use a color sensing block if all your walls are the same color, or you can use the cloning method to create walls.
Thanks to @mathmathmath for the original engine. You can check that out here. https://scratch.mit.edu/projects/138291962/