(ambient-light 0.02 0.02 0.02 )
(camera (mode "normal" ))
(music "music/voc-dark.ogg" )
-
- (spawnpoint (name "main" )
- (x 64 )(y 448 ))
-
+
+ (spawnpoint (name "main" )
+ (x 64 )(y 448 ))
+ (spawnpoint (name "top" )
+ (x 656 )(y 288 ))
+
+
(mrbomb (x 832 )(y 736 ))
(short_fuse (x 1056 )(y 736 ))
(short_fuse (x 1152 )(y 736 ))
(short_fuse (x 1248 )(y 736 ))
(haywire (x 928 )(y 736 ))
- (flame (x 576 )(y 480 )(speed 0.2))
- (iceflame (x 736 )(y 480 )(speed 0.2))
- (ghostflame (x 656 )(y 160 ))
-
+ (flame (x 576 )(y 480 )(speed 0.2))
+ (iceflame (x 736 )(y 480 )(speed 0.2))
+ (ghostflame (x 656 )(y 160 ))
+ (kugelblitz (x 48 )(y 576 ))
+
(tilemap (name "Interactive" )
(z-pos 0 )(solid #t )
(width 42 )(height 30 )
(bonusblock (x 608 )(y 352 )(contents "star" )(count 0 ))
(bonusblock (x 704 )(y 352 )(contents "1up" )(count 0 ))
(bonusblock (x 768 )(y 352 )(contents "firegrow" )(count 0 ))
-
+
+ (willowisp (x 48 )(y 544)(spawnpoint "top" ))
+ (willowisp (x 1232 )(y 544)(spawnpoint "top" ))
))
#include "object/camera.hpp"
#include "object/player.hpp"
#include "sprite/sprite.hpp"
+#include "sprite/sprite_manager.hpp"
#include "supertux/object_factory.hpp"
#include "supertux/sector.hpp"
#include "util/reader.hpp"
movement_timer(),
lifetime(),
direction(),
- state()
+ state(),
+ light(0.0f,0.0f,0.0f),
+ lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light.sprite"))
{
reader.get("x", start_position.x);
sprite->set_action("falling");
physic.enable_gravity(false);
countMe = false;
+
+ lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE));
+ lightsprite->set_color(Color(0.2f, 0.1f, 0.0f));
}
void
}
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
Kugelblitz::kill_fall()
{
}
void active_update(float);
void kill_fall();
void explode();
+
+ virtual void draw(DrawingContext& context);
private:
void try_activate();
Timer lifetime;
int direction;
State state;
+ Color light;
+ SpritePtr lightsprite;
};
#endif
#include "object/player.hpp"
#include "scripting/squirrel_util.hpp"
#include "sprite/sprite.hpp"
+#include "sprite/sprite_manager.hpp"
#include "supertux/game_session.hpp"
#include "supertux/object_factory.hpp"
#include "supertux/sector.hpp"
walker(),
flyspeed(),
track_range(),
- vanish_range()
+ vanish_range(),
+ lightsprite(sprite_manager->create("images/objects/lightmap_light/lightmap_light-small.sprite"))
{
bool running = false;
flyspeed = FLYSPEED;
sound_manager->preload(SOUNDFILE);
sound_manager->preload("sounds/warp.wav");
+ lightsprite->set_blend(Blend(GL_SRC_ALPHA, GL_ONE));
+ lightsprite->set_color(Color(0.0f, 0.2f, 0.0f));
+
sprite->set_action("idle");
}
context.set_target(DrawingContext::LIGHTMAP);
sprite->draw(context, get_pos(), layer);
+ lightsprite->draw(context, get_bbox().get_middle(), 0);
context.pop_target();
}
float flyspeed;
float track_range;
float vanish_range;
+ SpritePtr lightsprite;
};
#endif