WinForm wrote the little game Tank Wars

Source: Internet
Author: User
Tags thread

Very simple several controls to achieve a tank move, and play bullets to the small game. I hope to bring you a little fun and knowledge.

Note: This program is far from the real game, only to allow beginners to some control and thread more in-depth understanding and application to achieve.

Controls and classes used:

Button,label,imagelist,contextmenustrip,threading,arraylist

Events used:

Button:keypress event.

Attention:

Add four pictures to the Imageslist control, which are the top and bottom four images of the tank. Then bind the ImageList control with the button's ImageList property.

Four photos used:

Bullet is the object of the new Lable class.

The thread calls the method with a parameter call Parameterizedthreadstart

ContextMenuStrip The right Build menu to close the program

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.