diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-03-18 21:36:21 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-03-18 21:36:21 +0100 |
| commit | cae4150779c587edcc40b75f04624ab3971bbed6 (patch) | |
| tree | d4d8a749ddcd7fdedc1cb5d3b9265e5df196f9f3 /include | |
| parent | 79ab0bdeedd6e7f97b4c246b4319af5eac545061 (diff) | |
| download | 2048-cae4150779c587edcc40b75f04624ab3971bbed6.tar.gz 2048-cae4150779c587edcc40b75f04624ab3971bbed6.tar.bz2 2048-cae4150779c587edcc40b75f04624ab3971bbed6.zip | |
random spawn
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 { |
