java编的俄罗斯方块这句话啥意思,请大家给讲解一下static int[][] pattern = {{0x0f00,0x4444,0x0f00,0x4444},//用十六进至表示,本行表示长条四种状态{0x04e0,0x0464,0x00e4,0x04c4},{0x4620,0x6c00,0x4620,0x6c00},{0x2640,0xc6
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/24 15:27:54
0,6jy=oeQJqE
java编的俄罗斯方块这句话啥意思,请大家给讲解一下static int[][] pattern = {{0x0f00,0x4444,0x0f00,0x4444},//用十六进至表示,本行表示长条四种状态{0x04e0,0x0464,0x00e4,0x04c4},{0x4620,0x6c00,0x4620,0x6c00},{0x2640,0xc6
java编的俄罗斯方块这句话啥意思,请大家给讲解一下
static int[][] pattern = {
{0x0f00,0x4444,0x0f00,0x4444},//用十六进至表示,本行表示长条四种状态
{0x04e0,0x0464,0x00e4,0x04c4},
{0x4620,0x6c00,0x4620,0x6c00},
{0x2640,0xc600,0x2640,0xc600},
{0x6220,0x1700,0x2230,0x0740},
{0x6440,0x0e20,0x44c0,0x8e00},
{0x0660,0x0660,0x0660,0x0660}
};
java编的俄罗斯方块这句话啥意思,请大家给讲解一下static int[][] pattern = {{0x0f00,0x4444,0x0f00,0x4444},//用十六进至表示,本行表示长条四种状态{0x04e0,0x0464,0x00e4,0x04c4},{0x4620,0x6c00,0x4620,0x6c00},{0x2640,0xc6
应该是用1表示图形,将4个十六进制按行排列看
例如:
0x0f00:0000
1111
0000
0000
0x4444:0100
0100
0100
0100
长条应该就这两个状态
再如T型(4个状态):
0x04e0:0000
0100
1110
0000
0x0464:0000
0100
0110
0100
0x00e4:0000
0000
1110
0100
0x04c4:0000
0100
1100
0100
其他类推,注意看那些1就可以了.就是俄罗斯方块的图形啊,1代表有,0代表没有