示例#1
0
        public void Explode(Vector2 position, List <Enemy> _enemies)
        {
            float startX = position.X - _radius;
            float endX   = position.X + _radius;
            float startY = position.Y - _radius;
            float endY   = position.Y + _radius;

            foreach (var enemy in _enemies)
            {
                if (enemy.Position.X >= startX && enemy.Position.X <= endX && enemy.Position.Y >= startY && enemy.Position.Y <= endY)
                {
                    enemy.TakeDamage(this.Damage);
                }
            }

            ParticleSystem.BombExplosion(position, this._radius);
        }