Prevent the player from moving outside the screen