Пример #1
0
        private void moveLevel()
        {
            m_CurrentLevel++;

            SpaceInvadersServices.ClearComponents <Enemy>(this);
            SpaceInvadersServices.ClearComponents <Barrier>(this);
            SpaceInvadersServices.ClearComponents <Bullet>(this);
            EnemiesMatrix enemyMatrix  = SpaceInvadersServices.GetEnemeiesMatrixComponent(this);
            BarrierGroup  barrierGroup = SpaceInvadersServices.GetBarrierGroupComponent(this);

            enemyMatrix.Initialize();
            barrierGroup.Initialize();
            SpaceInvadersServices.ChangeBarriersGroupVerticalPosition(this, barrierGroup);

            int state = m_CurrentLevel % 5;

            if (state >= 2 && state <= 5)
            {
                enemyMatrix.AddEnemiesColumn();
                enemyMatrix.IncraseEnemiesRandomShotting();
                enemyMatrix.AddPointsForEnemyKilling(30);
                barrierGroup.StartJumpingBarriers();
                barrierGroup.Speedup(0.05f);
                if (state == 2)
                {
                    barrierGroup.ChangeToDefaultJumpingSpeed();
                }
            }
            else
            {
                barrierGroup.StopJumpingBarriers();
            }

            this.ScreensManager.SetCurrentScreen(new MoveStageScreen(this.Game, m_CurrentLevel));
        }
Пример #2
0
        public override void Initialize()
        {
            initilizeOnFirstRun();
            SpritesFactory.CreateSprite(this, SpritesFactory.eSpriteType.MotherShip);
            SpritesFactory.CreateSprite(this, SpritesFactory.eSpriteType.SpaceBackground);
            EnemiesMatrix enemiesMatrix = new EnemiesMatrix(this);
            BarrierGroup  barrierGroup  = new BarrierGroup(this);

            m_MultiPlayerConfiguration = SpaceInvadersServices.GetMultiPlayerConfiguration(this.Game);
            m_MultiPlayerConfiguration.CreatePlayers(this);
            m_WonLevelSound = SoundFactory.CreateSound(this, SoundFactory.eSoundType.LevelWin);
            m_GameOverSound = SoundFactory.CreateSound(this, SoundFactory.eSoundType.GameOver);
            this.Add(enemiesMatrix);
            this.Add(barrierGroup);
            base.Initialize();
            SpaceInvadersServices.ChangeBarriersGroupVerticalPosition(this, barrierGroup);
        }