Development of a flying and shooting mobile game similar to thunder fighter-game target, thunder fighter shooter
Requirement Analysis
Since we are playing airplane games, what game targets do we need? Observe the pictures in the game under the camera. First of all, the main character is of course an airplane, including a gamer plane, dual-wing planes, and enemy planes. The aircraft is equipped with a variety of weapons: normal bullets, missiles, laser, etc. It would be too boring if the bullets remain unchanged and the planes remain unchanged. So we also added items. When the enemy plane is shot down, there will be a certain probability of opening up the gems and other reward items, for example, weapon upgrade, fighter leeching, Armor Repair, super mandatory killer, and quantum shield.
Is the clear screen effect of "Super mandatory killer" very good !!
Is there a translucent blue circle on the perimeter of the Golden plane in the lower right corner? This is quantum shield.
Class Design
Now, the demand analysis is almost done. Let's abstract these game objects, such:
Therefore, we put the vector <Bullet> member variable in BulletGroup, which is a simplified "Bullet pool". When a Bullet needs to be fired, the Bullet is obtained from the pool, when a bullet explodes or flies out of the screen, it needs to be recycled and put back into the pool.
In the next article, we will use the code to describe various game objects.