Even though I'm working on ARC I'm still working on GreGoR, just not as much as I've been wanting to. I would still like to have my own RPG engine. Anyways so I'm trying to create a timer class to make keeping track of time easier to access. So I created this timer class yet I'm not entirely sure if it works only because I don't have a solid project to test it in. But maybe I could get some pointers or possibly a tester.
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());
}
}
}
}
Its a repeating timer. When the timer reaches over miliseconds it resets and calls the TimerTick event handler. Maybe theres a better way to do this?
wait, what is the purpose of this timer? You should be able to use GameTime for pretty much everything, and there is a class called Stopwatch in case you need something more general.
Its so I can tell when specific time intervals have passed when and where needed. The stopwatch class sounds more like what I need. Thanks winkio.
Question are you making an rtp using rmxp format? cuz I would love to help with GFX/Sound/etc. :3