#include <plane.h>
#include "plane_func.h"
#include "Bird.h"
void Main ()
{
g=1;//turn off the decoder to avoid confusion
Beep=0;
/***** preparation of the first *****/
tmod=1;
Ea=1; Total Interruption
Ex0=1; External Interrupt 0
Et0=1; Timer Interrupt
Tr0=1; Timer 0
th0= (65536-49099)/256;//High 8-position loaded initial value
tl0= (65536-49099)%256;//low 8-bit loading initial value
key1=1;//Assignment Initial value
Unit ();//Turn off all lights
Wela = 0;
/***** Preparation of tail *****/
Hanzixianshi ();//Show Academy, name
if (Key3 = = 0)//Press This switch to select 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)//Press This switch to select 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);
}
}
}
Lattice game Programming main flow