From 8d3d0a98d71181d5f65b4f08d40976a9824ba68a Mon Sep 17 00:00:00 2001 From: Alessandro Iezzi Date: Wed, 21 May 2025 23:48:24 +0200 Subject: Add the logic for the Cell if filled When the user click on a box, a sign appears and that cell will be set as filled. --- src/main/game/game.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/main/game/game.c') diff --git a/src/main/game/game.c b/src/main/game/game.c index 25de722..2e2db8f 100644 --- a/src/main/game/game.c +++ b/src/main/game/game.c @@ -77,7 +77,8 @@ loop_cells(list_t *cells, float x, float y) list_node_t *current = cells->head; do { Cell *cell = current->data; - if (cell_within_bounds(cell, x, y)) { + if (!cell_is_filled(cell) && cell_within_bounds(cell, x, y)) { + cell_set_filled(cell, true); } current = current->next; } while (current != NULL); -- cgit v1.2.3