return ABORT_MOVE;
}
- printf("PlayerHit: PM: %3.1f %3.1f BM: %3.1f %3.1f Hit: %3.1f %3.1f\n",
+ printf("PlayerHit: GT %3.1f PM: %3.1f %3.1f BM: %3.1f %3.1f Hit: %3.1f %3.1f\n",
+ game_time,
player.get_movement().x, player.get_movement().y,
get_movement().x, get_movement().y,
hit.normal.x, hit.normal.y);
}
void
+WillOWisp::draw(DrawingContext& context)
+{
+ sprite->draw(context, get_pos(), LAYER_OBJECTS);
+
+ context.push_target();
+ context.set_target(DrawingContext::LIGHTMAP);
+
+ sprite->draw(context, get_pos(), LAYER_OBJECTS);
+
+ context.pop_target();
+}
+
+void
WillOWisp::active_update(float elapsed_time)
{
Player* player = get_nearest_player();
void active_update(float elapsed_time);
void kill_fall();
+ virtual void draw(DrawingContext& context);
+
protected:
HitResponse collision_player(Player& player, const CollisionHit& hit);
if(dying) {
smalltux_gameover->draw(context, get_pos(), layer);
} else if(growing_timer.get_timeleft() > 0) {
- if(!is_big())
- {
- if (dir == RIGHT)
- context.draw_surface(growingtux_right[GROWING_FRAMES-1 -
- int((growing_timer.get_timegone() *
- GROWING_FRAMES) / GROWING_TIME)], get_pos(), layer);
- else
- context.draw_surface(growingtux_left[GROWING_FRAMES-1 -
- int((growing_timer.get_timegone() *
- GROWING_FRAMES) / GROWING_TIME)], get_pos(), layer);
- }
- else
- {
- if (dir == RIGHT)
- context.draw_surface(growingtux_right[
- int((growing_timer.get_timegone() *
- GROWING_FRAMES) / GROWING_TIME)], get_pos(), layer);
- else
- context.draw_surface(growingtux_left[
- int((growing_timer.get_timegone() *
- GROWING_FRAMES) / GROWING_TIME)],
- get_pos(), layer);
+ if (dir == RIGHT) {
+ context.draw_surface(growingtux_right[int((growing_timer.get_timegone() *
+ GROWING_FRAMES) / GROWING_TIME)], get_pos() - Vector(0, 32), layer);
+ } else {
+ context.draw_surface(growingtux_left[int((growing_timer.get_timegone() *
+ GROWING_FRAMES) / GROWING_TIME)], get_pos() - Vector(0, 32), layer);
}
}
else if (safe_timer.started() && size_t(game_time*40)%2)
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
- glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+ //glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+ glClearColor(0, 0, 0, 1);
glClear(GL_COLOR_BUFFER_BIT);
handle_drawing_requests(lightmap_requests);
lightmap_requests.clear();
drawing_requests.clear();
if(use_lightmap) {
- glBlendFunc(GL_DST_COLOR, GL_ZERO);
+ glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glBindTexture(GL_TEXTURE_2D, lightmap->get_handle());
glBegin(GL_QUADS);