Enhanced Tank Wars (Java Edition)

Source: Internet
Author: User

Reprinted from: http://blog.csdn.net/lihongxun945/article/details/6275581

This tank war is a reference to a tutorial of a horse soldier who was a beginner in Java and a tank battle on a bully, and added a lot of heroic attributes in Warcraft (speed of movement, attack speed, attack, life limit, etc.), plus a small map editor.

Don't say much nonsense, first:

Game interface:

Map Editor:

Detailed Description:

1, in addition to the picture of the tank, all the other pictures for their own hand-painted, may be a bit ugly, especially the base--!

2, the main game screen, the right side for the Properties window, in the main interface press F4 open the Map editor

3, the rules of the game: each inning will have 3 waves of enemies, each wave has 6, whenever the last wave of the enemy is almost all destroyed, the next wave of enemies will appear. All 3 waves of enemies are destroyed and automatically enter the next level. Attacking the enemy has a certain probability of randomly appearing on the map of different food, there are 10 kinds of food, after eating can enhance various properties (such as increased life limit, bullet power, attack speed, movement speed, invincible, etc.), the base every minute will randomly produce a food at the base directly above. The base is wiped out or the tree of life is 0 game over. The enemy cannot eat food. The walls are less vital and can be destroyed. The steel plate cannot be destroyed. Rivers cannot be destroyed, but bullets can fly over rivers. At each pass, the enemy's attributes are enhanced, and their properties are enhanced (the death remains unchanged after resurrection). Super bullets are emitted to eight lines of defense, with a number limit, which can be increased by eating food. The enemy bullets won't attack the enemy, but their bullets will attack their base! All tanks have no collision volume with each other.

4, Map loading

Each map file is saved in the Maps folder in the root directory, respectively, with 0,1,2,3 ... Means 1,2,3,4 ... TKM, the game automatically loads the corresponding map based on the current level.

5, message

Being attacked, and eating food will generate a message on the screen, and slowly rise and disappear after a few seconds. For example, a message similar to 20 will be generated after being attacked.

6, properties

Both yourself and the enemy have about 10 properties, namely coordinates, HP, direction of movement, barrel direction, bullet power, bullet speed, bullet interval, movement speed, number of super bullets, invincible time, etc., (note that the bullet speed is the speed of the bullet, The bullet interval is the minimum interval between the last bullet and the next, and these properties can be boosted by the corresponding food, but some properties are in the county.

7, obstacle

There are 3 types of obstructions: Earth walls, steel plates, rivers, and walls have less health and can be destroyed. The steel plate cannot be destroyed. Rivers cannot be destroyed, but can be penetrated by bullets.

8, base

The base has a health value, the base health value is 0, then the game is over. The base produces a random food every 1 minutes. Some foods can increase the base life limit or restore the base to full life.

9, Enemy AI

The enemy's AI is set to go randomly in one direction, and according to the firing frequency set, each step to a certain probability of firing bullets. The direction is automatically changed when the obstacle is encountered.

10, Map Editor

The Map Editor can select the appropriate obstacle from the right and place it on the map, and select the shovel to clear. Click the Save button (actually this is not a button), then automatically save the map to the maps directory in the edit.tkm file, renaming the file can be used as a normal map use (such as 5.tkm to become the fifth level of the map, the game to the fifth level will automatically load, but please press 1, 2,3,4 order), do not edit the base, because the base is automatically added to the bottom of the screen Central. There is no auto-alignment function for the grid and can be placed anywhere. You can change the picture by replacing the corresponding picture.

11, other

The system screen refresh frequency is 20hz. The behavior of all objects in the game is based on the time of the refresh frequency.

Exported as a jar file does not work properly, because the picture loading method has a problem (not quite understand at the time, and now too lazy to change). So please run it in the MyEclipse.

Enemy parameters may be designed not rigorous, may be too difficult or too simple, you can adjust their own.

The file structure is a bit confusing, just look at it.

There are currently four maps of the map, you can use the Map editor to edit the new map

Disclaimer: For the purpose of learning and entertainment only.

Attached: source code

http://download.csdn.net/source/3124636

Enhanced Tank Wars (Java Edition)

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.