Esempio n. 1
0
        public void Update(GameTime gameTime)
        {
            var et = (float)gameTime.ElapsedGameTime.TotalSeconds;

            frameRunTime += et;

            AnimationState = AnimationState.Running;

            if (frameRunTime > frameTime)
            {
                if (currentFrame < Frames.Count() - 1)
                {
                    currentFrame++;
                }
                else if (Loop)
                {
                    currentFrame = 0;
                }
                else
                {
                    AnimationState = AnimationState.Finished;
                }
                frameRunTime = 0.0f;
            }

            animationEffects[currentEffect].Update(gameTime);
        }
Esempio n. 2
0
        public void TryAdvance()
        {
            if (Frames.Count() <= 0)
            {
                return;
            }

            long currentTime = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;

            if (_lastSwitch + AnimationDelay > currentTime)
            {
                _lastSwitch    = currentTime;
                _currentFrame += 1;
                _currentFrame %= Frames.Count();
                CurrentFrame   = Frames[_currentFrame];
                Advance        = true;
            }
        }
Esempio n. 3
0
        public void AddFrame(string frameAsString)
        {
            Frame frame;

            if (Frames.Count() < 9)
            {
                frame = new StandardFrame(_currentFrame, frameAsString);
                if (_currentFrame != null)
                {
                    _currentFrame.LinkNext(frame);
                }
                _currentFrame = frame;
            }
            else
            {
                frame = new TenthFrame(_currentFrame, frameAsString);
                _currentFrame.LinkNext(frame);
                _currentFrame = frame;
            }
        }
Esempio n. 4
0
 public override string ToString()
 {
     return(String.Format("{0} Fields, {1} Frames", Fields.Count(), Frames.Count()));
 }
Esempio n. 5
0
 public override string ToString()
 {
     return(Name + " Frames:" + Frames.Count());
 }