From 4cb7cbd3734205bb923c65290e73fe47c85f86a4 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Mon, 6 Feb 2023 19:36:10 -0800 Subject: add block structure --- block.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 block.h (limited to 'block.h') diff --git a/block.h b/block.h new file mode 100644 index 0000000..1f12a72 --- /dev/null +++ b/block.h @@ -0,0 +1,27 @@ +#ifndef BLOCK_H +#define BLOCK_H +typedef struct { + enum { + BLOCK_T, + BLOCK_RL, /* L block with the bottom part facing + right */ + BLOCK_LL, /* L block with the bottom part facing + left */ + BLOCK_I, + BLOCK_RS, + BLOCK_LS, + } type; + + enum { + BLOCK_0, + BLOCK_90, + BLOCK_180, + BLOCK_270, + } rotation; + + int x; + int y; +} block_t; + +block_t *init_block(int type); +#endif -- cgit v1.3.1