Exemple #1
0
        public override async void Update(GameTime gameTime)
        {
            if (!_loaded && XboxLiveManager.SignedIn)
            {
                _loaded          = true;
                _achievementData = await XboxLiveManager.GetAchievementsAsync();

                for (int index = 0; index < _achievementData.Count; index++)
                {
                    AchievementData    ad      = _achievementData[index];
                    AchievementDisplay display = new AchievementDisplay(MonsterGame.Instance, ad);
                    display.Size = _achievementSize;
                    if (index % 2 == 0)
                    {
                        display.Position = _offset + new Vector2(((_achievementSize.X + 20) * index / 2), 0);
                    }
                    else
                    {
                        display.Position = _offset + new Vector2(((_achievementSize.X + 20) * (index - 1) / 2), (_achievementSize.Y + 20));
                    }

                    _achievementDisplay.Add(display);
                }
            }

            if (InputManager.CurrentState.Back || InputManager.CurrentState.Start)
            {
                MonsterGame.Instance.SetState(GameState.TitleScreen);
            }

            base.Update(gameTime);
        }
Exemple #2
0
        public override async void Update(GameTime gameTime)
        {
            if (!_loaded && XboxLiveManager.SignedIn)
            {
                _loaded          = true;
                _leaderboardData = await XboxLiveManager.GetLeaderboardAsync("ScoreLeaderboard");
            }

            if (InputManager.CurrentState.Back || InputManager.CurrentState.Start)
            {
                MonsterGame.Instance.SetState(GameState.TitleScreen);
            }

            base.Update(gameTime);
        }
Exemple #3
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override async void Initialize()
        {
            Scaler = new RenderTargetScaler(this, _graphicsDeviceManager, ScreenWidth, ScreenHeight);

#if WINDOWS
            Scaler.IsEnabled = false;
#endif

            SetState(GameState.TitleScreen);

            XboxLiveManager.Initialize(_graphicsDeviceManager.GraphicsDevice);

#if WINDOWS_UAP
            if (!ApiInformation.IsApiContractPresent("Windows.Phone.PhoneContract", 1))
#endif
            {
                await XboxLiveManager.SignInAsync();
            }
            base.Initialize();
        }