Prevent the sprites from going out of the screen