Execute code at specific intervals, only once?
- by Mathias Lykkegaard Lorenzen
I am having an issue with XNA, where I want to execute some code in my Update method, but only at a given interval, and only once. I would like to avoid booleans to check if I've already called it once, if possible.
My code is here:
if ((gameTime.TotalGameTime.TotalMilliseconds % 500) == 0)
{
Caret.Visible = !Caret.Visible;
}
…