Example #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";
        }
Example #2
0
 private void NewGame()
 {
     //It's time to kick a** and chew bubblegum... and I'm all outta gum.
     MapManager   = new MapsMananger();
     LevelManager = new LevelManager();
     MapManager.LoadMaps();
     LevelManager.LoadLevels();
     LevelManager.NextLevel();
     MapManager.ChangeMap(MapManager.Maps[0]);
     ChangeState(GameState.Game);
 }