aboutsummaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-06-03 11:20:11 +0200
committerHampusM <hampus@hampusmat.com>2022-06-13 17:57:00 +0200
commit4f27cc4f86fb7265bc6ad78cdfbe5d858a92a56e (patch)
treeb84a372897f8ba6f142780eae24830b9e5f15b6e /src/game
parent7a4391449c3f0aee04dba1e934fcdaafbbf7d60a (diff)
feat: add deleting cells
Diffstat (limited to 'src/game')
-rw-r--r--src/game/game.cpp15
1 files changed, 15 insertions, 0 deletions
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();