示例#1
0
 private void GameStart()                                          //Start of Game
 {
     rewardVideo.LoadAd(new AdRequest.Builder().Build(), VideoId); // Loading of AD
     uiController.ChangeEnemyLeft(10);
     timer.StartTimer(gameTime);
     enemyContrl.NewGame();
     uiController.PlayAgain();
 }
示例#2
0
    void GetDamage(float damage) // Receive damage
    {
        if (enemyCurentHp > 0)
        {
            float hpProcent = damage / enemyCurentHp;
            enemyCurentHp -= damage;
            uiController.ChangeHpBar(Mathf.Abs(1 - hpProcent));
            print(Mathf.Abs(1 - hpProcent));

            if (enemyCurentHp <= 0) // Enemy Dead
            {
                AnimManager(1);
                int enemyLeft = uiController.EnemyLeft();
                Respawn(enemyMaxHp * 1.4f); //Every new lvl gives 30% more HP to Enemy
                if (enemyLvl < 10)
                {
                    enemyLvl++;
                }
                uiController.ChangeLvl(enemyLvl);
                uiController.ChangeEnemyLeft(enemyLeft -= 1);
            }
        }
    }