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"; }
public GameWinWorld(GameStateAgent agent) : base(agent) { MusicManager.Instance.PlayWinMusic(); var screen = new GameWinMenu(agent); Updatables = new IUpdatable[] { new GameWinControllerKeyboard(agent, screen), screen }; ScaledDrawables = new IDrawable[] { screen }; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { SpriteBatch = new SpriteBatch(GraphicsDevice); Player = new Player(new Vector2(EntityWidth * (float)PlayerStartColumn, EntityHeight * (float)(PlayerStartRow + 1))); m_DebugText = Content.Load <SpriteFont>("Fonts/Joystix_12"); MapManager.LoadMaps(); //Maps must be loaded before levels - H.E. LevelManager.LoadLevels(); MainMenu.LoadContent(); LevelTransition.LoadContent(); HUD.LoadContent(); GameOverMenu.LoadContent(); GameWinMenu.LoadContent(); LevelTransition.LoadContent(); Leaderboard.LoadContent(); GetLeaderBoardResultsAsync(); m_DebugPixel = new Texture2D(GraphicsDevice, 1, 1, false, SurfaceFormat.Color); m_DebugPixel.SetData(new[] { Color.White }); ScanLines = Content.Load <Texture2D>("UI/ScanLines"); Border = Content.Load <Texture2D>("UI/Border"); MenuMusic = Content.Load <SoundEffect>("Sounds/Menu"); GameMusic = Content.Load <SoundEffect>("Sounds/Main"); //Sounds/Last_slice_hiphop }
public async Task PostScoreAsync(string score, string initials) { string result = await GameService.PostScoreAsync(score, initials); GameWinMenu.SetCustomString(result); }