Example #1
0
        public override void Initialize()
        {
            populateMatrix();
            setRepresentetives();
            this.Add(r_MotherShip);
            r_SoundManager.AddSoundEmitter(r_MotherShip);

            base.Initialize();
        }
Example #2
0
        public void AddMenuItem(MenuItem i_Item)
        {
            r_Options.Add(i_Item);
            this.GameScreen.Add(i_Item);
            i_Item.Clicked += item_Clicked;
            setPosition(i_Item);
            r_SoundManager.AddSoundEmitter(i_Item);

            if (!i_Item.IsInitialized)
            {
                i_Item.Initialize();
            }
        }
        private void createBarriers()
        {
            Vector2 startingObstaclesPoint = getStartingPosition();

            for (int i = 0; i < k_NumOfBarriers; i++)
            {
                Barrier barrier = new Barrier(r_GameScreen);
                setBarrierProperties(barrier, startingObstaclesPoint);
                r_Barriers.Add(barrier);
                r_SoundManager.AddSoundEmitter(barrier);
                startingObstaclesPoint.X += barrier.Width * 2;
            }
        }
Example #4
0
        public void AddPlayer(BasePlayer i_Player)
        {
            i_Player.PlayerCollided += player_Collided;
            i_Player.StartPosition   = NextPosition;
            NextPosition            -= new Vector2(i_Player.Width, 0);
            m_LivesManager.AddPlayer(i_Player);
            m_ScoreManager.AddPlayer(i_Player);
            r_GameScreen.Add(i_Player);
            r_Players.Add(i_Player);
            PlayersCount++;
            r_SoundManager.AddSoundEmitter(i_Player);

            if (PlayersCount > m_GameSettings.PlayersCount)
            {
                i_Player.Visible = false;
                i_Player.Enabled = false;
            }

            setMouseControl(i_Player);
        }