オブジェクトを一括管理する
Inheritance: IBulletManager
Beispiel #1
0
 public Boss(DnK game)
     : base(game)
 {
     MoverManager = new MoverManager(Game);
     GameManager.GameDifficulty = Config.GameDifficultyDelegate;
     DefeatNumber = 0;
     _speed = 1f;
 }
Beispiel #2
0
 public BossCore(
     DnK gameRef, 
     Entity parent, 
     PositionDelegate playerPositionDelegate, 
     MoverManager moverManager,
     List<BulletPattern> bulletPatterns,
     float initialHp = 100f)
     : base(gameRef)
 {
     _parent = parent;
     _hp = initialHp;
     _activated = false;
     _playerPositionDelegate = playerPositionDelegate;
     _moverManager = moverManager;
     _bulletPatterns = bulletPatterns;
 }
Beispiel #3
0
        public Boss(DnK gameRef, List<Player> players, int iteration = 50, float step = 25)
        {
            _gameRef = gameRef;
            _defeatCounter = 0;
            MoverManager = new MoverManager(gameRef);
            GameManager.GameDifficulty = Config.GameDifficultyDelegate;
            _players = players;
            _iteration = iteration;
            _step = step;
            _previousBossPart = null;

            _parts = new List<BossPart>();
            _currentPartIndex = 0;

            int targetPlayerId = _gameRef.Rand.Next(0, _players.Count);
            MoverManager.Initialize(_players[targetPlayerId].GetPosition);
        }
Beispiel #4
0
 public Turret(
     DnK gameRef, 
     Entity parent, 
     Entity target,
     MoverManager moverManager,
     Vector2 initialPosition, 
     BulletPattern pattern, 
     Color color)
     : base(gameRef)
 {
     _initialPosition = initialPosition;
     X = InitialPosition.X;
     Y = InitialPosition.Y;
     _parent = parent;
     _target = target;
     _moverManager = moverManager;
     _pattern = pattern;
     _timer = new TimeSpan(0, 0, (int)(GameRef.Rand.NextDouble() * 30));
     _color = color;
     Scale = new Vector2(0.5f, 0.5f);
 }
Beispiel #5
0
        public BossPart(
            DnK gameRef,
            Boss bossRef,
            List<Player> playerList,
            MoverManager moverManager, 
            List<BulletPattern> bulletPatterns, 
            Color color, 
            float initialHealth,
            int iteration = 50, 
            float step = 25,
            List<Turret> turrets = null,
            PolygonShape polygonShape = null,
            bool mainPart = false)
            : base(gameRef)
        {
            _bossRef = bossRef;
            _mainPart = mainPart;
            _players = playerList;
            _moverManager = moverManager;
            _bulletPatterns = bulletPatterns ?? new List<BulletPattern>();

            _health = initialHealth;
            _displayHp = false;
            _color = color;

            _iteration = iteration;
            _step = step;

            _accelerationDecreaseFactor = 0.00075f;

            _turrets = turrets ?? new List<Turret>();
            _polygonShape = polygonShape;
            _collisionBoxesHp = new Dictionary<CollisionConvexPolygon, float>();
            _targetPosition = Vector2.Zero;
            _targetAngle = 0f;
        }
        public override void Initialize()
        {
            _backgroundMainRectangle = new Rectangle(0, 0, Config.GameArea.X, Config.GameArea.Y);

            // Bullet manager
            _moverManager = new MoverManager((DnK)Game);
            GameManager.GameDifficulty = Config.GameDifficultyDelegate;

            base.Initialize();

            _defaultView = GraphicsDevice.Viewport;

            // First player
            _player = new Player(GameRef, _defaultView, 1, Config.PlayersController[0], new Vector2(Config.GameArea.X / 2f, Config.GameArea.Y - 150));
            _player.Initialize();

            _moverManager.Initialize(_player.GetPosition);
            _moverManager.movers.Clear();

            AddBullet(true);

            // Watch the bullet pattern file
            _watcher = new FileSystemWatcher
            {
                Path = _patternDirectory,
                NotifyFilter = NotifyFilters.LastWrite,
                Filter = _patternFileName
            };

            // Add event handler
            _watcher.Changed += OnChanged;

            // Begin watching
            _watcher.EnableRaisingEvents = true;
        }