Beispiel #1
0
 public override void Initialize()
 {
     options = game.getOptions();
     if (options.getOptionsData().invertY)
     {
         invertY = -1;
     }
     else
     {
         invertY = 1;
     }
     controllerNo = options.getOptionsData().controller;
     lastGamePadState = GamePad.GetState(controllerNo);
 }
Beispiel #2
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()
        {
            intro = new Intro(this);
            level1 = new Level1(this);
            level2 = new Level2(this);
            levels = new Queue<ILevel>();
            levels.Enqueue(intro);
            //levels.Enqueue(level1);
            levels.Enqueue(level2);
            currentLevel = levels.Dequeue();
            Components.Add(currentLevel);

            options = new Options();

            musicEngine = new MusicPlayer(this, "Content//Sound//Music//music", 0); //extensions are purposly missed off and are autmatically added by the MusicPlayer class
            soundEngine = new SoundPlayer(this, "Content//Sound//Sound//Sounds");

            healthMeter = new HealthMeter(this);
            healthMeter.DrawOrder = 10;
            Components.Add(healthMeter);

            scoreMeter = new Score(this);
            scoreMeter.DrawOrder = 10;
            Components.Add(scoreMeter);

            base.Initialize();
        }