private void EndAnimation() { isAnimating = false; _animationPercent = 0; _puzzleAnimationDirection = Point.Zero; _puzzlePiecesMoving = Enumerable.Empty<PuzzlePiece>(); _moveIndex = _animationEndMoveIndex; _puzzleState = _moves[_moveIndex].PuzzleState; modelPosition = GetCenteringVector(_puzzleState); }
private Vector3 ToVector(Point point) { //const int cubeSize = 200; const int cubeSize = 2; return new Vector3(point.X, point.Y, point.Z) * cubeSize; }
private void SetupAnimation(PuzzleMove move, TimeSpan totalGameTime, int endMoveIndex) { isAnimating = true; _puzzleAnimationDirection = move.Direction; _puzzlePiecesMoving = move.MovingPieces; _animationPercent = 0; _animationStart = totalGameTime; _animationEnd = totalGameTime.Add(_animationLength); _animationStartModelPosition = GetCenteringVector(move.StartingState); var nonNormalizedEndPosition = move.GetEndingState(); _animationEndModelPosition = GetCenteringVector(nonNormalizedEndPosition); _animationEndMoveIndex = endMoveIndex; }