public override void Update(GameTime gameTime)
{
time += (float)gameTime.ElapsedGameTime.TotalSeconds;
//If enough elapsed time has passed
if (time >= Block.FrameTime)
{
//Reset timer and move to next frame
time = 0;
frameIndex++;
if (frameIndex > Block.TotalFrames)
frameIndex = 0;
}
}