diff options
Diffstat (limited to 'src/game/game.cpp')
-rw-r--r-- | src/game/game.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/game/game.cpp b/src/game/game.cpp index 0b3e85e..879f096 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -29,7 +29,8 @@ Game::Game( _status_manager(std::move(status_manager)), _user_input_observer(std::move(user_input_observer)), _cell_helper(std::move(cell_helper)), - _current_mode(Mode::NORMAL) + _current_mode(Mode::NORMAL), + _minimum_cursor_pos_y(0) { } @@ -44,6 +45,8 @@ void Game::on_start() noexcept _status_manager->bind(statusline); + _minimum_cursor_pos_y = 2; + _status_manager->set_section_title(StatusLineSection::A, ""); _status_manager->set_section_title(StatusLineSection::B, "X: "); _status_manager->set_section_title(StatusLineSection::C, "Y: "); @@ -319,8 +322,11 @@ void Game::_on_normal_mode_update() noexcept for (const auto &birth_cell_pos : birth_cell_positions) { - _set_space(matrix, birth_cell_pos, 'x'); - _living_cell_positions.push_back(birth_cell_pos); + if (birth_cell_pos.get_y() >= _minimum_cursor_pos_y) + { + _set_space(matrix, birth_cell_pos, 'x'); + _living_cell_positions.push_back(birth_cell_pos); + } } } @@ -502,7 +508,7 @@ auto Game::_move_cursor(const Vector2 &direction) noexcept -> bool return false; } - if (dest_position.get_y() <= 1) + if (dest_position.get_y() < _minimum_cursor_pos_y) { return false; } |