Пример #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            this.Services.AddService(typeof(SpriteBatch), spriteBatch);
            // TODO: use this.Content to load your game content here

            //load all sounds
            SoundManager.LoadContent(Content);

            //load all resource
            m_ResourceManager = new ResourceManager(this.Content);
            m_ResourceManager.LoadAllResource();
            this.Services.AddService(typeof(ResourceManager), m_ResourceManager);

            m_InputManager = new InputManager();

            //load scences
            m_HelpScence = new HelpScence(this, ResourceManager.imgBackgroundHelpScence, ResourceManager.imgForegroundHelpScence);
            m_StartScence = new StartScence(this, ResourceManager.smallFont, ResourceManager.largeFont, ResourceManager.imgBackgroundStartScence, ResourceManager.imgForegroundStartScence, ResourceManager.imgButton);
            m_ActionScence = new ActionScence(this);

            this.Components.Add(m_HelpScence);
            this.Components.Add(m_StartScence);
            this.Components.Add(m_ActionScence);

            //begin at start scence
            m_StartScence.ShowScreen();
            this.m_ActiveScence = m_StartScence;
        }
Пример #2
0
 private void ShowScence(GameScence scence)
 {
     m_ActiveScence.HideScreen();
     m_ActiveScence = scence;
     scence.ShowScreen();
 }