public void setPosition(int x){
		System.out.println(time);
		if(x < startX){
			x = startX;
		}else if(x > startX + distance){
			x = startX + distance;
		}
		rect.x = x;
		
		this.time = (x - startX) * endTime / distance;
		System.out.println(time);
	}