Exemplo n.º 1
0
        private void LoadNextLevel()
        {
            if (levelIndex == MaxLevelIndex)
            {
                score = level.Score;

                LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen());
                return;
            }

            score = 0;
            // Unloads the content for the current level before loading the next one.
            if (level != null)
            {
                score = level.Score; level.Dispose();
            }

            // Load the level.
            level = new Level(ScreenManager.GameContent, levelIndex, (int)score); ++levelIndex;
        }
Exemplo n.º 2
0
        /// <summary>
        /// The main game constructor.
        /// </summary>
        public BitSitsGames()
        {
            Content.RootDirectory = "Content";

            graphics = new GraphicsDeviceManager(this);

            graphics.PreferredBackBufferWidth  = 375;
            graphics.PreferredBackBufferHeight = 600;

            IsMouseVisible = true;

            // Create the screen manager component.
            screenManager = new ScreenManager(this);

            Components.Add(screenManager);

            LoadingScreen.Load(screenManager, true, null, new IntroScreen("intro"));

            // TEST LEVELS
            //LoadingScreen.Load(screenManager, false, PlayerIndex.One, new GameplayScreen());
        }
Exemplo n.º 3
0
 /// <summary>
 /// Event handler for when the Quit Game menu entry is selected.
 /// </summary>
 void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen());
 }
Exemplo n.º 4
0
 /// <summary>
 /// Event handler for when the Play Game menu entry is selected.
 /// </summary>
 void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
 {
     LoadingScreen.Load(ScreenManager, false, e.PlayerIndex,
                        new GameplayScreen());
 }