示例#1
0
        /// <summary>
        /// Create a GameManager object
        /// </summary>
        /// <param name="cm">The ContentManager that will be used to load content</param>
        public GameManager(ContentManager cm)
        {
            contentManager = cm;
            inputManager   = new InputManager();
            audioManager   = new AudioManager();
            saveData       = SaveData.Load();

            currentMode = Modes.Menu;

            pointer = new MousePointer(contentManager, inputManager);

            splashScreen = new SplashScreen(contentManager, audioManager);
            titleScreen  = new TitleScreen(contentManager, inputManager);
            mainMenu     = new MainMenu(contentManager, inputManager, saveData, pointer);
            ucMenu       = new UCMenu(contentManager, inputManager, saveData);
            level        = new Level(contentManager, inputManager, saveData);
        }
示例#2
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);

            graphics.PreferredBackBufferWidth  = screenWidth;
            graphics.PreferredBackBufferHeight = screenHeight;

            ScreenRectangle = new Rectangle(
                0,
                0,
                screenWidth,
                screenHeight);

            Content.RootDirectory = "Content";

            Components.Add(new InputHandler(this));

            stateManager = new GameStateManager(this);
            Components.Add(stateManager);

            TitleScreen              = new TitleScreen(this, stateManager);
            StartMenuScreen          = new StartMenuScreen(this, stateManager);
            GamePlayScreen           = new GamePlayScreen(this, stateManager);
            AdminScreen              = new AdminScreen(this, stateManager);
            CharacterGeneratorScreen = new CharacterGeneratorScreen(this, stateManager);
            EndGameScreen            = new EndGameScreen(this, stateManager);
            PauseScreen              = new PauseScreen(this, stateManager);
            highscoreScreen          = new HighscoreScreen(this, stateManager);
            upgradeScreen            = new UpgradeScreen(this, stateManager);
            saveHistory              = new SaveHistoryScreen(this, stateManager);
            initPrice = new InitialPriceScreen(this, stateManager);

            spaceShip = new SpaceShip();
            board     = new Board();

            stateManager.ChangeState(TitleScreen);
        }