diff -r 6acdce85db3cc55d685c4a3c1f8918b36a207996 -r de6cfca9566bed16d4de4a82409c41ecb71d1a11 axios/Engine/AxiosTimer.cs --- a/axios/Engine/AxiosTimer.cs Sun Sep 30 21:45:24 2012 -0500 +++ b/axios/Engine/AxiosTimer.cs Fri Dec 28 16:57:08 2012 -0600 @@ -16,6 +16,7 @@ TimeSpan interval = new TimeSpan(0, 0, 1); TimeSpan lastTick = new TimeSpan(); private bool _enabled = false; + public TimeSpan? offset = null; public event EventHandler Tick; @@ -38,12 +39,21 @@ public override void Update(AxiosGameScreen gameScreen, GameTime gameTime, bool otherScreenHasFocus, bool coveredByOtherScreen) { - + // Issue here: if you add a timer later on and use the algorithm of + // gameTime.TotalGameTime - lastTick >= interval + // The timer will always run + // What we should do is have an offset of the time it was added like this: + // ((gameTime.TotalGameTime - offset) - lastTick) >= interval if (gameScreen.ScreenManager.Game.IsActive) //only "tick" if the window has focus - otherwise the Timer will play catchup { + if (offset == null) + { + offset = gameTime.TotalGameTime; + return; + } if (_enabled) { - if (gameTime.TotalGameTime - lastTick >= interval) + if (((gameTime.TotalGameTime - offset) - lastTick) >= interval) { if (Tick != null) {