Esempio n. 1
0
 public void addPoints(Image actionMeter, Image health)
 {
     if (!GAME_OVER)
     {
         float points = POINTS_RATE * (damageModule.getAttribute(Attribute.Speed)) * SPEED_MODIFIER * attackSpeed;
         actionPoints.addPoints(points);
         if (actionPoints.isKO() && actionPoints.isReady())
         {
             revive(actionMeter, health);
         }
     }
 }
 // Update is called once per frame
 void Update()
 {
     dragonText.text = healthBar.getHealthString();
     addPoints();
     counterBool = setCounterBool();
     setCounterColor();
     if (counter())
     {
         cancelAttack();
     }
     if (actionPoints2.getMeter() > counterWindow)
     {
         setAnimationTrigger();
         makeTimerVisible();
     }
     if (actionPoints2.isReady() && !gameOver())
     {
         doRandomAttack(nextAttack);
         actionPoints2.usePoints();
         nextAttack = getRandomAttack();
         resetAttackTimerPos();
     }
     if (timerCount == TIMER_MAX)
     {
         GameController.GetComponent <GameController>().gameOver();
     }
     else if (actionPoints.isReady())
     {
         ++timerCount;
         if (timerCount < TIMER_MAX)
         {
             powerUp();
             setTimerColor(doomsdayTimer);
         }
     }
 }