Exemple #1
0
        // - - - - - - - - -
        // Level processor :
        // - - - - - - - - -

        // Processing level objects:
        public void ProcessLevel()
        {
            ProcessableObjects.ForEach(p => p.ProcessObject());

            if (levelStarted)
            {
                // Adding enemy:
                if ((AllGameObjects.EnemiesCount < 4) && (AllGameObjects.TankPortalsCount < 1) && (this.EnemyTanksLeft > 0))
                {
                    var bonus = enemyTanksLeft % 10 == 0 ? true : false;

                    CreateTankPortal(CObjectCreator.CreateTank(EnemyTanks[enemyTanksLeft - 1], bonus));

                    EnemyTanksLeft--;
                }

                if ((EnemyTanksLeft == 0) && (AllGameObjects.EnemiesCount == 0))
                {
                    if (timeoutToNextLevel-- == 0)
                    {
                        OnComplete_Level(this, new EventArgs());
                    }
                }
            }
        }
Exemple #2
0
 public void ProcessLevel()
 {
     ProcessableObjects.ForEach(p => p.ProcessObject());
 }