From 79ab0bdeedd6e7f97b4c246b4319af5eac545061 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 18 Mar 2020 20:50:58 +0100 Subject: game class, display of the game grid --- src/main.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index c4ef817..7fe08bf 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,17 +1,21 @@ #include -#include #include "graphics.hpp" +#include "game.hpp" #define WINDOW_TITLE "2048" -#define WINDOW_WIDTH 640 +#define WINDOW_WIDTH 480 #define WINDOW_HEIGHT 480 +#define GAME_GRID_SIZE 4 int main() { - Graphics g = Graphics(WINDOW_TITLE, WINDOW_WIDTH, WINDOW_HEIGHT); + Game game = Game(GAME_GRID_SIZE); + Graphics *graphics = new Graphics(&game, WINDOW_TITLE, WINDOW_WIDTH, WINDOW_HEIGHT); - while (g.isRunning()) - g.update(); + while (graphics->isRunning()) + graphics->update(); + + delete graphics; return 0; } -- cgit