summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Iezzi <aiezzi@alessandroiezzi.it>2025-05-21 00:55:48 +0200
committerAlessandro Iezzi <aiezzi@alessandroiezzi.it>2025-05-21 00:55:48 +0200
commitce91cfc683355441bb4c62b6942aaf6db4675fdf (patch)
tree2e91f54d57d0c99513a2d4b880b4ed81c2dede4c
parentc87c115a5d19cc2b9c5748ebaac5e7ab128eb69a (diff)
downloadtris-ce91cfc683355441bb4c62b6942aaf6db4675fdf.tar.gz
tris-ce91cfc683355441bb4c62b6942aaf6db4675fdf.zip
Add logic to draw sign and circle
-rw-r--r--src/main/game/game.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main/game/game.c b/src/main/game/game.c
index 534b31c..f39459b 100644
--- a/src/main/game/game.c
+++ b/src/main/game/game.c
@@ -35,10 +35,22 @@ float second_col, half_second_col;
float third_row, half_third_row;
float third_col, half_third_col;
+/* 0 = circle, 1 = cross */
+int sign = 0;
+
static void
draw_sign(float x, float y)
{
- engine_draw_circle(x, y, 0.20, 120, 1);
+ float l = 0.20;
+
+ if (sign == 0) {
+ engine_draw_circle(x, y, l, 120, 1);
+ sign = 1;
+ } else if (sign == 1) {
+ engine_draw_line(x - l, y + l, x + l, y - l);
+ engine_draw_line(x + l, y + l, x - l, y - l);
+ sign = 0;
+ }
}
static void