Tutorial on how to detect a collision between your sprite while it is moving and an object in front of it. Try switching the background between the version with and without a wall to see the difference.