Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const float AILMENT_TICK_FREQUENCY = 0.02f; // 50 updates per second
- float ailmentTime;
- void UpdateLoop(float dt)
- {
- ailmentTime += dt;
- while (ailmentTime >= AILMENT_TICK_FREQUENCY) {
- ailmentTime -= AILMENT_TICK_FREQUENCY;
- AilmentTick();
- }
- }
- void AilmentTick()
- {
- // do your ailment logic in here
- // ailments could have duration in ticks, so a bleed with duration of 75 ticks is equal to 1.5s
- // it would guarantee consistent results when it comes to damage output
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement