#include "random_generator.hpp"
ParticleSystem::ParticleSystem(float max_particle_size)
- : max_particle_size(max_particle_size)
+ : max_particle_size(max_particle_size)
{
virtual_width = SCREEN_WIDTH + max_particle_size * 2;
virtual_height = SCREEN_HEIGHT + max_particle_size *2;
particle->pos.y = systemRandom.randf(SCREEN_HEIGHT);
int size = systemRandom.rand(2);
particle->texture = ghosts[size];
- do {
- particle->speed = size*.2 + systemRandom.randf(3.6);
- } while(particle->speed < 1);
- particle->speed *= 50;
+ particle->speed = systemRandom.randf(std::max(50, (size * 10)), 180 + (size * 10));
particles.push_back(particle);
}
}
}
CloudParticleSystem::CloudParticleSystem()
- : ParticleSystem(128)
+ : ParticleSystem(128)
{
cloudimage = new Surface("images/objects/particles/cloud.png");