Description: while(1)
{//if(keyenable==1){P1=0x00 P2=0xff }else{P1=0xff P2=0x00 }
for(i=3 i<SNAKE+1 i++)x[i]=100 for(i=3 i<SNAKE+1 i++)y[i]=100 //初始化
x[0]=4 y[0]=4 //果子
n=3 //蛇长 n=-1
x[1]=1 y[1]=0 //蛇头
x[2]=0 y[2]=0 //蛇尾1
addx=0 addy=0 //位移偏移
//k=1
while(1){if(keyenable)break timer0(1) }
while(1)
{timer0(e)
if(knock()){e=SPEED break } //判断碰撞
if((x[0]==x[1]+addx)&(y[0]==y[1]+addy)) //是否吃东西
To Search:
File list (Check if you may need any files):
8x8点阵做的贪吃蛇游戏.C