Tank Wars Game Design (c + +)

Source: Internet
Author: User

Design: Achieve a C + + version of the classic tank war game.

Functional design:

1) To achieve the two-man battle function. Win: But destroy each other's tanks or blow up each other's headquarters first.

2) The battlefield consists of a lattice of 26*26, tanks for 2*2, the headquarters of the banner 2*2, bullets for 2*1, Stones and iron block: 1*1

Tanks and bullets move one cell at a time.

3) Tank event:

Generated: generated at the original location (that is, given the original coordinates)

Mobile/non-removable: Receives the move command, determines whether the 2*1 is a space, moves, or abandons the move.

Turn: Move when you receive a left or right turn command

Hit: When the bullets coincide, the tank is destroyed, the delay shows the explosion screen, and then disappears.

4) Bullet Event:

Generation: In front of the tank cannon Tube generation, first to the coordinates, first judge hit, hit then disappear, not hit then take the bullets in front of the next box to continue to judge (that is, moving).

Whether to hit: disappear when with borders, tanks, bullets, stones, iron blocks, and coincident.

Movement: The speed of the bullet moves, depending on the dwell time in the lattice, first set to stay 1/4 seconds after moving to the next grid.

Tank Wars Game Design (c + +)

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.