Ejemplo n.º 1
0
        public async void AnimableMove(Point thicknessOld, Point thicknessNew, Piece toDestroy)
        {
            for (var i = 0; i <= 15; ++i)
            {
                var point = new Point((thicknessNew.X * i + thicknessOld.X * (15 - i)) / 15,
                                        (thicknessNew.Y * i + thicknessOld.Y * (15 - i)) / 15);

                Drawable.Margin = new Thickness(point.X, point.Y, 0, 0);
                if (IsKing)
                    KingImage.Margin = Drawable.Margin;

                await Task.Delay(250 / 15);

                if (i == 7 && toDestroy != null)
                    toDestroy.Destroy();
            }
        }