#include "object/camera.hpp"
#include "object/fireworks.hpp"
#include "object/particles.hpp"
-#include "supertux/main.hpp"
+#include "supertux/globals.hpp"
#include "supertux/sector.hpp"
#include "video/drawing_context.hpp"
-Fireworks::Fireworks()
+Fireworks::Fireworks() :
+ timer()
{
timer.start(.2f);
- sound_manager->preload("sounds/fireworks.wav");
+ SoundManager::current()->preload("sounds/fireworks.wav");
}
Fireworks::~Fireworks()
if(timer.check()) {
Sector* sector = Sector::current();
Vector pos = sector->camera->get_translation();
- pos += Vector(systemRandom.randf(SCREEN_WIDTH),
- systemRandom.randf(SCREEN_HEIGHT/2));
+ pos += Vector(graphicsRandom.randf(SCREEN_WIDTH),
+ graphicsRandom.randf(SCREEN_HEIGHT/2));
- float red = systemRandom.randf(1.0);
- float green = systemRandom.randf(1.0);
+ float red = graphicsRandom.randf(1.0);
+ float green = graphicsRandom.randf(1.0);
//float red = 0.7;
//float green = 0.9;
(void) red;
sector->add_object(new Particles(pos, 0, 360, Vector(140, 140),
Vector(0, 0), 45, Color(red, green, 0), 3, 1.3f,
LAYER_FOREGROUND1+1));
- sound_manager->play("sounds/fireworks.wav");
- timer.start(systemRandom.randf(1.0, 1.5));
+ SoundManager::current()->play("sounds/fireworks.wav");
+ timer.start(graphicsRandom.randf(1.0, 1.5));
}
}