Started by G_G, March 08, 2011, 07:22:57 pm
namespace GreGoR{ class Timer { int miliseconds = 100; int interval = 0; public event EventHandler TimerTick; public Timer(int inter) { miliseconds = inter; } public void Update(GameTime gameTime) { interval += gameTime.ElapsedGameTime.Milliseconds; if (interval > miliseconds) { interval = 0; if (TimerTick != null) TimerTick(this, new EventArgs()); } } }}