//float green = 0.9;
(void) red;
(void) green;
- sector->add_object(std::make_shared<Particles>(pos, 0, 360, Vector(140, 140),
+ sector->add_object(std::make_shared<Particles>(pos, 0, 360, 140, 140,
Vector(0, 0), 45, Color(red, green, 0), 3, 1.3f,
LAYER_FOREGROUND1+1));
SoundManager::current()->play("sounds/fireworks.wav");
Particle* particle = new Particle;
particle->pos = epicenter;
- float velocity = graphicsRandom.rand(min_initial_velocity, max_initial_velocity);
- float angle = graphicsRandom.rand(min_angle, max_angle) * (M_PI / 180); // convert to radians
+ float velocity = (min_initial_velocity == max_initial_velocity) ? min_initial_velocity :
+ graphicsRandom.rand(min_initial_velocity, max_initial_velocity);
+ float angle = (min_angle == max_angle) ? min_angle * (M_PI / 180) :
+ graphicsRandom.rand(min_angle, max_angle) * (M_PI / 180); // convert to radians
// Note that angle defined as clockwise from vertical (up is zero degrees, right is 90 degrees)
particle->vel.x = (sin(angle)) * velocity;
particle->vel.y = (-cos(angle)) * velocity;