diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/common.h | 21 | ||||
-rw-r--r-- | src/include/functions.h | 19 | ||||
-rw-r--r-- | src/include/tet_conf.h | 86 |
3 files changed, 126 insertions, 0 deletions
diff --git a/src/include/common.h b/src/include/common.h new file mode 100644 index 0000000..84cbe2c --- /dev/null +++ b/src/include/common.h @@ -0,0 +1,21 @@ +#include <SFML/Audio.h> +#include <SFML/Graphics.h> +#include <SFML/System.h> +#include <SFML/Window/Keyboard.h> +#include <stdio.h> +#include <time.h> +#include <stdlib.h> +#include "functions.h" +#include "tet_conf.h" + +//#define EXIT_FAILURE -1 +//#define EXIT_SUCCESS 0 + +struct tCell { + short a; // active/empty state of cell + sfColor fColor, oColor; // fill and outline color of cell +}; + +struct tCell activeShape[4][4], // 4x4 block of active crawling shape + field_rAttr[20][10];// field cells attributess + diff --git a/src/include/functions.h b/src/include/functions.h new file mode 100644 index 0000000..1816399 --- /dev/null +++ b/src/include/functions.h @@ -0,0 +1,19 @@ + +/* Prototypes of functions*/ +void tKeyCtrl(); +void initAll(); +void tTick(); +void resetActiveShape(); +void putShape(); +int cellCollisionCheck(int dir); +int wallCollisionCheck(); +int cellRotCollisionCheck(); +int wallRotCollisionCheck(); +void rotateShape(); +void rotateS1(); +void rotateS2(); +void rotateS3(); +void rotateS4(); +int linesRmScore(); +void scoreDisplay(); +void menuTick();
\ No newline at end of file diff --git a/src/include/tet_conf.h b/src/include/tet_conf.h new file mode 100644 index 0000000..0b37d65 --- /dev/null +++ b/src/include/tet_conf.h @@ -0,0 +1,86 @@ +#define windowName_conf "SFML" // Window name +#define hudColor1_conf sfColor_fromRGB(0, 0, 0) // Field background +#define hudColor2_conf sfColor_fromRGB(80, 80, 80) // Field cell outline +#define tOrange sfColor_fromRGB(255, 130, 0) // Orange color of L shape +#define tBlue sfColor_fromRGB(0, 0, 255) +#define tGreen sfColor_fromRGB(0, 255, 0) +#define tRed sfColor_fromRGB(255, 0, 0) +#define tYellow sfColor_fromRGB(255, 255, 0) +#define tCyan sfColor_fromRGB(0, 255, 255) +#define tMagneta sfColor_fromRGB(192, 0, 255) +#define moveRepeatLatency1 150000 //microseconds, only for left-right arrows, first repeat move when long push +#define moveRepeatLatency2 30000 //microseconds, for Left, Right and Down arrows, the rest repeat move when long push + + +/* + * 19.......... + * 18.......... + * 17.......... + * 16.......... + * 15.......... + * 14.......... + * 13.......... + * 12.......... + * 11.......... + * 10.......... + * 9.......... + * 8.......... + * 7.......... + * 6.......... + * 5.......#.. + * 4......##.. + * 3......#... + * 2.#.##..... + * 1.##.#..#.. + * 0..#.#.###. + * 0123456789 + * + * L + * ..#. .#.. .... ##.. + * ###. .#.. ###. .#.. + * .... .##. #... .#.. + * .... .... .... .... + * + * RL + * #... .##. .... .#.. + * ###. .#.. ###. .#.. + * .... .#.. ..#. ##.. + * .... .... .... .... + * + * Z + * ##.. ..#. .... .#.. + * .##. .##. ##.. ##.. + * .... .#.. .##. #... + * .... .... .... .... + * + * S + * .##. .#.. .... #... + * ##.. .##. .##. ##.. + * .... ..#. ##.. .#.. + * .... .... .... .... + * + * Brick + * ##.. ##.. ##.. ##.. + * ##.. ##.. ##.. ##.. + * .... .... .... .... + * .... .... .... .... + * + * I + * .#.. .... .#.. .... + * .#.. #### .#.. #### + * .#.. .... .#.. .... + * .#.. .... .#.. .... + * + * T + * .#.. .#.. .... .#.. + * ###. .##. ###. ##.. + * .... .#.. .#.. .#.. + * .... .... .... .... + */ + + + + +char *aaa; +char* aaa; + |