示例#1
0
 public EntityWorld()
 {
     _systemManager = new SystemManager(this);
     _entityManager = new EntityManager(this);
     _tagManager = new TagManager(this);
     _gameTime = new AmphibianGameTime();
 }
 public override void Update(AmphibianGameTime gameTime)
 {
     _anims[(int)_currentDirection].Update(gameTime);
 }
示例#3
0
 public virtual void Update(AmphibianGameTime gameTime)
 {
 }
示例#4
0
        public override void Update(AmphibianGameTime gameTime)
        {
            if (_animData.RefClock != null) {
                if (_animData.RefClock.Triggered) {
                    if (_animData.Delay == 0)
                        AdvanceFrame();
                    else {
                        _animData.Delay--;
                        if (_animData.Delay == 0)
                            Start();
                    }
                }
            }
            else if (IsAnimating) {
                _animData.TimeAccum += (float)gameTime.ElapsedGameTime.TotalSeconds;

                if (_animData.TimeAccum > _definition.Frames[_animData.CurrentFrameIndex].Duration) {
                    _animData.TimeAccum -= _definition.Frames[_animData.CurrentFrameIndex].Duration;
                    AdvanceFrame();
                }
            }
        }
示例#5
0
        public override void Update(AmphibianGameTime time)
        {
            float elapsed = time.ElapsedGameTime.Milliseconds / 1000f;

            if (CanEmit)
                SpawnParticles(elapsed);

            StageUpdate();

            UpdateParticleLifetime(elapsed);
            UpdateParticlePosition(elapsed);
            UpdateParticleSpin(elapsed);
            UpdateParticleColor();

            ExpireParticles();
            ExpireEmitter();
        }