This is a tutorial for getting a sprite to move, and making sure it does not go through walls. Download this, and read the comments to find out how it works. You can attach these scripts to a sprite in your own project with top-down movement. Just make sure to change the color sensing accordingly.