fixed broken 1-time animations in sprites, fixed collision code returning no-collisio...
[supertux.git] / src / particlesystem.cpp
index ea301d8..b82152a 100644 (file)
@@ -18,6 +18,8 @@
 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 
+#include <config.h>
+
 #include <iostream>
 #include <cmath>
 
@@ -86,8 +88,9 @@ SnowParticleSystem::SnowParticleSystem()
         int snowsize = rand() % 3;
         particle->texture = snowimages[snowsize];
         do {
-            particle->speed = snowsize/60.0 + (float(rand()%10)/300.0);
-        } while(particle->speed < 0.01);
+            particle->speed = snowsize*.2 + (float(rand()%10)*.4);
+        } while(particle->speed < 1);
+        particle->speed *= 10; // gravity
 
         particles.push_back(particle);
     }
@@ -138,7 +141,7 @@ CloudParticleSystem::CloudParticleSystem()
         particle->pos.x = rand() % int(virtual_width);
         particle->pos.y = rand() % int(virtual_height);
         particle->texture = cloudimage;
-        particle->speed = -float(250 + rand() % 200) / 1000.0;
+        particle->speed = -float(25 + rand() % 30);
 
         particles.push_back(particle);
     }