学了32一段时间,所以想做个小游戏,因为这个不花钱嘛,但是看到这里我有点看不懂了
u16 Tetris[19]={0x0F00,0x4444,0x0660,0x4460,0x02E0,0x6220,0x0740,0x2260,0X6220,0x0E20,0x6440,0x0470,0x0C60,0x2640,0x0360,0x4620,0x04E0,0x2620,0x0E40,0x4640};
u16 BoxSR[Y_BOXS+4]={0x0000,0x0000,0x0000,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,0xFFFF};
_Shape NewShape={60,30,SHAPE_COLOR,1,1,1,0};
_Game Game={10000,1,0};
void LCD_DrawBlock(u16 sx,u16 sy,u16 color)
{
LCD_DrawRectangle(sx,sy,sx+BPIXEL-1,sy+BPIXEL-1,color);
LCD_Fill(sx+2,sy+2,sx+BPIXEL-3,sy+BPIXEL-3,color);
}
void LCD_DrawShape(u16 sx,u16 sy,u8 n,u16 color)
{
u8 a,b;
u16 temp=Tetris[n];
u8 i;
for(i=0;i<16;i++)
{
a=i/4;
b=i%4;
if(temp&
0x8000)
{
LCD_DrawRectangle(sx+b*BPIXEL,sy+a*BPIXEL,sx+(b+1)*BPIXEL-1,sy+(a+1)*BPIXEL-1,color);
LCD_Fill(sx+b*BPIXEL+2,sy+a*BPIXEL+2,sx+(b+1)*BPIXEL-3,sy+(a+1)*BPIXEL-3,color);
BoxSR[sy/BPIXEL+a]|=1<<((sx/BPIXEL)+b); //±ê¼Ç¸Ã·½¿éòѱ»í¼DÎÕ¼óÃ
}
temp<<=1;
}
}
其中红 {MOD}字体由什么决定的?当我改为0x1000,0x2000,0x4000时生成图形就不一样了
是参照这个帖子的程序
http://www.openedv.com/forum.php ... digest%26digest%3D1
一周热门 更多>