public void update(){
		if(right){
			x+=10;
		}
		if(left){
			x-=10;
		}
		if(up){
			speed-=2;
		}
		if(down){
			speed+=2;
		}
		if(speed>0){
			speed=0;
		}
		if(speed<-maxSpeed){
			speed=-maxSpeed;
		
		}
		if(x<40){
			x=40;
		}
		if(x>520){
			x=520;
		}
	}