protected Boss(XmasHell game, BossType type, PositionDelegate playerPositionDelegate) { Game = game; BossType = type; _playerPositionDelegate = playerPositionDelegate; InitialPosition = new Vector2( Game.ViewportAdapter.VirtualWidth / 2f, Game.ViewportAdapter.VirtualHeight * 0.15f ); InitialLife = GameConfig.BossDefaultLife; // Behaviours Behaviours = new List <AbstractBossBehaviour>(); // BulletML BulletPatternFiles = new List <string>(); HitColor = Color.White * 0.5f; _hpBar = new Sprite( new TextureRegion2D( Assets.GetTexture2D("pixel"), 0, 0, GameConfig.VirtualResolution.X, 50 ) ) { Origin = Vector2.Zero, Color = Color.Red }; Game.SpriteBatchManager.Boss = this; Game.SpriteBatchManager.UISprites.Add(_hpBar); _timerLabel = new AbstractGuiLabel("00:00", Assets.GetFont("Graphics/Fonts/ui-small"), new Vector2(Game.ViewportAdapter.VirtualWidth / 2f, 25), Color.White, true); Game.SpriteBatchManager.UILabels.Add(_timerLabel); // To compute line/wall intersection _bottomWallLine = new Line( new Vector2(0f, GameConfig.VirtualResolution.Y), new Vector2(GameConfig.VirtualResolution.X, GameConfig.VirtualResolution.Y) ); _leftWallLine = new Line( new Vector2(0f, 0f), new Vector2(0f, GameConfig.VirtualResolution.Y) ); _rightWallLine = new Line( new Vector2(GameConfig.VirtualResolution.X, 0f), new Vector2(GameConfig.VirtualResolution.X, GameConfig.VirtualResolution.Y) ); _upWallLine = new Line( new Vector2(0f, 0f), new Vector2(GameConfig.VirtualResolution.X, 0f) ); }
public override void LoadContent() { base.LoadContent(); _spriterFile = Assets.GetSpriterAnimators("Graphics/GUI/game-screen"); InitializeSpriterGui(); _timerLabel = new AbstractGuiLabel("00:00:00", Assets.GetFont("Graphics/Fonts/ui-small"), new Vector2(Game.ViewportAdapter.VirtualWidth - 95, 30), Color.White, true); _timerLabelShadow = new AbstractGuiLabel("00:00:00", Assets.GetFont("Graphics/Fonts/ui-small"), new Vector2(_timerLabel.Position.X + 1, _timerLabel.Position.Y + 1), Color.Black, true); _hpBar = new Sprite( new TextureRegion2D( Assets.GetTexture2D("pixel"), 0, 0, GameConfig.VirtualResolution.X, 10 ) ) { Origin = Vector2.Zero, Color = Color.Red }; }