public void update() {

		// Moves character or scrolls background accordingly
		if (speedX < 0) {
			centerX += speedX;
		}
		if (speedX == 0 || speedX < 0) {
			bg1.setSpeedX(0);
			bg2.setSpeedX(0);
		}
		if (centerX <= 200 && speedX > 0) {
			centerX += speedX;
		}
		if (speedX > 0 && centerX > 200) {
			bg1.setSpeedX(-MOVESPEED / 5);
			bg2.setSpeedX(-MOVESPEED / 5);
		}

		// Updates Y position
		centerY += speedY;

		// Handles jumping
		speedY += 1;
	
		if (speedY > 3){
			jumped = true;
			
		}
		
		// Prevents going beyond coordinate of 0
		if (centerX + speedX <= 60) {
			centerX = 61;
		}
		
		rectBody.setRect(centerX - 34, centerY - 63	, 68, 63);
		rectLegs.setRect(rectBody.getX(), rectBody.getY() + 63, 68, 64);
		rectLeft.setRect(rectBody.getX() - 26, rectBody.getY()+32, 26, 20);
		rectRight.setRect(rectBody.getX() + 68, rectBody.getY()+32, 26, 20);		
		yellowRed.setRect(centerX - 110, centerY - 110, 180, 180);
		footleft.setRect(centerX - 50, centerY + 20, 50, 15);
		footright.setRect(centerX, centerY + 20, 50, 15);
	}