[Airplane Game}

Source: Internet
Author: User

Airplane games


The teacher provided the aircraft game code, put the code into the Cfree run, there is a black dialog box, a seemingly simple game, but the code does not seem easy.

Use the arrow keys to control the aircraft moving around, with W control fired bullets, enemy aircraft constantly flew down from above, bullets hit enemy aircraft score, I machine was the opposite plane crashed into my machine died.

Defines a two-bit array-to-bit game interface that reads the data from the keyboard operation array, outputs the entire array, refreshes, repeats.

Enemy movement: Starting from the first element of the array line, if the number of enemy aircraft, the value of moving down one line, the original position is assigned to a blank value.

Bullet movement: From the last line of the array to determine the first element, if it is a bullet value, the value moves down one line, the original position is assigned to a blank value.

Output array: Starting from the first element in the array, judging the array inside, and outputting the corresponding symbol.

[Airplane Game}

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.