diff --git a/data/images/powerups/egg/egg-shade.png b/data/images/powerups/egg/egg-shade.png new file mode 100644 index 00000000000..fcbb696534c Binary files /dev/null and b/data/images/powerups/egg/egg-shade.png differ diff --git a/data/images/powerups/egg/egg.png b/data/images/powerups/egg/egg.png index 6f63e35c6dc..8d6105ff91f 100644 Binary files a/data/images/powerups/egg/egg.png and b/data/images/powerups/egg/egg.png differ diff --git a/data/images/powerups/egg/egg.sprite b/data/images/powerups/egg/egg.sprite index d1eac26ea0e..0ad6b8286ad 100644 --- a/data/images/powerups/egg/egg.sprite +++ b/data/images/powerups/egg/egg.sprite @@ -1,7 +1,11 @@ (supertux-sprite - (action - (name "default") - (images "egg.png") - ) + (action + (name "default") + (images "egg.png") + ) + (action + (name "shadow") + (images "egg-shade.png") + ) ) diff --git a/src/object/growup.cpp b/src/object/growup.cpp index e4c32b0e7ef..4f832b9569e 100644 --- a/src/object/growup.cpp +++ b/src/object/growup.cpp @@ -26,11 +26,14 @@ GrowUp::GrowUp(Direction direction) : MovingSprite(Vector(0,0), "images/powerups/egg/egg.sprite", LAYER_OBJECTS, COLGROUP_MOVING), physic(), light(0.0f,0.0f,0.0f), + shadesprite(sprite_manager->create("images/powerups/egg/egg.sprite")), lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-small.sprite")) { physic.enable_gravity(true); physic.set_velocity_x((direction == LEFT)?-100:100); sound_manager->preload("sounds/grow.ogg"); + //shadow to remain in place as egg rolls + shadesprite->set_action("shadow"); //set light for glow effect lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE)); lightsprite->set_color(Color(0.2f, 0.2f, 0.0f)); @@ -48,6 +51,8 @@ GrowUp::draw(DrawingContext& context){ sprite->set_angle(get_pos().x * 360.0f / (32.0f * M_PI)); //Draw the Sprite. MovingSprite::draw(context); + //Draw shade + shadesprite->draw(context, get_pos(), layer+1); //Draw the light when dark context.get_light( get_bbox().get_middle(), &light ); if (light.red + light.green < 2.0){ diff --git a/src/object/growup.hpp b/src/object/growup.hpp index f1427c02868..4b04823606f 100644 --- a/src/object/growup.hpp +++ b/src/object/growup.hpp @@ -35,6 +35,7 @@ class GrowUp : public MovingSprite private: Physic physic; Color light; + SpritePtr shadesprite; SpritePtr lightsprite; };