Exemplo n.º 1
0
 /// <summary>
 /// This method sets a formula that must be evaluated before deciding whether the player can progress to the next level. Added by Isaac.
 /// </summary>
 public void ControlLevels()
 {
     if (EnemiesToBeRemoved.Count >= GameLevel.GetFormula())
     {
         GameLevel.IncreaseLevel();   // IA - move the next level if enough enemies have been destroyed
         Food.IncreaseMineralValue(); // IA - Make food more expensive
         Food.IncreaseEnergyValue();  // IA - Make the food conversion to energy less significant.
         EnemiesToBeRemoved.Clear();  // IA - Reset the count of enemies destroyed at each level.
         GetWorld().PutMinerals();    //jeremy - for every new level, new minerals added to game
     }
 }
Exemplo n.º 2
0
        public void GetFormulaTest()
        {
            // Reminder: The GameLevel class' formula = (LevelNo * 5) + 1 + (LevelNo * LevelNo)
            // ...with "LevelNo" referring to the player's current game level.

            GameLevel.SetLevel(3);

            // (3 * 5) + 1 + (3 * 3) = 15 + 1 + 9 = 25
            Assert.AreEqual(25, GameLevel.GetFormula());

            GameLevel.SetLevel(14);

            // (14 * 5) + 1 + (14 * 14) = 70 + 1 + 196 = 267
            Assert.AreEqual(267, GameLevel.GetFormula());
        }