예제 #1
0
        /// <summary>
        /// The constructor is private: loading screens should
        /// be activated via the static Load method instead.
        /// </summary>
        private LoadingScreen( ScreenManager screenManager, bool loadingIsSlow,
                              Screen[] screensToLoad )
        {
            State = ScreenState.Active;
            this.loadingIsSlow = loadingIsSlow;
            this.screensToLoad = screensToLoad;

            //TransitionOnTime = TimeSpan.FromSeconds(0.5);
        }
예제 #2
0
        /// <summary>
        /// Activates the loading screen.
        /// </summary>
        public static void Load( ScreenManager screenManager, bool loadingIsSlow,
                                params Screen[] screensToLoad )
        {
            GameEngine.AudioManager.Play( AudioManager.MusicSelection.loading_sound );
            // Tell all the current screens to transition off.
            foreach ( Screen screen in screenManager.GetScreens() )
                screenManager.RemoveScreen( screen );

            // Create and activate the loading screen.
            LoadingScreen loadingScreen = new LoadingScreen( screenManager,
                                                            loadingIsSlow,
                                                            screensToLoad );

            screenManager.AddScreen( loadingScreen );
        }
예제 #3
0
        public GameEngine()
        {
            graphics = new GraphicsDeviceManager( this );
            //Components.Add(new GamerServicesComponent(this));
            Content.RootDirectory = "Content";
            engine_content = Content;
            ScreenManager = new ScreenManager( this );
            audioManager = new AudioManager();
            audioManager.LoadContent( Content );
            //audioManager.Initialize();
            levelManager = new LevelManager();
            window = this.Window;
            //Adds ScreenManager as a component, making all of its calls done automatically
            Components.Add( ScreenManager );

            GameEngine.AudioManager.Play( AudioManager.MusicSelection.ninjawarrior );
        }