8 #include "app/globals.h"
9 #include "video/drawing_context.h"
10 #include "audio/sound_manager.h"
12 using namespace SuperTux;
14 Fireworks::Fireworks()
19 Fireworks::~Fireworks()
24 Fireworks::action(float )
27 Sector* sector = Sector::current();
28 Vector pos = sector->camera->get_translation();
29 pos += Vector(screen->w * ((float) rand() / RAND_MAX),
30 screen->h/2 * ((float) rand() / RAND_MAX));
32 int red = rand() % 255;
33 int green = rand() % red;
34 sector->add_object(new Particles(pos, 0, 360, Vector(140, 140),
35 Vector(0, 0), 45, Color(red, green, 0), 3, 1.3,
36 LAYER_FOREGROUND1+1));
37 SoundManager::get()->play_sound(IDToSound(SND_FIREWORKS));
38 timer.start(((float) rand() / RAND_MAX) + .5);
43 Fireworks::draw(DrawingContext& )