Exemplo n.º 1
0
    private void AttackSlider_onAttack(float f, AttackSlider.state preformance)
    {
        switch (preformance)
        {
            case AttackSlider.state.perfect:
                if (onPerfectHit != null)
                    onPerfectHit();
                HP -= 3;
                break;

            case AttackSlider.state.good:
                if (onGoodHit != null)
                    onGoodHit();
                HP--;
                break;

            case AttackSlider.state.bad:
                if (onBadHit != null)
                    onBadHit();

                break;
        }

        if (HP <= 0)
        {
            if (onOutOfHP != null)
                onOutOfHP();

            HP = 0;
        }

        if (onHPChange != null)
            onHPChange(HP / MaxHP);
    }
Exemplo n.º 2
0
 private void AttackSlider_onAttack(float f, AttackSlider.state preformance)
 {
     //event handler for attack Slider;
     if (preformance == AttackSlider.state.good)
         tx -= 5 / 40f;
     if (preformance == AttackSlider.state.perfect)
         tx -= 10 / 40f;
     if (preformance == AttackSlider.state.bad)
         tx += 5 / 40f;
     moveBoss();
 }