-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtile.h
75 lines (70 loc) · 2.83 KB
/
tile.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
70
71
72
73
74
75
#ifndef TILE_H
#define TILE_H
/* BGタイル配列 */
unsigned char tile[] =
{
/* 0x00 白背景 */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/* 0x01 ブロック */
0xF7,0x08,0xF7,0x08,0xF7,0x08,0x00,0xFF,
0x7F,0x80,0x7F,0x80,0x7F,0x80,0x00,0xFF,
/* 0x02-0x05 エレキベア */
0x00,0x0C,0x00,0x1E,0x01,0x1E,0x03,0x0C,
0x00,0x0F,0x02,0x0F,0x01,0x0E,0x03,0x0F,
0x00,0x1F,0x00,0x3E,0x00,0x3C,0x00,0x3C,
0x00,0x3C,0x38,0x04,0x00,0x0F,0x00,0x15,
0x40,0x30,0xC0,0x38,0xE0,0x18,0xC0,0x30,
0x80,0x70,0x40,0xF0,0x80,0x70,0xC0,0xF0,
0x00,0xF8,0x00,0x7C,0x00,0x3C,0x00,0x3C,
0x00,0x3C,0x1C,0x20,0x00,0xF0,0x00,0xA8,
/* 0x06-0x09 ポイント */
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x00,0x03,0x00,0x06,
0x00,0x06,0x00,0x03,0x00,0x01,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x80,0x00,0xC0,0x00,0x60,
0x00,0x60,0x00,0xC0,0x00,0x80,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
/* 0x0a-0x0d 箱 */
0x00,0x00,0x7F,0x7F,0x7F,0x40,0x77,0x48,
0x70,0x4F,0x65,0x5A,0x78,0x47,0x7B,0x44,
0x60,0x5F,0x71,0x4E,0x71,0x4E,0x6A,0x55,
0x7B,0x44,0x7F,0x40,0x7F,0x7F,0x00,0x00,
0x00,0x00,0xFE,0xFE,0xFE,0x02,0xBE,0x42,
0x06,0xFA,0x4E,0xB2,0x86,0x7A,0xB6,0x4A,
0x86,0x7A,0xB6,0x4A,0x86,0x7A,0xB6,0x4A,
0x86,0x7A,0xFE,0x02,0xFE,0xFE,0x00,0x00
};
/* BGタイル番号配列 */
unsigned char blank_tile[] = { 0x00, 0x00, 0x00, 0x00 }; // ブランク(白背景)2x2
unsigned char block_tile[] = { 0x01, 0x01, 0x01, 0x01 }; // ブロック 2x2
unsigned char player_tile[] = { 0x02, 0x04, 0x03, 0x05 }; // プレイヤー 2x2
unsigned char point_tile[] = { 0x06, 0x08, 0x07, 0x09 }; // ポイント 2x2
unsigned char box_tile[] = { 0x0a, 0x0c, 0x0b, 0x0d }; // ボックス 2z2
unsigned char blank_single_tile[] = { 0x00 }; // ブランク(白背景)1x1
unsigned char block_single_tile[] = { 0x01 }; // ブロック 1x1
/* マップ用のタイル番号 */
const int BLANK_TILE_NO = 0; // ブランク(白背景)
const int BLOCK_TILE_NO = 1; // ブロック
const int PLAYER_TILE_NO = 2; // プレイヤー
const int POINT_TILE_NO = 3; // ポイント
const int BOX_TILE_NO = 4; // ボックス
const int WALK_TILE_NO = 9; // 歩行ポイント(自動生成用)
/* BGタイル番号配列取得処理 */
char* get_tile(int index)
{
if (index == BLOCK_TILE_NO) { // 1: ブロック
return block_tile;
} else if (index == PLAYER_TILE_NO) { // 2: プレイヤー
return player_tile;
} else if (index == POINT_TILE_NO) { // 3: ポイント
return point_tile;
} else if (index == BOX_TILE_NO) { // 4: ボックス
return box_tile;
} else { // その他: ブランク(白背景)
return blank_tile;
}
}
#endif // TILE_H