Skip to content

Commit

Permalink
Move "Game Over" font a little bit up when a Player sprite is centere…
Browse files Browse the repository at this point in the history
…d to not overlap it
  • Loading branch information
mattmaniak committed Aug 21, 2024
1 parent 9acb852 commit 9ac2a44
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/game.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,17 @@ bool Game::RunLevelLoop() {
if (!level_->Render(*graphics_)) {
return false;
}
#ifdef DISABLE_RELATIVE_PLAYER_MOVEMENT
int game_over_font_vertical_offset = 0;
#else
int game_over_font_vertical_offset = level_->player_->transform_.h * 2;

#endif
game_over_font.pos_x_ = (graphics_->display_.w
- game_over_font.transform_.w) / 2;
game_over_font.pos_y_ = (graphics_->display_.h
- game_over_font.transform_.h) / 2;
game_over_font.pos_y_ = ((graphics_->display_.h
- game_over_font.transform_.h) / 2)
- game_over_font_vertical_offset;

if (!game_over_font.Render(*graphics_)) {
return false;
Expand Down

0 comments on commit 9ac2a44

Please sign in to comment.