Пример #1
0
        protected override void Initialize()
        {
            height        = graphics.GraphicsDevice.Viewport;
            height.Height = 800;
            graphics.GraphicsDevice.Viewport = height;


            this.graphics.PreferredBackBufferHeight = 800;
            this.graphics.ApplyChanges();

            ball_1 = new Ball(new Vector2(400, 400),  // init Position

                              2,                      // Speed multi, multiplies final speed vector
                                                      // after all other modifications in the game lifetime
                              new Vector2(1, 1));     // init Direction

            ball_2 = new Ball(new Vector2(400, 400),
                              2,
                              new Vector2(1, 1));

            paddle           = new Paddle(this.graphics);
            theBrick_Manager = new Brick_Manager(this.graphics);
            theScore_Manager = new Score_Manager(this.graphics);
            theMenu_Manager  = new Menu_Manager(this.graphics);

            // Initializing audio objects
            theAudioEngine = new AudioEngine("Content\\Audio\\Breakout_Audio.xgs");
            theWaveBank    = new WaveBank(theAudioEngine, "Content\\Audio\\Wave Bank.xwb");
            theSoundBank   = new SoundBank(theAudioEngine, "Content\\Audio\\Sound Bank.xsb");

            theMusic_Manager = new Music_Manager();
            gameover         = false;
            base.Initialize();
        }
Пример #2
0
        protected override void Initialize()
        {
            height = graphics.GraphicsDevice.Viewport;
            height.Height = 800;
            graphics.GraphicsDevice.Viewport = height;

            this.graphics.PreferredBackBufferHeight = 800;
            this.graphics.ApplyChanges();

            ball_1 = new Ball(new Vector2(400, 400),  // init Position

                                2,                      // Speed multi, multiplies final speed vector
                                                        // after all other modifications in the game lifetime
                                new Vector2(1, 1));     // init Direction

            ball_2 = new Ball(new Vector2(400, 400),
                                2,
                                new Vector2(1, 1));

            paddle = new Paddle(this.graphics);
            theBrick_Manager = new Brick_Manager(this.graphics);
            theScore_Manager = new Score_Manager(this.graphics);
            theMenu_Manager = new Menu_Manager(this.graphics);

            // Initializing audio objects
            theAudioEngine = new AudioEngine("Content\\Audio\\Breakout_Audio.xgs");
            theWaveBank = new WaveBank(theAudioEngine, "Content\\Audio\\Wave Bank.xwb");
            theSoundBank = new SoundBank(theAudioEngine, "Content\\Audio\\Sound Bank.xsb");

            theMusic_Manager = new Music_Manager();
            gameover = false;
            base.Initialize();
        }