Exemplo n.º 1
0
 public void DrawTrails(SpriteBatch spriteBatch, TrailLayer layer)
 {
     foreach (BaseTrail trail in _trails)
     {
         if (trail.Layer == layer)
         {
             trail.Draw(_effect, _basicEffect, spriteBatch.GraphicsDevice);
         }
     }
 }
Exemplo n.º 2
0
        public Trail(Projectile projectile, ITrailColor type, ITrailCap cap, ITrailPosition position, ITrailShader shader, TrailLayer layer, float widthAtFront, float maxLength, float dissolveSpeed) : base(projectile, layer)
        {
            _trailCap          = cap;
            _trailColor        = type;
            _trailPosition     = position;
            _trailShader       = shader;
            _maxLength         = maxLength;
            _widthStart        = widthAtFront;
            DissolveSpeed      = dissolveSpeed == -1 ? _maxLength / 10 : dissolveSpeed;
            _originalMaxLength = maxLength;
            _originalWidth     = _widthStart;

            _points = new List <Vector2>();
        }
Exemplo n.º 3
0
        public void CreateTrail(Projectile projectile, ITrailColor trailType, ITrailCap trailCap, ITrailPosition trailPosition, float widthAtFront, float maxLength, ITrailShader shader = null, TrailLayer layer = TrailLayer.UnderProjectile, float dissolveSpeed = -1)
        {
            var newTrail = new Trail(projectile, trailType, trailCap, trailPosition, shader ?? new DefaultShader(), layer, widthAtFront, maxLength, dissolveSpeed);

            newTrail.BaseUpdate();
            _trails.Add(newTrail);
        }
Exemplo n.º 4
0
 public BaseTrail(Projectile projectile, TrailLayer layer)
 {
     MyProjectile            = projectile;
     Layer                   = layer;
     _originalProjectileType = projectile.type;
 }
Exemplo n.º 5
0
 public VNoiseMotionTrail(Projectile projectile, Color color, float width, float opacity, TrailLayer layer = TrailLayer.UnderProjectile) : base(projectile, layer)
 {
     _startPoint   = projectile.Center;
     _endPoint     = projectile.Center;
     _startWidth   = width;
     _width        = width;
     _color        = color;
     _startOpacity = opacity;
     _opacity      = opacity;
 }
Exemplo n.º 6
0
 public FlameTrail(Projectile projectile, Color startColor, Color midColor, Color endColor, float width, int maxPoints, float opacity = 1, TrailLayer layer = TrailLayer.UnderProjectile) : base(projectile, layer)
 {
     _points        = new List <Vector2>();
     _width         = width;
     _maxPoints     = maxPoints;
     _deathProgress = 1f;
     _startColor    = startColor;
     _midColor      = midColor;
     _endColor      = endColor;
 }