summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorPreston Pan <preston@nullring.xyz>2023-02-06 19:36:10 -0800
committerPreston Pan <preston@nullring.xyz>2023-02-06 19:36:10 -0800
commit4cb7cbd3734205bb923c65290e73fe47c85f86a4 (patch)
tree6aed241a7dd7f57b7f52e79b38d1eb77742034bb /block.c
parent1a4999aa71a2369e86e996e11095e9c2d92e5d84 (diff)
add block structure
Diffstat (limited to 'block.c')
-rw-r--r--block.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/block.c b/block.c
new file mode 100644
index 0000000..2f4d36c
--- /dev/null
+++ b/block.c
@@ -0,0 +1,13 @@
+#include <stdlib.h>
+#include "block.h"
+#include "config.h"
+
+block_t *init_block(int type)
+{
+ block_t *block = malloc(sizeof(block_t));
+ block->type = type;
+ block->rotation = BLOCK_0;
+ block->x = width / 2;
+ block->y = 0;
+ return block;
+}