Example #1
0
 /// <summary>
 /// Get a gameplay blueprint by difficulty
 /// </summary>
 /// <param name="difficulty"></param>
 /// <returns></returns>
 public GameplayBlueprint GetBlueprint(GameSettings.Difficulty difficulty)
 {
     if (BlueprintLookup == null)
     {
         CreateLookup();
     }
     return(BlueprintLookup[difficulty]);
 }
        protected virtual void Awake()
        {
            gameManager = GameObject.Find("GameManager").GetComponent <GameManager>();

            bPause            = false;
            gameSpeed         = 1;
            currentCash       = 0;
            maxWaveShield     = 0;
            currentShield     = 0;
            currentWave       = 0;
            maxBaseHealth     = 100;
            currentBaseHealth = maxBaseHealth;
            enemyAliveCount   = 0;
            enemyWaveCount    = 0;
            sellFactor        = 0.5f;

            difficulty = GameSettings.Difficulty.Hypothetical;
        }
Example #3
0
        protected virtual void Start()
        {
            gameManager = GameObject.Find("GameManager").GetComponent <GameManager>();
            enemyBuff   = new List <EnemyBuff>();
            difficulty  = gameManager.gameMode.difficulty;
            ReadFromXml();

            currentHealth = initHealth;
            currentDamage = initDamage;
            bStun         = false;

            if (flyable == Flyable.Air)
            {
                currentSpeed = initSpeed / GameSettings.lengthFactor;
                destination  = gameManager.endInAir.transform;
            }
            else if (flyable == Flyable.Ground)
            {
                currentSpeed            = initSpeed / GameSettings.lengthFactor;
                agent                   = gameObject.AddComponent <NavMeshAgent>();
                agent.avoidancePriority = 99;
                agent.speed             = currentSpeed * gameManager.gameMode.GameSpeed;
                agent.destination       = gameManager.endOnGround.position;
                agent.stoppingDistance  = lowestDistance;
                destination             = gameManager.endOnGround;
            }

            gameManager.gameMode.GameSpeedChangeEvent += () =>
            {
                if (flyable == Flyable.Air)
                {
                    currentSpeed = initSpeed / GameSettings.lengthFactor;
                }
                else if (flyable == Flyable.Ground)
                {
                    currentSpeed = initSpeed / GameSettings.lengthFactor;
                    agent        = gameObject.GetComponent <NavMeshAgent>();
                    agent.speed  = currentSpeed * gameManager.gameMode.GameSpeed;
                }
            };
        }
 private void DiffEasy_Checked(object sender, RoutedEventArgs e)
 {
     this.difficulty = GameSettings.Difficulty.EASY;
 }
 private void DiffHard_Checked(object sender, RoutedEventArgs e)
 {
     this.difficulty = GameSettings.Difficulty.HARD;
 }
 private void DiffNormal_Checked(object sender, RoutedEventArgs e)
 {
     this.difficulty = GameSettings.Difficulty.NORMAL;
 }