I followed rbwhitakers tutorial on making a particle engine and I'm wondering how to get more particles on the screen. I was thinking that the "total" variable would do it but it doesnt. Is this something I'm doing wrong in the method or a hardware problem?
private Particle GenerateNewParticle()
{
Texture2D texture = textures[random.Next(textures.Count)];
Vector2 position = EmitterLocation;
Vector2 velocity = new Vector2(0, 10);
float angle = 0;
float angularVelocity = 0;
Color color = Color.LightSkyBlue;
float size = (float)random.NextDouble();
int ttl = 100;
return new Particle(texture, position, velocity, angle, angularVelocity, color, size, ttl);
}
public void Update()
{
int total = 100;
for (int i = 0; i < total; i++)
{
particles.Add(GenerateNewParticle());
}
for (int particle = 0; particle < particles.Count; particle++)
{
particles[particle].Update();
if (particles[particle].TTL <= 0 || particles[particle].Position.Y > 550)
{
particles.RemoveAt(particle);
particle--;
}
}
}
Im creating rain but I want it to be really heavy rain. Right now it just looks like a heavy sprinkle...I guess I would call it.
particleEngine.EmitterLocation = new Vector2((float)rand.NextDouble() * (graphics.GraphicsDevice.Viewport.Width), 0);