Пример #1
0
 public SpaceShip(
     Game i_Game,
     GameScreen i_Screen,
     string i_AssetName,
     ShootsManager i_ShootsManager) :
     base(i_Game, i_Screen, i_AssetName)
 {
     m_ShootsManager = i_ShootsManager;
     m_SoundManager  = SoundEffectsManager.GetInstance(i_Game);
 }
Пример #2
0
 public EnemySpaceShipsMatrix(
     Game i_Game,
     GameScreen i_Screen,
     ShootsManager i_ShootsManager) :
     base(i_Game, i_Screen, k_Level1NumOfRows, k_Level1NumOfCols, k_RowSpace, k_ColSpace)
 {
     m_ShootsManager = i_ShootsManager;
     m_SoundManager  = SoundEffectsManager.GetInstance(i_Game);
     m_Screen        = i_Screen;
     DrawOrder       = k_DrawOrder;
     allocateAndInitMatrix(k_Level1NumOfRows, k_Level1NumOfCols);
 }
Пример #3
0
        public PlayGameScreen(Game i_Game, LevelTransitionScreeen i_TransitionScreen) : base(i_Game)
        {
            m_FirstLevelTransitionScreen = i_TransitionScreen;
            m_BackGround    = new Background(i_Game, this, @"Sprites\BG_Space01_1024x768", 1);
            m_ShootsManager = new ShootsManager(this.Game);
            m_SoundManager  = SoundEffectsManager.GetInstance(i_Game);
            const bool k_IsFirstPlayer = true;

            PlayerSpaceShip[] players = new PlayerSpaceShip[2];
            players[0] = new PlayerSpaceShip(this.Game, this, m_ShootsManager, k_IsFirstPlayer);
            players[1] = new PlayerSpaceShip(this.Game, this, @"Sprites/Ship02_32x32", m_ShootsManager, !k_IsFirstPlayer);


            EnemyMotherShip       motherShip      = new EnemyMotherShip(this.Game, this, m_ShootsManager);
            EnemySpaceShipsMatrix spaceshipMatrix = new EnemySpaceShipsMatrix(this.Game, this, m_ShootsManager);
            WallMatrix            wallMatrix      = new WallMatrix(this.Game, this, m_ShootsManager);

            m_ShootsManager.EnemyGotShot += players[0].EnemyGotShot;
            m_ShootsManager.EnemyGotShot += players[1].EnemyGotShot;
            m_PauseScreen    = new PauseScreen(this.Game);
            m_GameOverScreen = new GameOverScreen(this.Game, this, m_FirstLevelTransitionScreen);

            m_Players = players;
            r_Enemys  = new List <Sprite>();
            r_Enemys.Add(motherShip);
            r_Enemys.Add(spaceshipMatrix);
            m_WallsMatrix = wallMatrix;
            m_EnemyMatrix = spaceshipMatrix;
            m_Level       = 1;

            this.Add(m_Players[0]);
            this.Add(m_Players[1]);
            this.Add(motherShip);
            this.Add(spaceshipMatrix);
            this.Add(wallMatrix);
            this.Add(m_BackGround);

            List <PlayerSpaceShip> playersList = new List <PlayerSpaceShip>();

            playersList.Add(m_Players[0] as PlayerSpaceShip);
            playersList.Add(m_Players[1] as PlayerSpaceShip);
            m_CollisionManager = new CollisionManager(this.Game, playersList, spaceshipMatrix.Sprites, wallMatrix.Sprites);
        }
Пример #4
0
        public SpaceInvaders()
        {
            m_GraphicsMgr = new GraphicsDeviceManager(this);
            m_GraphicsMgr.PreferredBackBufferHeight = 600;
            m_GraphicsMgr.PreferredBackBufferWidth  = 800;
            this.Content.RootDirectory = "Content";
            SpaceInvadersSettings settings = SpaceInvadersSettings.GetInstance(this);

            settings.GraphicsManager = m_GraphicsMgr;

            m_InputManager     = new InputManager(this);
            m_SoundManager     = SoundEffectsManager.GetInstance(this);
            m_TransitionScreen = new LevelTransitionScreeen(this, 1);
            m_PlayGameScreen   = new PlayGameScreen(this, m_TransitionScreen);
            m_WelcomeScreen    = new WelcomeScreen(this, m_PlayGameScreen, m_TransitionScreen);
            m_ScreensManager   = new ScreensMananger(this);

            m_ScreensManager.Push(m_PlayGameScreen);
            m_ScreensManager.Push(m_TransitionScreen);
            m_ScreensManager.SetCurrentScreen(m_WelcomeScreen);
        }
Пример #5
0
 private void soundFxVolumeValueChanged(int i_Value)
 {
     SpaceInvadersSettings.GetInstance(Game).SoundFXVolume    = i_Value;
     SoundEffectsManager.GetInstance(Game).SoundEffectsVolume = (float)i_Value / 100;
 }
Пример #6
0
 public SpaceInvadersMenu(Game i_Game, string i_Headline) :
     base(i_Game, i_Headline)
 {
     m_SoundManager = SoundEffectsManager.GetInstance(i_Game);
 }
Пример #7
0
 public Wall(Game i_Game, GameScreen i_Screen, ShootsManager i_ShootsManager) :
     base(i_Game, i_Screen, @"Sprites/Barrier_44x32")
 {
     m_ShootsManager = i_ShootsManager;
     m_SoundManager  = SoundEffectsManager.GetInstance(i_Game);
 }