Beispiel #1
0
        public override void LoadContent()
        {
            _bustScreen = new TimeoutScreen("Bust", TimeSpan.FromSeconds(3))
            {
                Color = Color.Red
            };

            _bustScreen.OnTimeout += bustScreenTimeout;

            _bustScreen.LoadContent();

            _awardScreen = new AwardScreen();
            _awardScreen.LoadContent();

            base.LoadContent();
        }
Beispiel #2
0
        public override void LoadContent()
        {
            if (Content == null)
            {
                Content = new ContentManager(XnaDartsGame.ScreenManager.Game.Services, @"Content");
            }

            _background = Content.Load<Texture2D>(@"Images\Backgrounds\AbstractBackground"); // XnaDartsGame.Options.Theme

            SerialManager.Instance().OnDartRegistered = registerDart;
            SerialManager.Instance().OnDartHit = null;

            _dartboard = new Dartboard();
            _dartboard.LoadContent(Content);
            _dartboard.OnSegmentClicked += registerDart;
            _dartboard.Scale = 0.5f;

            _playerChangeScreen = new PlayerChangeScreen("Player Change",
                TimeSpan.FromSeconds(XnaDartsGame.Options.PlayerChangeTimeout));
            _playerChangeScreen.LoadContent();
            _playerChangeScreen.OnTimeout += playerChange;

            _throwDartsScreen = new TimeoutScreen(Mode.CurrentPlayer.Name + " throw darts!", TimeSpan.FromSeconds(3));
            _newRoundTimeoutScreen = new TimeoutScreen("Round 1", TimeSpan.FromSeconds(3));
            _newRoundTimeoutScreen.OnTimeout += startTurn;

            foreach (var drawableGameComponent in GuiComponents)
            {
                drawableGameComponent.LoadContent(Content);
            }

            startGame();
        }