Exemplo n.º 1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            LEVEL_WIDTH  = GraphicsDevice.DisplayMode.Width / 2;
            LEVEL_HEIGHT = GraphicsDevice.DisplayMode.Height / 2;
            graphics.PreferredBackBufferWidth  = LEVEL_WIDTH;
            graphics.PreferredBackBufferHeight = LEVEL_HEIGHT;
            graphics.ApplyChanges();
            this.rodStewart    = Content.Load <Song>("song");
            this.sunshine      = Content.Load <Song>("Sunshine");
            MediaPlayer.Volume = 0.1f;
            MediaPlayer.Play(rodStewart);
            MediaPlayer.IsRepeating = false;
            textStillToType         = true;

            this.level3Sound    = Content.Load <SoundEffect>("lolSoundEffect");
            level3Inst          = this.level3Sound.CreateInstance();
            level3Inst.IsLooped = false;

            this.level7Bus      = Content.Load <SoundEffect>("BusSound");
            level7Inst          = this.level7Bus.CreateInstance();
            level7Inst.IsLooped = true;

            this.typingSound    = Content.Load <SoundEffect>("Keyboard");
            typingInst          = this.typingSound.CreateInstance();
            typingInst.IsLooped = true;

            SoundEffect.MasterVolume = 0.15f;

            // TODO: Add your initialization logic here
            levelNumber = 9;


            levelOne              = new Level1();
            levelOne.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelOne.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelOne.Initialize();


            levelTwo              = new Level2();
            levelTwo.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelTwo.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelTwo.Initialize();

            levelThree              = new Level3();
            levelThree.convoNumber  = 1;
            levelThree.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelThree.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelThree.Initialize();


            levelFour              = new Level4();
            levelFour.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelFour.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelFour.Initialize();

            levelFive              = new Level5();
            levelFive.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelFive.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelFive.Initialize();

            levelSix              = new Level6();
            levelSix.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelSix.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelSix.Initialize();

            levelSeven              = new Level7();
            levelSeven.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelSeven.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelSeven.Initialize();

            levelEight              = new Level8();
            levelEight.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelEight.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelEight.Initialize();

            levelNine              = new Level9();
            levelNine.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelNine.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelNine.Initialize();

            levelTen              = new Level10();
            levelTen.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelTen.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelTen.Initialize();

            levelEle              = new Level11();
            levelEle.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelEle.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelEle.Initialize();


            levelTwe              = new Level12();
            levelTwe.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelTwe.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelTwe.Initialize();

            levelTteen              = new Level13();
            levelTteen.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelTteen.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelTteen.Initialize();

            levelFourteen              = new Level14();
            levelFourteen.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelFourteen.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelFourteen.Initialize();

            levelFifteen              = new Level15();
            levelFifteen.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelFifteen.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelFifteen.Initialize();

            levelSixteen              = new Level16();
            levelSixteen.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelSixteen.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelSixteen.Initialize();

            levelSeventeen              = new Level17();
            levelSeventeen.LEVEL_WIDTH  = LEVEL_WIDTH;
            levelSeventeen.LEVEL_HEIGHT = LEVEL_HEIGHT;
            levelSeventeen.Initialize();



            transition        = false;
            levelProgressBBox = new Rectangle(LEVEL_WIDTH - 140, 0, 140, LEVEL_HEIGHT);
            transitionPos     = new Vector2(0, 0);

            base.Initialize();
        }