资 源 简 介
# include
# include
# define N 4
# define time 500
# define uchar unsigned char
sbit keyenable=P3^6;
sbit up=P3^2;
sbit down=P3^4;
sbit right=P3^3;
sbit left=P3^1;
uchar code table[N+8]={0,0,0,0,1,2,4,8,16,32,64,128};
char x[4];
char y[4];
char m[8][8]={0};
uchar p[8];
int n=0;
/**************
延时函数
***************/
void delay(char MS)
{
char us,usn;
while(MS!=0)
{
usn = 0;
while(usn!=0)
{
us=0xff;
while (us!=0){us--;};
usn--;
}
MS--;
}
}
/***************
判断是否碰撞函数
**************/
bit coll(void)
{
bit k=0;
int i;
for(i=0;i<4;i++)
{
if(y[i]==7)
k=1;
if(m[x[i]][y[i]+1]==1)
k=1;