Esempio n. 1
0
        private void CreateHudSystem()
        {
            HUDSystem = new HUDSystem(Content.Load <SpriteFont>("Fonts/HUDFont"), Content);

            // Create the debugging widget (Only shows in admin mode)
            _debugWidget = new TextWidget(_gameInfo, HUDAlignment.BottomLeft, i => i.Fsm.ToString());

            // Create an avatar widget
            var avatarWidget = new AvatarWidget(_gameInfo, HUDAlignment.TopLeft);

            HUDSystem.Add(avatarWidget);

            // Create a widget for the game type that the user will be playing
            HUDWiget gameTypeWidget = null;

            switch (_gameInfo.GameRuleType)
            {
            case GameRuleType.Retirement: gameTypeWidget = new AgeCounterWidget(_gameInfo, HUDAlignment.TopCenter); break;

            case GameRuleType.Passport: gameTypeWidget = new PassportWidget(_gameInfo, HUDAlignment.TopCenter); break;
            }
            HUDSystem.Add(gameTypeWidget);

            // Create the current highscore list widget
            var highscoreList = new Leaderboarder(_gameInfo, HUDAlignment.TopRight);

            HUDSystem.Add(highscoreList);

            ScreenManager.AddGameLayer(HUDSystem, true);
        }