-
Notifications
You must be signed in to change notification settings - Fork 0
/
Core.h
47 lines (39 loc) · 1013 Bytes
/
Core.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
int min(int a, int b);
int max(int a, int b);
enum EBlockType
{
eBlockType_Empty,
eBlockType_Red,
eBlockType_Green,
eBlockType_Blue,
eBlockType_Yellow,
eBlockType_Purple,
eBlockType_Special,
eBlockType_Max,
eBlockType_Invalid = -1
};
#define MATCHING_OFFSET 3
#define FALLING_OFFSET 8
#define LOCKED_OFFSET 9
enum EBlockFlag
{
eBlockFlag_TypeMask = (7),
eBlockFlag_Matching = (15 << MATCHING_OFFSET),
eBlockFlag_Falling = (1 << FALLING_OFFSET),
eBlockFlag_Locked = (1 << LOCKED_OFFSET),
};
#define BOARD_COLS 6
#define BOARD_ROWS 12
#define HISTORY_FRAMES 32
#define TICKS_PER_FEED 64
#define TICKS_PER_MATCH 8
void PPL_Init (void);
void PPL_Update (void);
int PPL_Feed (void);
void PPL_SetBlockType (int row, int col, int type);
int PPL_GetBlockType (int row, int col);
int PPL_IsLocked (int row, int col);
int PPL_IsFalling (int row, int col);
int PPL_IsBreaking (int row, int col);
int PPL_MoveRight (int row, int col);
int PPL_MoveLeft (int row, int col);