Exemple #1
0
        protected override void Initialize()
        {
            engine = new AudioEngine("Content\\Audio\\sound.xgs");
            soundBank = new SoundBank(engine, "Content\\Audio\\Sound Bank.xsb");
            waveBank = new WaveBank(engine, "Content\\Audio\\Wave Bank.xwb");

            MenuMusic = soundBank.GetCue("drumLoop");
            GameOver = soundBank.GetCue("gameOver");

            newGame = new Rectangle(350, 500, 100, 20);
            options = new Rectangle(350, 520, 80, 20);
            controls = new Rectangle(350, 540, 80, 20);
            quit = new Rectangle(350, 560, 60, 20);

            enemiesData = Content.Load<EnemyData[]>("Enemies");
            levelsData = Content.Load<LevelData[]>("Levels");
            levels = new Level[levelsData.Length];

            for (int i = 0; i < levelsData.Length; i++)
            {
                Level newLevel;

                if (levelsData[i].s_LevelName == "Tutorial")
                {
                    newLevel = new Tutorial(levelsData[i]);
                }
                else
                {
                    newLevel = new Level(levelsData[i]);
                }

                newLevel.Initialize(soundBank);
                levels[i] = newLevel;
            }

            gameEngine = new Engine();
            gameEngine.Initialize(soundBank);

            fd_Fader = new Fader();
            fd_Fader.Initialize(this);

            base.Initialize();
        }
Exemple #2
0
 public void BeginFadingToBlack(float max, bool fadeIn, Tutorial tutorial)
 {
     BeginFadingToBlack(max, fadeIn);
     fadeToBlackDelegate = new FinishedFadingToBlackDelegate(tutorial.FinishedFadingToBlack);
 }