diff options
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; } } |