Exemple #1
0
        /// <summary>
        /// Initializes all game elements
        /// </summary>
        protected override void Initialize()
        {
            this.IsMouseVisible = true;

            // Add InputState
            input = new InputState();
            input.Update();
            Services.AddService(typeof(InputState), input);

            // Create a SpriteBatch for darwing.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            Services.AddService(typeof(SpriteBatch), spriteBatch);

            //Create and add audioLibrary
            audio = new AudioLibrary();
            Services.AddService(typeof(AudioLibrary), audio);

            // Create and add the screens
            back = new Background(this); Components.Add(back);
            timesTable = new TimesTable(this); Components.Add(timesTable);
            menu = new Menu(this); Components.Add(menu);
            intro = new Intro(this); Components.Add(intro);
            test = new Test(this); Components.Add(test);
            help = new Help(this); Components.Add(help);
            menu.Show(input);

            base.Initialize();
        }