Exemple #1
0
        public TheLastSliceGame()
        {
            Graphics = new GraphicsDeviceManager(this);
            Graphics.IsFullScreen                   = false;
            Graphics.PreferMultiSampling            = false;
            Graphics.SynchronizeWithVerticalRetrace = true;
            GameService           = new GameService();
            Content.RootDirectory = "Content";
            Instance        = this;
            Random          = new System.Random();
            MapManager      = new MapsMananger();
            LevelManager    = new LevelManager();
            InputManager    = new InputManager();
            MainMenu        = new MainMenu();
            LevelTransition = new LevelTransitionScreen();
            HUD             = new GameplayHUD();
            GameOverMenu    = new GameOverMenu();
            GameWinMenu     = new GameWinMenu();
            Leaderboard     = new LeaderboardMenu();
            ChangeState(GameState.Menu, UIType.MainMenu);
            AppInsights = new AppInsightsClient();

            GameWidth         = 800;
            GameHeight        = 600;
            EntityWidth       = 50;
            EntityHeight      = 50;
            PlayerStartRow    = 1;
            PlayerStartColumn = 0;

            //Setting this here means that anywhere in the game, a new TelemetryClient can be created and will get the correct ID.
            TelemetryConfiguration.Active.InstrumentationKey = "1445a599-ec52-4962-9abd-62b3cdae33b3";
        }
Exemple #2
0
        public SpaceInvadersGame()
        {
            Content.RootDirectory = "Content";
            LevelTransitionScreen levelTransitionScreen = new LevelTransitionScreen(this);
            PlayScreen            playScreen            = new PlayScreen(levelTransitionScreen, this);
            ScreensManager        screensManager        = new ScreensManager(this);

            screensManager.Push(new GameOverScreen(playScreen, this));
            screensManager.Push(playScreen);
            screensManager.Push(levelTransitionScreen);
            screensManager.SetCurrentScreen(new WelcomeScreen(this));
            this.IsMouseVisible = true;
        }