Explicitly defined the angle used by Particles, used new definition for particles...
[supertux.git] / src / object / particles.cpp
index 1babe23..b468a93 100644 (file)
@@ -90,8 +90,9 @@ Particles::Particles(const Vector& epicenter, int min_angle, int max_angle,
 
     float velocity = graphicsRandom.rand(min_initial_velocity, max_initial_velocity);
     float angle = graphicsRandom.rand(min_angle, max_angle) * (M_PI / 180);  // convert to radians
-    particle->vel.x = (cos(angle)) * velocity;
-    particle->vel.y = (-sin(angle)) * velocity;
+    // 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;
 
     particles.push_back(particle);
   }