+Flame::draw(DrawingContext& context)
+{
+ //Draw the Sprite.
+ sprite->draw(context, get_pos(), LAYER_OBJECTS);
+ //Draw the light if dark
+ if(true){
+ context.get_light( get_bbox().get_middle(), &light );
+ if (light.red + light.green < 2.0){
+ context.push_target();
+ context.set_target(DrawingContext::LIGHTMAP);
+ sprite->draw(context, get_pos(), layer);
+ lightsprite->draw(context, get_bbox().get_middle(), 0);
+ context.pop_target();
+ }
+ }
+}
+
+void
+Flame::activate()
+{
+ sound_source = sound_manager->create_sound_source(FLAME_SOUND);
+ sound_source->set_position(get_pos());
+ sound_source->set_looping(true);
+ sound_source->set_gain(2.0);
+ sound_source->set_reference_distance(32);
+ sound_source->play();
+}
+
+void
+Flame::deactivate()
+{
+ sound_source.reset();
+}
+
+
+void