From a9e7132e6a430e86e8a69d1301252e38daf6e593 Mon Sep 17 00:00:00 2001 From: Oxore Date: Mon, 9 Jul 2018 02:43:50 +0300 Subject: Introduce phantom shape, refactor field Introduce phantom shape feature, yay! Refactor field: rename attribute of invisible empty cells, remove "color" member from struct shape, introduce shape movement functions with embedded collision checking and success reporting, --- src/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 6eafc6e..df98a0b 100644 --- a/src/main.c +++ b/src/main.c @@ -70,14 +70,15 @@ int main() fld.pos = FLD_POS; fld.size = (struct vector2ui){.x = FLD_SIZE_X, .y = FLD_SIZE_Y}; fld.bound = (struct vector2ui){.x = FLD_BOUND_X, .y = FLD_BOUND_Y}; - fld.shape_cnt = 1; + fld.shape_cnt = 2; field_init(&fld); + fld.shape[0].attr |= SHP_ATTR_GHOST; nxt.pos = NXT_POS; nxt.size = NXT_SIZE; nxt.bound = NXT_SIZE; nxt.shape_cnt = 3; - nxt.attr |= FLD_ATTR_TRANSPARENT | FLD_ATTR_INVISIBLE; + nxt.attr |= FLD_ATTR_HIDE_EMPTY_CELLS | FLD_ATTR_INVISIBLE; field_init(&nxt); nxt.shape[0].y = 4; nxt.shape[1].y = 1; -- cgit v1.2.3