Example #1
0
 private void recreateEnemyMatrix()
 {
     removeEnemysBullets();
     this.Remove(m_EnemyMatrix);
     m_EnemyMatrix = new EnemyMatrix(this.Game);
     this.Add(m_EnemyMatrix);
 }
Example #2
0
        public PlayScreen(Game i_Game)
            : base(i_Game)
        {
            m_GamePauseScreen = new GamePauseScreen(i_Game);
            r_GameManager     = i_Game.Services.GetService(typeof(IGameManager)) as IGameManager;
            r_GameManager.FirsttLevelConstructor(this, out m_BarriesAccelerator, out m_NumberOfAdditionalColumns, out m_EnemiesAdditionalScore);

            this.Add(new MotherShip(i_Game));
            this.Add(r_BarrierMatrix = new BarrierMatrix(i_Game, m_BarriesAccelerator));
            this.Add(r_EnemyMatrix   = new EnemyMatrix(i_Game, k_EnemiesColumn + m_NumberOfAdditionalColumns, k_EnemiesRow, m_EnemiesAdditionalScore));
            creatShips();
        }
Example #3
0
        public PlayScreen(Game i_Game)
            : base(i_Game)
        {
            GameManager      gameManager;
            ScreenBackground background = new ScreenBackground(i_Game, Color.DarkCyan, @"GameAssets\BG_Space01_1024x768");
            MotherShip       motherShip = new MotherShip(i_Game, Color.Red);

            gameManager              = this.Game.Services.GetService(typeof(IGameManager)) as GameManager;
            gameManager.LevelPassed += gameManager_LevelPassed;
            gameManager.GameOver    += gameManager_GameOver;
            m_EnemyMatrix            = new EnemyMatrix(i_Game);
            m_BarrierList            = new BarrierList(i_Game, Color.LightGreen);
            m_PauseScreen            = new PauseScreen(i_Game);
            this.Add(background);
            this.Add(m_EnemyMatrix);
            createPlayers(gameManager);
            this.Add(motherShip);
            this.Add(m_BarrierList);
        }
Example #4
0
        // if player2points < 0, only 1 player. else 2 players
        public SpaceInvadersScreen(Game i_Game, int i_Player1Points = 0, int i_Player2Poitns = 0, int i_GameLevel = 0, int i_Player1Lifes = 3, int i_Player2Lifes = 3) : base(i_Game)
        {
            m_Background = new Background(this);

            m_Background = new Background(this);

            m_EnemyMatrix = new EnemyMatrix(this, i_GameLevel, k_NumOfMatrixColAtStart + (i_GameLevel % k_numOfLevels));

            m_MotherShipTest = new MotherShip(this, i_GameLevel);

            m_SpaceShip1 = new SpaceShip(this, true, i_Player1Points, i_Player1Lifes);

            if (i_Player2Poitns >= 0)
            {
                m_OnlyOneSpaceShipsIsALive = false;
                r_GameOfOnlyOnePlayer      = false;
                m_SpaceShip2 = new SpaceShip(this, false, i_Player2Poitns, i_Player2Lifes);
            }

            m_BarriersLine  = new BarrierLine(this, i_GameLevel);
            m_GameLevel     = i_GameLevel;
            this.BlendState = BlendState.NonPremultiplied;
        }
Example #5
0
 private void createGameEntities()
 {
     m_EnemyMatrix = new EnemyMatrix(Game);
     m_MotherShip  = new MotherShip(Game);
 }
Example #6
0
 public void addEnemyMatrix()
 {
     m_EnemyMatrix = new EnemyMatrix(this, @"Sprites/AllEnemies_192x32", m_CurrentLevel, ((CurrentLevel - 1) % 4) + k_NumberOfCols);
 }