function SmoothMovement(C,B,A){C=Math.round(C);B=Math.round(B);A=(A?Math.round(A):0);this.updatePosition=function(){C+=A;if(A<0){if(C-A*(A-1)/2<B){A++}else{if(C-(A-1)*(A-2)/2>=B){A--}}}else{if(C+A*(A+1)/2>B){A--}else{if(C+(A+1)*(A+2)/2<=B){A++}}}return C};this.changeTarget=function(D){B=Math.round(D)};this.getPosition=function(){return C};this.getVelocity=function(){return A};this.hasStopped=function(){return(C==B&&A==0)}};