void MagicBlock::draw(DrawingContext& context) { //Ask for update about lightmap at center of this block context.get_light( center, &light ); //Draw the Sprite. MovingSprite::draw(context); //Add the color. context.draw_filled_rect( bbox, color, layer); }
void Flower::draw(DrawingContext& context) { //Draw the Sprite. sprite->draw(context.color(), get_pos(), LAYER_OBJECTS, drawing_effect); //Draw the light when dark context.get_light( bbox.get_middle(), &light ); if (light.red + light.green + light.blue < 3.0){ lightsprite->draw(context.light(), bbox.get_middle(), 0); } }
void Flower::draw(DrawingContext& context) { //Draw the Sprite. sprite->draw(context, get_pos(), LAYER_OBJECTS, drawing_effect); //Draw the light when dark context.get_light( get_bbox().get_middle(), &light ); if (light.red + light.green + light.blue < 3.0){ context.push_target(); context.set_target(DrawingContext::LIGHTMAP); lightsprite->draw(context, get_bbox().get_middle(), 0); context.pop_target(); } }
void Explosion::draw(DrawingContext& context) { //Draw the Sprite. sprite->draw(context, get_pos(), LAYER_OBJECTS+40); //Explosions produce light (if ambient light is not maxed) context.get_light( get_bbox().get_middle(), &light); if (light.red + light.green + light.blue < 3.0){ context.push_target(); context.set_target(DrawingContext::LIGHTMAP); lightsprite->draw(context, get_bbox().get_middle(), 0); context.pop_target(); } }
void Star::draw(DrawingContext& context){ //Draw the Sprite. MovingSprite::draw(context); //Draw the light when dark context.get_light( get_bbox().get_middle(), &light ); if (light.red + light.green + light.blue < 3.0){ MovingSprite::draw(context); context.push_target(); context.set_target(DrawingContext::LIGHTMAP); lightsprite->draw(context, get_bbox().get_middle(), 0); context.pop_target(); } }
void Kugelblitz::draw(DrawingContext& context) { sprite->draw(context, get_pos(), layer); //Only draw light in dark areas 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 Ghostflame::draw(DrawingContext& context) { //Draw the Sprite. sprite->draw(context, get_pos(), LAYER_OBJECTS); //Draw the light if dark context.get_light( bbox.get_middle(), &light ); if (light.blue + light.red < 2.0){ context.push_target(); context.set_target(DrawingContext::LIGHTMAP); sprite->draw(context, get_pos(), layer); lightsprite->draw(context, bbox.get_middle(), 0); context.pop_target(); } }
void Iceflame::draw(DrawingContext& context) { context.push_target(); //Rotate the Sprite (3 rotations per revolution) sprite->set_angle(angle * 360.0f / (2*M_PI) * 3); //Draw the Sprite. sprite->draw(context, get_pos(), LAYER_OBJECTS); //Draw the light if dark context.get_light( get_bbox().get_middle(), &light ); if (light.blue + light.green < 2.0){ context.set_target(DrawingContext::LIGHTMAP); lightsprite->draw(context, get_bbox().get_middle(), 0); } context.pop_target(); }
void Bullet::draw(DrawingContext& context) { //Draw the Sprite. sprite->draw(context, get_pos(), LAYER_OBJECTS); //Draw the light if fire and dark if(type == FIRE_BONUS){ 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_OBJECTS); lightsprite->draw(context, get_bbox().get_middle(), 0); context.pop_target(); } } }
void WeakBlock::draw(DrawingContext& context) { //Draw the Sprite just in front of other objects sprite->draw(context, get_pos(), LAYER_OBJECTS + 10); //Draw the light if burning and dark if(linked && (state != STATE_NORMAL)){ context.get_light( bbox.get_middle(), &light ); if (light.red + light.green + light.blue < 3.0){ context.push_target(); context.set_target(DrawingContext::LIGHTMAP); sprite->draw(context, get_pos(), LAYER_OBJECTS + 10); lightsprite->draw(context, bbox.get_middle(), 0); context.pop_target(); } } }
void PowerUp::draw(DrawingContext& context){ //Draw the Sprite. sprite->draw(context, get_pos(), layer); //Draw light when dark for defaults context.get_light( bbox.get_middle(), &light ); if (light.red + light.green + light.blue < 3.0){ //Stars are brighter if (sprite_name == "images/powerups/star/star.sprite") { sprite->draw(context, get_pos(), layer); } context.push_target(); context.set_target(DrawingContext::LIGHTMAP); lightsprite->draw(context, bbox.get_middle(), 0); context.pop_target(); } }
void SpriteParticle::draw(DrawingContext& context) { sprite->draw(context, position, drawing_layer); //Sparkles glow in the dark if(glow){ context.get_light(position, &light ); if (light.red + light.green + light.blue < 3.0){ context.push_target(); context.set_target(DrawingContext::LIGHTMAP); sprite->draw(context, position, drawing_layer); lightsprite->draw(context, position + Vector(12,12), 0); context.pop_target(); } } }