From 4f27cc4f86fb7265bc6ad78cdfbe5d858a92a56e Mon Sep 17 00:00:00 2001 From: HampusM Date: Fri, 3 Jun 2022 11:20:11 +0200 Subject: feat: add deleting cells --- src/game/game.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/game/game.cpp b/src/game/game.cpp index b623e64..8ea6571 100644 --- a/src/game/game.cpp +++ b/src/game/game.cpp @@ -121,6 +121,21 @@ void Game::on_update() noexcept break; } + case 'x': + { + const auto position = _cursor_controller->where(); + const auto matrix = _scene->get_matrix(); + + if (matrix->get(position) == ' ') + { + break; + } + + _set_space(matrix, position, ' '); + _living_cell_positions.remove(position); + break; + } + case 'p': { auto onoff = !_generation_tracker->get_is_paused(); -- cgit v1.2.3-18-g5258