Ejemplo n.º 1
0
        private void EndAnimation()
        {
            var animation = new MoveTo2DGameAction(this.text, new Vector2(700, -700), TimeSpan.FromMilliseconds(500f), EaseFunction.BackInEase, true)
                            .ContinueWith(
                this.CreateParallelGameActions(
                    new FloatAnimationGameAction(this.background, 1.0f, 0.0f, TimeSpan.FromMilliseconds(2000), EaseFunction.CircleInOutEase, (v) => { backgroundTransform.Opacity = v; }),
                    new FloatAnimationGameAction(this.tower, 1.0f, 0.0f, TimeSpan.FromMilliseconds(500), EaseFunction.CircleInEase, (v) => { towerTransform.Opacity = v; }),
                    new MoveTo2DGameAction(this.tower, new Vector2(0.0f, 500.0f), TimeSpan.FromMilliseconds(500), EaseFunction.CircleInEase, true)
                    )
                .WaitAll()
                );

            animation.Completed += this.AnimationCompleted;
            animation.Run();
        }
Ejemplo n.º 2
0
        public override void WriteSyncData(OutgoingMessage writer)
        {
            if (wo.GetAction() == ActionEnum.Move)
            {
                this.lastNextTile = move.nextTile;
            }
            else if (wo.GetAction() == ActionEnum.Switch)
            {
                this.lastNextTile = sb.otherTile;
            }
            else
            {
                this.lastNextTile = ee.nextTile;
            }
            //send action state as it is not synchro yet in the client(for speed purposes)
            //we should be passing speed instead but messages cannot send double numeric variables.
            writer.Write((int)wo.GetAction());

            writer.Write(lastNextTile.LocalPosition.X);
            writer.Write(lastNextTile.LocalPosition.Y);
            lastAnimation = wo.animation;
        }