Key points of the flying game program design [some experiences when I was playing the j2's Game]

Source: Internet
Author: User

Key Points of flight game program design

1. Map 1.1 levels
If the game is completely played on the first layer, it will be boring. Therefore, it is necessary to level the game. There are tanks and some turret on the ground, and there are enemy planes rushed out from time to time in the clouds, and the top layer is the main body of the game screen, a large number of enemy planes!
Therefore, the game should be divided into three layers! How to splice the main Image Layer 1.2 on the ground cloud (optional for cloud layer)
It is unrealistic to use an integral graph, which will affect the execution efficiency of the program and occupy a lot of space. You can only splice a graph block. Therefore, we need to design reasonable blocks and arrange map indexes. In addition, the searching and use of map tools and the editing of scripted maps make map editing more convenient, not only for programmers, other personnel, such as planning and art, can use this tool to edit and export the spliced file to the program personnel. 1.3 load map
Write the Map Index into a file. When the program loads the index, it reads the map content through the input/output stream. Used in combination with the map tool to extract independent tool classes and functions.

2. Bullets
In a flying shooting game, the most important thing is the full screen and overwhelming bullets. Therefore, the design of bullets is the key to the success of the game. 2.1 bullets fired by gamers
The default bullet is the minimum lethal and basic bullet form.
By getting a bullet clip from the enemy, you can change the bullet pattern of 2.2 normal enemy bullets
It can be roughly divided:
Quickly dropped bullets
A circle-shaped bullet Group centered around the enemy plane
Set a 2.3 boss bullet that can be used to send a tracking player
Specific attributes are divided into three stages of life,
Launch different bullets at every stage of the boss's life
The characteristics of the boss bullet: intensive, fast 2.4 extraction of General bullet modules
Bullets have their common characteristics and are extracted separately for reuse in the future.

3. Collision Detection 3.1 how to detect a collision
In a flying shooting game, collision is the most critical technology. If it cannot be well solved, it will affect the interests of gamers. To put it bluntly, the flying shooting game is a collision game-avoiding enemy bullets or planes and using its own bullets to hit the enemy.
The rectangle detection is used. First, the rectangle detection area is set and the distance between planes and bullets is determined cyclically. 3.2 Response to the collision
Once it is determined that two objects have collided, it is necessary to respond to this situation. The simplest response is to delete an object (or two) from the game. This is common in this type of games.
A: A collision between an enemy plane bullet and a warship controlled by a player
The gamer's warship loses blood until there is no life. The warship experienced a violent explosion (playing an animation, a group of continuous pictures), and the bullet disappeared.
B: a collision between a player bullet and an ordinary enemy warship
Enemy planes exploded. Play the animation and the bullet disappears.
C: collision between a player bullet and a boss
The boss loses blood until the end of his life. Then, an explosion occurs. The Player effect is displayed as control.
Explosion effect: explosion pictures and player aircraft pictures are stored separately
Looming effect: comprehensive control of player display status and time
4. Enemy 4.1 ordinary enemy intelligence
There are at least three types of enemies:
For example, an airborne turret
Large warship
Tanks on the ground point slowly to the player's 4.2 boss intelligence
Different levels of different boss should be designed,
Random location change
There is a certain probability of a rapid rush to the players
There is a certain probability that players will be followed
It mainly follows and avoids algorithm 4.3 attributes.
A: Attributes of common enemies
How long can the attack be sustained.
Frequency of bullet launching
Will it chase players?
B: attributes of the boss
Is there a big offer?
Design a variety of different big moves
Skills of the boss at each level

5. Game buttons
Considering that the direction keys on some players' mobile phone keyboards are not special rules or difficult to operate, we should design a number key to correspond to the direction keys.
In this fierce flying game, the response speed of keys should be considered. For example, when right-clicking, the plane moves to the right, and the right-clicking is released, the plane should immediately stop moving to the right.
In this way, the left and right buttons respectively control the left and right movements of the plane. By default, the plane will move up slowly along with the screen. Setting the upper key can accelerate the plane, this will play a major role in evading the pursuit of the enemy.

6. Game Archiving
Players are not interested in a game that starts from scratch every time it starts. Therefore, we must provide the game archiving function to save the levels and other status information of the current game, all this information is stored in memory through the record management system (RMS). When a player returns to the game, he can choose to restore the previous state. 7. Efficiency 7.1 ignore minor details
A large amount of time in the game, resources are consumed in the collision detection, so that the performance and efficiency of the game do not affect the game playability, some details need to be ignored. For example, when a collision occurs, the distance between several pixels is unnecessary.

7.2 do not frequently create objects
The object pool is used to reduce the total number and frequency of object creation, which can greatly improve the game performance. Consider the meaning of each object creation carefully. 7.3 screen rendering Problems
Most of the games are used to draw images. Reducing the number of screen repainting times is good for performance improvement. We can cyclically check whether the screen image has changed in a certain part. If not, we don't need to update the screen. The other method is to increase the size of the image to reduce the number of calls to the image separately. 7.4 complex images are drawn in advance.
You can use screen buffering 7.5 to save operations
The pre-calculation of the value can avoid calling the large-sale calculation method.

8. Compatibility 8.1 uses lower versions of MIDP and cldc
To adapt to various models (including low-performance models), we recommend that you use midp1.0 and cldc1.0. 8.2 different screen sizes
We recommend that you use relative coordinates or ant configurations to adapt to various models of screens.

9. Plane module 9.1 aircraft module Extraction
Aircraft, whether gamers or non-gamers, can be used to escape their commonalities. In future implementations, players and enemy planes can all be derived from a base class.

10. Level
Settings of the level map:
Different levels need different maps. The level file should be defined outside to define the specific attributes of each level. This is currently a very popular method. 11. Special Game Effects
The most important aspect of a flying shooting game is its explosive special effects. First, it needs to give the player a visual shock.
A: major player moves and special effect Design Problems
B: enemy boss

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.