Skip to content

Commit

Permalink
Make tux and yeti dying state not reveal secret tilemaps
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbi committed Mar 8, 2015
1 parent d1119d5 commit 2e163cb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/badguy/yeti.cpp
Expand Up @@ -212,6 +212,9 @@ void Yeti::take_hit(Player& )
physic.set_velocity_x(0);
physic.set_velocity_y(0);

// Set the badguy layer to be above the foremost, so that
// this does not reveal secret tilemaps:
layer = Sector::current()->get_foremost_layer() + 1;
state = SQUISHED;
state_timer.start(YETI_SQUISH_TIME);
set_colgroup_active(COLGROUP_MOVING_ONLY_STATIC);
Expand Down
6 changes: 5 additions & 1 deletion src/object/player.cpp
Expand Up @@ -1312,7 +1312,11 @@ Player::draw(DrawingContext& context)
}
}
else {
sprite->draw(context, get_pos(), LAYER_OBJECTS + 1);
if(dying)
sprite->draw(context, get_pos(), Sector::current()->get_foremost_layer() + 1);
else
sprite->draw(context, get_pos(), LAYER_OBJECTS + 1);

if (player_status->bonus == AIR_BONUS)
powersprite->draw(context, get_pos(), LAYER_OBJECTS + 1);
}
Expand Down

0 comments on commit 2e163cb

Please sign in to comment.