Exemplo n.º 1
0
 public void Reset(float flashTime, bool startOn, FlashingElement_OperationType type)
 {
     toggleOn = startOn;
     maxTimer = flashTime;
     currentTimer = 0;
     flashType = type;
 }
Exemplo n.º 2
0
 public void ChangeToModeAfter(float afterTime, FlashingElement_OperationType typeToChangeTo)
 {
     afterTimer = afterTime;
     if (afterTimer == 0)
     {
         flashType = typeToChangeTo;
     }
     else
     {
         afterType = typeToChangeTo;
     }
 }
Exemplo n.º 3
0
        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;
                }
            }
        }
Exemplo n.º 4
0
 public FlashingElement(float flashTime, bool startOn, FlashingElement_OperationType type)
 {
     Reset(flashTime, startOn, type);
 }