Esempio n. 1
0
        private void StartAnimation(AnimationType anim)
        {
            switch (anim)
            {
            case AnimationType.UpdateMap:
                animationTimer.Stop();
                animationCount = 0;
                drawPanel.Invalidate();
                break;

            case AnimationType.Waiting:
                animType = AnimationType.Waiting;
                animationTimer.Stop();
                animationFrames         = GetAnimationFrames.Waiting(Map.ActiveXY);
                animationCount          = 0;
                animationTimer.Interval = 0.2;        // sec
                animationTimer.Start();
                break;

            case AnimationType.UnitMoving:
                animType        = AnimationType.UnitMoving;
                animationFrames = GetAnimationFrames.UnitMoving(Game.GetActiveUnit);
                animationTimer.Stop();
                animationCount          = 0;
                animationTimer.Interval = 0.01;        // sec
                animationTimer.Start();
                break;

            case AnimationType.Attack:
                animType = AnimationType.Attack;
                animationTimer.Stop();
                animationCount          = 0;
                animationTimer.Interval = 0.07;        // sec
                animationTimer.Start();
                break;
            }
        }
Esempio n. 2
0
 public MoveAnimation(MovementEventArgs args, Sound sound)
     : base(GetAnimationFrames.UnitMoving(args.Unit).ToArray(), 6, 7, 0.02, args.Location[0])
 {
     _sound = sound;
 }