private void Interact(Vector3 position, float radius, bool explode)
{
for (int i = 0; i < particle_array.Length; i++)
{
Particle particle = particle_array[i];
if (particle.is_alive)
{
Vector3 direction;
if(explode)
direction = particle.position - position;
else
direction = position - particle.position;
float distance = direction.Length();
if (distance < radius)
{
direction.Normalize();
particle.velocity += direction * 0.1f * (1 - distance / radius);
}
}
}
}