public void Reset(float flashTime, bool startOn, FlashingElement_OperationType type) { toggleOn = startOn; maxTimer = flashTime; currentTimer = 0; flashType = type; }
public void ChangeToModeAfter(float afterTime, FlashingElement_OperationType typeToChangeTo) { afterTimer = afterTime; if (afterTimer == 0) { flashType = typeToChangeTo; } else { afterType = typeToChangeTo; } }
public void Update(GameTime t) { float floatt = (float)t.ElapsedGameTime.TotalSeconds; if (afterTimer > 0) { afterTimer -= floatt; if (afterTimer <= 0) { afterTimer = 0; flashType = afterType; } } if (flashType == FlashingElement_OperationType.FlashingElement_OperationType_Normal) { currentTimer += floatt; if (currentTimer >= maxTimer) { currentTimer = 0; if (toggleOn) toggleOn = false; else toggleOn = true; } } }
public FlashingElement(float flashTime, bool startOn, FlashingElement_OperationType type) { Reset(flashTime, startOn, type); }