add boundary checking for the player so that they can for the most part not go off the screen. It might be better to just have a tile map around the screen. Once in a blue moon the player will go off the screen slightly.