summaryrefslogtreecommitdiff
path: root/src/main/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/game')
-rw-r--r--src/main/game/game.c4
-rw-r--r--src/main/game/game.h2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/game/game.c b/src/main/game/game.c
index f1e5bdd..ee35f7d 100644
--- a/src/main/game/game.c
+++ b/src/main/game/game.c
@@ -73,7 +73,7 @@ check_win(TrisGame *game)
if (game->cells[i0]->sign != '\0'
&& game->cells[i0]->sign == game->cells[i1]->sign
&& game->cells[i1]->sign == game->cells[i2]->sign) {
- printf("Win!\n");
+ engine_set_rendering_background(game->engine, 0.0f, 0.5f, 0.0f, 1.0f);
}
}
}
@@ -135,8 +135,8 @@ game_init(int width, int height)
game->height = height;
game->sign = SIGN_CIRCLE;
game->moves = 0;
+ game->engine = engine_new(width, height);
- engine_new(width, height);
ui_set_title("Tris Game");
engine_set_mouse_button_listener(game_mouse_button_pressed, game);
diff --git a/src/main/game/game.h b/src/main/game/game.h
index 3d10bea..d119f67 100644
--- a/src/main/game/game.h
+++ b/src/main/game/game.h
@@ -23,12 +23,14 @@
#define BOARD_SIZE 9
#include "cell.h"
+#include "../engine/engine.h"
typedef struct TrisGame {
int width, height;
Cell *cells[BOARD_SIZE];
char sign; /* x = cross and o = circle */
int moves;
+ Engine *engine;
} TrisGame;
TrisGame *game_init(int width, int height);