How to make a wall?

And if the sprite is touching the wall, we don't want to keep the sprite there.