diff options
author | Oxore <oxore@protonmail.com> | 2018-07-09 02:43:50 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2018-07-09 02:43:50 +0300 |
commit | a9e7132e6a430e86e8a69d1301252e38daf6e593 (patch) | |
tree | 08e7865c55883e40db966a9851b546b95bc4524b /src/main.c | |
parent | 67186f876e17696858495a2a7a699344b0f94178 (diff) |
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,
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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; |