diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/2048.hpp | 12 | ||||
| -rw-r--r-- | include/game.hpp | 6 | ||||
| -rw-r--r-- | include/graphics.hpp | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/include/2048.hpp b/include/2048.hpp new file mode 100644 index 0000000..fff7a80 --- /dev/null +++ b/include/2048.hpp @@ -0,0 +1,12 @@ +#ifndef H2048_HPP +# define H2048_HPP + +typedef enum +{ + DIRECTION_LEFT, + DIRECTION_RIGHT, + DIRECTION_DOWN, + DIRECTION_UP +} Direction; + +#endif diff --git a/include/game.hpp b/include/game.hpp index a644799..488f74b 100644 --- a/include/game.hpp +++ b/include/game.hpp @@ -1,6 +1,9 @@ #ifndef GAME_HPP # define GAME_HPP +#include <cstdlib> +#include "2048.hpp" + class Game { public: @@ -8,6 +11,9 @@ class Game ~Game(); int getSize(); int at(int x, int y); + void move(Direction direction); + void spawn(); + bool lost(); private: int size; diff --git a/include/graphics.hpp b/include/graphics.hpp index 0990247..44f631c 100644 --- a/include/graphics.hpp +++ b/include/graphics.hpp @@ -6,6 +6,7 @@ #include <SDL2/SDL.h> #include <SDL2/SDL_ttf.h> #include "game.hpp" +#include "2048.hpp" class Graphics { |
