Major rewrite of scripting support:
[supertux.git] / src / object / fireworks.cpp
index 12b79b3..1129097 100644 (file)
@@ -23,7 +23,7 @@
 #include "resources.hpp"
 #include "sector.hpp"
 #include "camera.hpp"
-#include "gameobjs.hpp"
+#include "particles.hpp"
 #include "main.hpp"
 #include "video/drawing_context.hpp"
 #include "audio/sound_manager.hpp"
@@ -46,12 +46,12 @@ Fireworks::update(float )
         pos += Vector(SCREEN_WIDTH * ((float) rand() / RAND_MAX),
                       SCREEN_HEIGHT/2 * ((float) rand() / RAND_MAX));
 
-        int red = rand() % 255;
-        int green = rand() % red;
+        float red = static_cast<float>(rand() % 255) / 255.0;
+        float green = static_cast<float>(rand() % ((int) red*255)) / 255.0;
         sector->add_object(new Particles(pos, 0, 360, Vector(140, 140),
                 Vector(0, 0), 45, Color(red, green, 0), 3, 1.3,
                 LAYER_FOREGROUND1+1));
-        sound_manager->play("sounds/fireworks.ogg");
+        sound_manager->play("sounds/fireworks.wav");
         timer.start(((float) rand() / RAND_MAX) + .5);
     }
 }