public void Update(GameTime gametime)
{
if (isFrameAnimated)
{
// see what was the elapsed time
elapsedTime += (float)gametime.ElapsedGameTime.TotalSeconds;
// check if the time elapsed is bigger than the frame rate
if (elapsedTime > rateOfFrame)
{
// increment the current frame
currentFrame = (currentFrame + 1) % numberOfFrames;
// reset the elapsed time for the frame
elapsedTime = 0.0f;
}
}
}