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.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 block.c (limited to 'block.c') 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 +#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; +} -- cgit v1.3.1