Ejemplo n.º 1
0
        public void CalculateFpsWithStopwatch()
        {
            time = new StopwatchTime();
            const int TargetFps = 30;

            do
            {
                Thread.Sleep(1000 / TargetFps);
                time.Update();
            } while (time.Milliseconds < 1000);
            Assert.IsTrue(Math.Abs(time.Fps - TargetFps) <= 5, "Fps=" + time.Fps);
        }
Ejemplo n.º 2
0
 protected override void Update(GameTime gameTime)
 {
     if (stop)
     {
         Exit();
     }
     InputManager.Update(CanvasScale);
     GlobalTime.Update(gameTime);
     GlobalTime.ChangeSpeed(GameSpeed);
     SceneManager.UpdateScenes();
     ParticleManager.UpdateParticles();
     if (Convert.ToBoolean(ConfigManager.GetValue("enable_sky")))
     {
         sky.Update();
     }
     base.Update(gameTime);
 }
Ejemplo n.º 3
0
 public void RunTimeWithStopwatch()
 {
     time = new StopwatchTime();
     time.Update();
     Assert.IsTrue(time.Milliseconds < 2, "Milliseconds=" + time.Milliseconds);
 }
Ejemplo n.º 4
0
 public void RunTime()
 {
     time.Update();
     Assert.LessOrEqual(time.Milliseconds, 50);
 }