Ejemplo n.º 1
0
        public override void LoadContent()
        {
            // Create our menu entries.
            MenuEntry startGameMenuEntry = new MenuEntry("Start");
            MenuEntry exitMenuEntry      = new MenuEntry("Exit");

            // Calculate menu positions - we do this here since we want the screen
            // manager to be available
            int quarterViewportWidth = ScreenManager.GraphicsDevice.Viewport.Width / 4;
            int menuEntryHeight      = SafeArea.Bottom - ScreenManager.ButtonBackground.Height * 2;

            startGameMenuEntry.Position = new Vector2(quarterViewportWidth -
                                                      ScreenManager.ButtonBackground.Width / 2, menuEntryHeight);
            exitMenuEntry.Position = new Vector2(3 * quarterViewportWidth -
                                                 ScreenManager.ButtonBackground.Width / 2, menuEntryHeight);

            // Hook up menu event handlers.
            startGameMenuEntry.Selected += StartGameMenuEntrySelected;
            exitMenuEntry.Selected      += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(startGameMenuEntry);
            MenuEntries.Add(exitMenuEntry);

            AudioManager.LoadSounds();
            AudioManager.LoadMusic();

            AudioManager.PlayMusic("MenuMusic_Loop");

            base.LoadContent();
        }
Ejemplo n.º 2
0
        public override void LoadContent()
        {
            AudioManager.LoadSounds();
            AudioManager.LoadMusic();

            AudioManager.PlayMusic("MenuMusic_Loop");

            base.LoadContent();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Loads content and assets.
        /// </summary>
        public void LoadAssets()
        {
            // Loads the animation dictionary from an xml file
            animations = new Dictionary <string, ScaledAnimation>();
            LoadAnimationFromXML();

            // Loads all textures that are required
            LoadTextures();

            // Create all game components
            CreateGameComponents();

            AudioManager.PlayMusic("InGameSong_Loop");
        }