diff options
| author | 2019-04-13 17:12:12 -0400 | |
|---|---|---|
| committer | 2019-04-13 17:12:12 -0400 | |
| commit | 2d3a51877ba45ed5a64d2c9acee3d3300f55c5fa (patch) | |
| tree | b2997a5c5377f402a5e43f299b6b6949e16ba8fd /core/include | |
| parent | 98cb2cda6e9baa7836c76e78bc4c021b6bea39cc (diff) | |
| download | cetris-2d3a51877ba45ed5a64d2c9acee3d3300f55c5fa.tar.gz cetris-2d3a51877ba45ed5a64d2c9acee3d3300f55c5fa.tar.bz2 cetris-2d3a51877ba45ed5a64d2c9acee3d3300f55c5fa.zip | |
general cleanup and add ghost piece for preview
Diffstat (limited to 'core/include')
| -rw-r--r-- | core/include/cetris.h | 12 | ||||
| -rw-r--r-- | core/include/matrix.h | 7 | ||||
| -rw-r--r-- | core/include/types.h | 11 |
3 files changed, 18 insertions, 12 deletions
diff --git a/core/include/cetris.h b/core/include/cetris.h index e41abdf..9e3cf83 100644 --- a/core/include/cetris.h +++ b/core/include/cetris.h @@ -6,14 +6,18 @@ #include "types.h"
#define CETRIS_BOARD_X 10
-#define CETRIS_BOARD_Y 43
-#define CETRIS_BOARD_VISABLE 23
+#define CETRIS_BOARD_Y 20
+#define CETRIS_INITIAL_X 3
+#define CETRIS_INITIAL_Y 0
+#define CETRIS_INITIAL_Y_OFFSET 2
+//#define CETRIS_BOARD_VISABLE 21
#define CETRIS_HZ 60
#define CETRIS_DAS_DELAY 11
#define CETRIS_DAS_PERIOD 3
#define CETRIS_DROP_PERIOD 2
#define CETRIS_LINE_CLEAR_DELAY 40
+#define CETRIS_LOCK_DELAY 40
#define CETRIS_WAIT_ON_CLEAR 0
typedef enum {
@@ -43,12 +47,14 @@ struct tetrimino { rstate r;
color c;
piece_matrix m;
+ u8 ghost_y;
vec2 pos;
u32 lock_tick;
};
typedef struct {
bool occupied;
+ bool ghost;
bool constant;
u32 remove_tick;
color c;
@@ -90,7 +96,7 @@ struct cetris_game { };
void next_piece(struct cetris_game* g);
-void wipe_board(struct cetris_game* g);
+void update_board(struct cetris_game* g);
/* API PROTOTYPES FUNCTIONS */
diff --git a/core/include/matrix.h b/core/include/matrix.h index 658906c..050a32e 100644 --- a/core/include/matrix.h +++ b/core/include/matrix.h @@ -6,10 +6,9 @@ #include "cetris.h"
extern const piece_matrix default_matrices[7];
-extern const vec2 basic_movements[4];
-void move_current(struct cetris_game* g, vec2 offset);
-void overlay_current_matrix(struct cetris_game* g);
+void move_current(struct cetris_game* g, input_t move);
void hard_drop(struct cetris_game* g);
void rotate_matrix(struct cetris_game* g, bool clockwise);
-i8 check_new_matrix(struct cetris_game* g, piece_matrix m);
+void set_matrix(struct cetris_game* g, piece_matrix *m);
+i8 check_matrix(struct cetris_game* g, piece_matrix *m);
diff --git a/core/include/types.h b/core/include/types.h index 0431de1..3471f3c 100644 --- a/core/include/types.h +++ b/core/include/types.h @@ -20,9 +20,10 @@ typedef u8 piece_matrix[4][4]; typedef enum {
DOWN = 1,
- RIGHT = 2,
- LEFT = 3,
- ROTATE_CCW = 4,
- ROTATE_CW = 5,
- HARD_DROP = 6
+ USER_DOWN = 2,
+ RIGHT = 3,
+ LEFT = 4,
+ ROTATE_CCW = 5,
+ ROTATE_CW = 6,
+ HARD_DROP = 7
} input_t;
|