// $Id$
-//
+//
// SuperTux
-// Copyright (C) 2000 Bill Kendrick <bill@newbreedsoftware.com>
-// Copyright (C) 2004 Tobias Glaesser <tobi.web@gmx.de>
+// Copyright (C) 2006 Matthias Braun <matze@braunis.de>
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-//
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA.
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
#include <config.h>
#include <math.h>
#include "sector.hpp"
#include "camera.hpp"
#include "main.hpp"
+#include "random_generator.hpp"
Particles::Particles(const Vector& epicenter, int min_angle, int max_angle,
const Vector& initial_velocity, const Vector& acceleration, int number,
Particle* particle = new Particle;
particle->pos = epicenter;
- float angle = ((rand() % (max_angle-min_angle))+min_angle)
- * (M_PI / 180); // convert to radius
+ float angle = systemRandom.rand(min_angle, max_angle)
+ * (M_PI / 180); // convert to radius (radians?)
particle->vel.x = /*fabs*/(sin(angle)) * initial_velocity.x;
// if(angle >= M_PI && angle < M_PI*2)
// particle->vel.x *= -1; // work around to fix signal
context.draw_filled_rect((*i)->pos, Vector(size,size), color,drawing_layer);
}
}
-