Exemplo n.º 1
0
        public override void Update(float dt)
        {
            _inputSystem.Update(dt);
            CheckPause();

            if (!Paused)
            {
                _processManager.Update(dt);

                // Do not need to be in lock-step
                _aiSystem.Update(dt);
                _livesSystem.Update(dt);
                _goalSystem.Update(dt);

                // Deterministic lock-step
                _acculmulator += dt;
                while (_acculmulator >= Constants.Global.TICK_RATE)
                {
                    _acculmulator -= Constants.Global.TICK_RATE;

                    _paddleSystem.Update(Constants.Global.TICK_RATE);
                    _ballMovementSystem.Update(Constants.Global.TICK_RATE);
                }

                // Update the directors
                for (int i = 0; i < _directors.Length; i++)
                {
                    _directors[i].Update(dt);
                }

                // Update particles
                VelocityParticleManager.Update(dt);

                // Update post-processing effects
                PongPostProcessor.Update(dt);
            }
        }