Exemplo n.º 1
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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 3
0
        public override void LoadContent()
        {
            base.LoadContent();

            _dartboard.LoadContent(Content);
        }