public void Update(TimeObject to)
 {
     foreach (IGameObject go in members)
     {
         go.Update(to);
     }
 }
Exemplo n.º 2
0
 virtual public void Update(TimeObject to)
 {
     foreach (IGameObject go in _objects)
     {
         go.Update(to);
     }
 }
Exemplo n.º 3
0
        public virtual void Update(TimeObject to)
        {
            if (currentAnimation == null)
            {
                return;
            }
            if (currentAnimation.frames.Count == 0)
            {
                return;
            }

            _animTime += to.ElapsedGameTime;

            while (_animTime >= currentAnimation.frametime)
            {
                _animTime -= currentAnimation.frametime;
                _animIdx++;
                if (_animIdx >= currentAnimation.frames.Count)
                {
                    _animIdx = 0;
                }
            }
            foreach (var _s in _sprites)
            {
                _s.Update(to);
            }
        }
Exemplo n.º 4
0
        public override void DoIntelligenceUpdate(JamUtilities.TimeObject timeObject)
        {
            _timer -= timeObject.ElapsedGameTime;

            if (_timer <= 0.0f)
            {
                _timer = _timerMax;
                DoMove();
            }
        }
Exemplo n.º 5
0
        public override void DoIntelligenceUpdate(JamUtilities.TimeObject timeObject)
        {
            _moveTimer -= timeObject.ElapsedGameTime;

            if (_moveTimer <= 0)
            {
                _moveTimer         = _animal.MoveTimerMax * (1.0f + ((float)(RandomGenerator.Random.NextDouble() - 0.5) * 0.5f));
                moveRecursionDepth = 0;
                DoMove();
            }
        }
Exemplo n.º 6
0
 public void Update(TimeObject timeObject)
 {
     _currentTime -= timeObject.ElapsedGameTime;
     if (_currentTime <= 0.0f)
     {
         _currentTime = SingleImageTime;
         _currentPosition++;
         if (_currentPosition == _order.Count)
         {
             _currentPosition = 0;
         }
     }
 }
Exemplo n.º 7
0
 public static void Update(TimeObject to)
 {
     Initialize();
     foreach (Timer t in _allTimers)
     {
         t.Update(to.ElapsedGameTime);
     }
     CleanUp();
     if (clearMe)
     {
         _allTimers.Clear();
         clearMe = false;
     }
 }
Exemplo n.º 8
0
        public static TimeObject Update(float deltaT)
        {
            if (IsInPause)
            {
                _pauseTimer -= deltaT;
                if (_pauseTimer <= 0)
                {
                    _pauseTimer = 0.0f;
                    IsInPause   = false;
                }
            }

            ElapsedRealTime = deltaT;
            ElapsedGameTime = deltaT * TimeFactor * ((IsInPause) ? 0.0f:1.0f);
            TimeObject to = new TimeObject(ElapsedGameTime, ElapsedRealTime, IsInPause);

            return(to);
        }
Exemplo n.º 9
0
 public void Update(TimeObject timeObject)
 {
     Update(timeObject.ElapsedGameTime);
 }