Location:
Search - 8x8snake
Search list
Description: 8x8点阵做的贪吃蛇游戏 51单片机为主MCU,原理图非常简单,可供初学者更好玩程序-8x8 matrix of the Snake game to do 51 single-chip-based MCU, a very simple schematic for the beginner process more fun
Platform: |
Size: 430080 |
Author: 单机片 |
Hits:
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)) //是否吃东西-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)) //是否吃东西
Platform: |
Size: 1024 |
Author: 风中云 |
Hits: