Пример #1
0
        public override void Initialize()
        {
            _gameState = _game.Services.GetService<GameState>();
            // Game Over
            _gameOver = new GameOver(Game);
            _gameOver.Initialize();

            // Level finished
            _levelFinished = new LevelFinished(Game);
            _levelFinished.Initialize();

            _inventoryComponent = new InventoryComponent(Game);
            _inventoryComponent.Initialize();

            _spriteBatch = Game.Services.GetService<SpriteBatch>();

            // Player health
            _playerHealthBar = new ProgressBar(Game, @"Textures\UI\Health", @"Textures\UI\HealthVessel")
            {
                DestinationRectangle = new Rectangle(20, 10, 250, 20),
                Max = _gameState.Player.MaxHealth
            };
            _playerHealthBar.Initialize();

            base.Initialize();
        }
Пример #2
0
 public void Initialize(Game game, Rectangle renderingRectangle)
 {
     _renderingRectangle = renderingRectangle;
     ProgressBar = new ProgressBar(game, @"Textures\UI\Health", @"Textures\UI\HealthVessel")
                       {
                           DestinationRectangle =
                               new Rectangle(renderingRectangle.Left, renderingRectangle.Bottom,
                                             renderingRectangle.Width, 12)
                       };
     ProgressBar.Max = Base.ReuseTime;
     ProgressBar.Initialize();
 }
Пример #3
0
        public override void Initialize()
        {
            _touchService = Game.Services.GetService<ITouchService>();
            _spriteBatch = Game.Services.GetService<SpriteBatch>();
            _gameState = Game.Services.GetService<GameState>();

            _reactionBar = new ProgressBar(Game, @"Textures\UI\PressSequenceBarFiller", @"Textures\UI\PressSequenceBarEmpty")
            {
                Max = ReactionProgressComponent.InitialProgressValue
            };
            _reactionBar.Initialize();

            base.Initialize();
        }