When talking about the Air Combat System in RPG, the first thing that comes to mind is 3D, which is a rare task. For example 《Permanent Tower. Of course, there are similar implementations in 2.5D online games, such 《Journey to the West onlineBut the air combat of the game only transforms the battlefield (scene) into the air. The ground only shows the background of motion, similar functions have already appeared in famous 2D games such as the westward journey series.
In this section, I will guide you through simple modifications on the basis of the demo to easily implement the perfect sky and earth space layered Combat System: When the protagonist flies into the sky, we can view all the real activities of roles and animations on the ground through the clouds. When the protagonist lands on the Earth, everything in the sky will be hidden, everything will appear natural and close to reality.
With Section 8 space scaling system and role flying space system as the foundation, it is easy to implement a space layered combat system. The key points (key points) it is necessary to grasp the relationship between the positions and scaling of roles and their associated objects, such as flying bullet particles, floating damage numbers, and shadows.
The most critical attribute is the spacelayer attribute in all object base class objectbase, based on the different layers of the object, perform operations such as proportional scaling of the space to itself and Z-depth addition to achieve hierarchical presentation:
Double _ scale = 1;
/// <Summary>
/// Get or set Scaling
/// </Summary>
Public double scale {
Get {return _ scale ;}
Set {
_ Scale = value;
This. rendertransform = value = 1? Null: New scaletransform () {centerx = center. X, centery = center. Y, scalex = value, scaley = value };
}
}
Int zaddition = 0; // hierarchical Addition
Spacelayers _ spacelayer = spacelayers. ground;
/// <Summary>
/// Obtain or set the location of the spatial Layer
/// </Summary>
Public spacelayers spacelayer {
Get {return _ spacelayer ;}
Set {
If (_ spacelayer! = Value ){
Switch (_ spacelayer = value ){
Case spacelayers. Ground:
Zaddition = 0;
Scale = 1;
Break;
Case spacelayers. Sky:
Zaddition = 100000;
Scale = 2.4;
Break;
}
Z = (INT) position. Y;
}
}
}
Public override point position {
Get {return base. position ;}
Set {base. Position = value; Z = (INT) value. Y ;}
}
Public override int Z {
Get {return base. Z ;}
Set {base. z = zaddition + value ;}
}
In reality, we can use the radar map of HUD to mark the positions of the roles that appear in the sky or at different levels on the ground in different colors.
The layered Combat System of the sky and the earth not only greatly enhances the game's fun, but also enhances the fun of playing strange games and PK with the features of a wider field of view and double use of the same space. For example, when killing the boss monster, players can fly into the cloud to hide and look down on the earth to find opportunities. Once the boss's surroundings are scattered, they can immediately land on the boss side to get a group flat, you can't get rid of a bunch of hind legs, and you can't get rid of them, which is very annoying. For example, when you are fighting with your enemy, you can give it a dizzy blow in the form of a sudden arrival, so that you can not escape in a short time, the next few seconds believe that you hate enough? This is a more gentleman than the traditional one who has to use stealth, and then the ink and Ink trace appear next to the enemy's house. I don't play Yin, do I? Of course, players can also take advantage of the air in the city war and the help war, like Stealth bombers to kill it by surprise. Collective airborne attacks bring about a qualitative change in the war situation, the most important thing is that you do not forget that there is no obstacle in the air. Please add a castle ~
In addition, the role of the Space layered combat system is not only reflected in the strange attack on the ground. If both sides have the ability to fly to the air, then the situation of J20 vs f22 will inevitably fail. This is definitely the king of kings! Fighting above all things! Brother, pick a place for PK. What about the sky? Look at the sentient beings, the cloud than the sword, victory over the wind of the bauhinia, the more magnificent Huashan.
Of course, if there are more advanced requirements for designers, such as adding additional space layers such as the sea (Atlantis), the underground city, and the space layer, such a combat system will expand to any more complex layer. In addition, you can design a game as a ground-to-air role that can combat each other through the remote attack mode, perhaps this will lead the ultimate visual and control experience of high simulation 2.5D RPG in the future!
To download the source code of this Section, go to the directory.
Online Demo address: http://cangod.com