An easy way to make sprites collide with walls. Useful for mazes
You can use this code for your own games