Lattice game Programming main flow

Source: Internet
Author: User

#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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.