main menu added
This commit is contained in:
@@ -31,7 +31,7 @@ namespace Particles.ParticleSimulation
|
||||
// counts up for each particle added
|
||||
private int _idCount;
|
||||
|
||||
private const int MaxParticles = 1100;
|
||||
private int _maxParticles;
|
||||
private const int MaxParticleTypes = 10;
|
||||
|
||||
private const float HealthDelta = 0.005f;
|
||||
@@ -40,8 +40,9 @@ namespace Particles.ParticleSimulation
|
||||
|
||||
private const float ParticleCollisionRadius = 20f;
|
||||
|
||||
public void Initialize()
|
||||
public void Initialize(int nParticles)
|
||||
{
|
||||
_maxParticles = nParticles;
|
||||
for (var i = 0; i < MaxParticleTypes; i++)
|
||||
CreateRandomParticleType();
|
||||
}
|
||||
@@ -129,9 +130,9 @@ namespace Particles.ParticleSimulation
|
||||
}
|
||||
|
||||
// ReSharper disable once InvertIf
|
||||
if (_particles.Count < MaxParticles)
|
||||
if (_particles.Count < _maxParticles)
|
||||
{
|
||||
for (var i = 0; i < 3 && _particles.Count < MaxParticles; i++)
|
||||
for (var i = 0; i < 3 && _particles.Count < _maxParticles; i++)
|
||||
CreateRandomParticle();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user