Beispiel #1
0
        private void AddToSpawnNumbers(int newNumber)
        {
            List <int> spawnNumbers = SpawnNumbers.ToList();

            spawnNumbers.Add(newNumber);
            SpawnNumbers = spawnNumbers.ToArray();
        }
Beispiel #2
0
        public override bool Move(Direction dir)
        {
            bool moveResult = base.Move(dir);

            if (!SpawnNumbers.Contains(GetMaxNumber()))
            {
                AddToSpawnNumbers(GetMaxNumber());
                // Although a wider range of numbers can be spawned, we still want to usually spawn 2 or 3.
                AddToSpawnNumbers(2);
                AddToSpawnNumbers(3);
            }
            return(moveResult);
        }