7 #include "app/globals.h"
8 #include "video/drawing_context.h"
9 #include "audio/sound_manager.h"
11 using namespace SuperTux;
13 Fireworks::Fireworks()
18 Fireworks::~Fireworks()
23 Fireworks::action(float )
26 Sector* sector = Sector::current();
27 Vector pos = sector->camera->get_translation();
28 pos += Vector(screen->w * ((float) rand() / RAND_MAX),
29 screen->h/2 * ((float) rand() / RAND_MAX));
31 int red = rand() % 255;
32 int green = rand() % red;
33 sector->add_particles(pos, 0, 360, Vector(140, 140),
34 Vector(0, 0), 45, Color(red, green, 0), 3, 1300,
36 SoundManager::get()->play_sound(IDToSound(SND_FIREWORKS));
37 timer.start(((float) rand() / RAND_MAX) + .5);
42 Fireworks::draw(DrawingContext& )