-
Notifications
You must be signed in to change notification settings - Fork 0
/
pieces.h
69 lines (65 loc) · 1.16 KB
/
pieces.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#pragma once
enum {
PIECE_I,
PIECE_J,
PIECE_L,
PIECE_O,
PIECE_S,
PIECE_T,
PIECE_Z,
MAX_PIECE
};
#define PIECE_SIZE 4
const Uint8 pieceColor[MAX_PIECE][4] = {
// PIECE_I
{ 237, 28, 36, 0xFF },
// PIECE_J
{ 255, 127, 39, 0xFF },
// PIECE_L
{ 255, 242, 0, 0xFF },
// PIECE_O
{ 34, 177, 76, 0xFF },
// PIECE_S
{ 0, 162, 232, 0xFF },
// PIECE_T
{ 63, 72, 204, 0xFF },
// PIECE_Z
{ 163, 73, 164, 0xFF }
};
const int pieceBlocks[MAX_PIECE][PIECE_SIZE][PIECE_SIZE] = {
// PIECE_I
{ { 0, 0, 1, 0 },
{ 0, 0, 1, 0 },
{ 0, 0, 1, 0 },
{ 0, 0, 1, 0 } },
// PIECE_J
{ { 0, 0, 1, 0 },
{ 0, 0, 1, 0 },
{ 0, 1, 1, 0 },
{ 0, 0, 0, 0 } },
// PIECE_L
{ { 0, 1, 0, 0 },
{ 0, 1, 0, 0 },
{ 0, 1, 1, 0 },
{ 0, 0, 0, 0 } },
// PIECE_O
{ { 0, 0, 0, 0 },
{ 0, 1, 1, 0 },
{ 0, 1, 1, 0 },
{ 0, 0, 0, 0 } },
// PIECE_S
{ { 0, 0, 0, 0 },
{ 0, 1, 1, 0 },
{ 1, 1, 0, 0 },
{ 0, 0, 0, 0 } },
// PIECE_T
{ { 0, 0, 0, 0 },
{ 0, 1, 0, 0 },
{ 1, 1, 1, 0 },
{ 0, 0, 0, 0 } },
// PIECE_Z
{ { 0, 0, 0, 0 },
{ 1, 1, 0, 0 },
{ 0, 1, 1, 0 },
{ 0, 0, 0, 0 } }
};