Example #1
0
    private void Start()
    {
        // depending on level of difficulty, different number of players
        GameObject diffObj = GameObject.FindWithTag("DiffMode");

        player_health  = player.GetComponent <PlayerHealth>();
        monitor_game   = monitorGameObj.GetComponent <MonitorGame>();
        checkIfHit     = player.GetComponent <CheckIfHit>();
        difficultyMode = diffObj.GetComponent <DifficultyMode>();


        if (difficultyMode.levelOfDiff == 1)
        {
            // normal mode
            amountOfEnemies             = 4;
            player_health.numberOfHeals = 3;
            checkIfHit.damageFromEnemy  = 10;
            monitor_game.healsLeft      = 3;
            monitor_game.UpdateHealDisplay(3);
        }
        else
        {
            // hard mode
            amountOfEnemies             = 9;
            player_health.numberOfHeals = 1;
            checkIfHit.damageFromEnemy  = 20;
            monitor_game.healsLeft      = 1;
            monitor_game.UpdateHealDisplay(1);
        }


        SpawnEnemies();
    }
Example #2
0
 public void HealPlayer()
 {
     numberOfHeals         -= 1;
     monitor_game.healsLeft = numberOfHeals;
     monitor_game.UpdateHealDisplay(numberOfHeals);
     currentHealth      = startingHealth;
     healthSlider.value = currentHealth;
 }