diff options
author | 2025-05-22 00:01:51 +0200 | |
---|---|---|
committer | 2025-05-22 00:01:51 +0200 | |
commit | c07d2adb16532691e22a34d11ad87b56a4dc1a89 (patch) | |
tree | 3009daf2f2e2a336912305a3735c166969914450 /src/main/game/game.c | |
parent | 8d3d0a98d71181d5f65b4f08d40976a9824ba68a (diff) | |
download | tris-c07d2adb16532691e22a34d11ad87b56a4dc1a89.tar.gz tris-c07d2adb16532691e22a34d11ad87b56a4dc1a89.zip |
Change the logic on drawing signs
Diffstat (limited to 'src/main/game/game.c')
-rw-r--r-- | src/main/game/game.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/main/game/game.c b/src/main/game/game.c index 2e2db8f..e92e283 100644 --- a/src/main/game/game.c +++ b/src/main/game/game.c @@ -78,6 +78,7 @@ loop_cells(list_t *cells, float x, float y) do { Cell *cell = current->data; if (!cell_is_filled(cell) && cell_within_bounds(cell, x, y)) { + draw_sign(cell->cx, cell->cy); cell_set_filled(cell, true); } current = current->next; @@ -94,35 +95,26 @@ game_mouse_button_pressed(float x, float y, void *data) if (x >= xmin && x <= xmax && y >= ymin && y <= ymax) { if (y >= first_row) { if (x <= first_col && field_matrix[0][0] == -1) { - draw_sign(half_first_col, half_first_row); field_matrix[0][0] = sign; } else if (x >= first_col && x <= second_col && field_matrix[0][1] == -1) { - draw_sign(half_second_col, half_first_row); field_matrix[0][1] = sign; } else if (x >= second_col && field_matrix[0][2] == -1) { - draw_sign(half_third_col, half_first_row); field_matrix[0][2] = sign; } } else if (y >= second_row) { if (x <= first_col && field_matrix[1][0] == -1) { - draw_sign(half_first_col, half_second_row); field_matrix[1][0] = sign; } else if (x >= first_col && x <= second_col && field_matrix[1][1] == -1) { - draw_sign(half_second_col, half_second_row); field_matrix[1][1] = sign; } else if (x >= second_col && field_matrix[1][2] == -1) { - draw_sign(half_third_col, half_second_row); field_matrix[1][2] = sign; } } else if (y >= third_row) { if (x <= first_col && field_matrix[2][0] == -1) { - draw_sign(half_first_col, half_third_row); field_matrix[2][0] = sign; } else if (x >= first_col && x <= second_col && field_matrix[2][1] == -1) { - draw_sign(half_second_col, half_third_row); field_matrix[2][1] = sign; } else if (x >= second_col && field_matrix[2][2] == -1) { - draw_sign(half_third_col, half_third_row); field_matrix[2][2] = sign; } } |