标签:
#include<plane.h>
#include"plane_func.h"
#include"bird.h"
void main()
{
G=1;//关闭译码器,以防出现混乱
BEEP=0;
/*****前期准备首*****/
TMOD=1;
EA=1; //总中断
//EX0=1; //外部中断0
ET0=1; //定时器中断
TR0=1; //定时器0
TH0=(65536-49099)/256;//高8位装初值
TL0=(65536-49099)%256;//低8位装初值
key1=1;//赋初值
unit();//关所有灯
wela = 0;
/*****前期准备尾*****/
// hanzixianshi();//显示学院,姓名
if(key3 == 0) //按此开关选择bird
{
while(1)
{
while(key);
delay(5);
if(key==0)break;
while(!key);
delay(5);
if(key==1)break;
}
while(1)
{
wela=1;
P2=0;
wela=0;
game();
}
}
else if(key == 0) //按此开关选择plane
{
init();
dula = 1;
while(1)
{
print();
while(enemy_count != 3)
{
enemy_appear();
delay(2000);
enemy_move();
enemy_count++;
}
enemy_count = 0;
delay(2000);
enemy_print();
delay(3000);
move();
delay(2000);
}
}
}
标签:
原文地址:http://www.cnblogs.com/konghaocc/p/4175867.html