コード例 #1
0
 public void TurnParticleInTwister(Vector2 position, Vector2 center)
 {
     velocity      = Vector2.Zero;
     particleStyle = ParticleSystemSource.ParticleStyle.Twister;
     this.position = position + new Vector2(150, 150);
     this.center   = center;
 }
コード例 #2
0
 public Particle(int lifeTime, int frameIndex, float rotation, float rotationSpeed, float scale, float maxVelocity, float spawnRotation, ParticleSystemSource.ParticleStyle particleStyle, Point spawnPoint, ParticleSystemSource system)
 {
     parentSystem     = system;
     this.lifeTime    = lifeTime;
     this.frameIndex  = frameIndex;
     this.rotation    = rotation;
     this.scale       = scale;
     this.maxVelocity = maxVelocity;
     if (particleStyle != ParticleSystemSource.ParticleStyle.Explosion || particleStyle != ParticleSystemSource.ParticleStyle.Implosion)
     {
         CalculateVelocity(spawnRotation, maxVelocity);
     }
     else if (particleStyle == ParticleSystemSource.ParticleStyle.Rain)
     {
         velocity = new Vector2(0, maxVelocity);
     }
     this.rotationSpeed = rotationSpeed;
     this.particleStyle = particleStyle;
     position           = spawnPoint.ToVector2();
 }