In one of my classes we are doing Scrolling backgrounds and general sprite movement stuff. Up until now everything has worked properly, however when I put in a jump feature, it seems to cause problems when the player jumps. Before jumping, the player will be confined within the sides of the screen when moving left/right, however after the player jumps, the confines of the screen seem to break and the player moves at a higher pace than they are supposed to when moving side to side.
The code is attached to this post.
Any help would be appreciated,