public bool Update() { if (_damageable == null || Done) { return(false); } if (_damageable.IsDead && ATBBarPos > 0) { ATBBarPos = 0; return(true); } var totalMilliseconds = Memory.ElapsedGameTime.TotalMilliseconds; ATBBarIncrement = _damageable.BarIncrement(); // 60 ticks per second. ATBBarPos += (float)(ATBBarIncrement * totalMilliseconds / 60); // if TotalMilliseconds is 1000 then it'll increment 60 times. So this should be right. return(true); }
public bool Update() { if (Damageable != null) { if (!Damageable.IsDead) { if (!Done) { double TotalMilliseconds = Memory.ElapsedGameTime.TotalMilliseconds; ATBBarIncrement = Damageable.BarIncrement(); // 60 ticks per second. ATBBarPos += checked ((float)(ATBBarIncrement * TotalMilliseconds / 60)); // if TotalMilliseconds is 1000 then it'll increment 60 times. So this should be right. return(true); } } else if (ATBBarPos > 0) { ATBBarPos = 0; return(true); } } return(false); }