+ animating = true;
+ update();
+
+ if (boxMoving)
+ {
+ movingBoxPositionX = gameBoard->playerX + (int)deltaX;
+ movingBoxPositionY = gameBoard->playerY + (int)deltaY;
+ bx += deltaX * (float)maxLength;
+ by += deltaY * (float)maxLength;
+ }
+
+ int steps = 15;
+ float stepSize = (float)maxLength / (float)steps;
+ deltaX *= stepSize, deltaY *= stepSize;
+
+ for(int i=0; i<steps; i++)
+ {
+ px += deltaX;
+ py += deltaY;
+ playerX = (int)px;
+ playerY = (int)py;
+ bx += deltaX;
+ by += deltaY;
+ boxX = (int)bx;
+ boxY = (int)by;
+ repaint();
+ Pause(3);
+ }
+
+ animating = boxMoving = false;
+