예제 #1
0
    public void attackEnemy(Attack attack, float multiplier)
    {
        currentEnemyHealth -= (int)(attack.enemyDamage * multiplier);
        health.updateHealth(enemy.health, currentEnemyHealth);

        if (currentEnemyHealth <= 0)
        {
            FindObjectOfType <CombatDisplay>().playerVictory();
        }
    }
예제 #2
0
파일: Player.cs 프로젝트: nickbarrash/ld-48
 public void updateHealth(int diff)
 {
     health += diff;
     health  = Mathf.Min(health, maxHealth);
     if (health <= 0)
     {
         GameManager.instance.gameOver(false);
     }
     healthDisplay.updateHealth(maxHealth, health);
 }