Unity aircraft vs. enhanced version

Source: Internet
Author: User


Brief introduction:

Thank:

This application uses the resources provided by the UNITY3D\2D mobile game development, the copyright belongs to its author, here thank the author. This application is based on two development of the original.

Enhanced Features:

1. Add 2s cd fuselage rotation, keep invincible when rotating, people block kill ...

2. Join the 0,5S CD tracking missile and the missile randomly strikes the target enemy.

3. Strengthen small aircraft AI, small aircraft with three flight modes, straight lines, sin curves, and tracking players. Randomly select flight modes at different probabilities.

Technical elements:

1. For player aircraft, a simple switch-case finite state machine is used.

2. For small aircraft AI use rain ai behavior tree.

3. The source package of the book is upgraded to unity5.0, and the mesh trigger bug of the upgrade is eliminated.


Player part state machine source code

         void Normal () {if (Input.getmousebutton (1)) {state=playerstate.arounding;}} void Shoot () {m_superrate-= time.deltatime;if (m_superrate <= 0) {m_superrate=0.5f;instantiate (M_srocket, m_ Transform.position+new Vector3 (0.5f,0,0), m_transform.rotation); Instantiate (M_srocket, m_transform.position+new Vector3 ( -0.5f,0,0), m_transform.rotation);} M_rocketrate-= time.deltatime;if (m_rocketrate <= 0) {m_rocketrate = 0.1f;if (Input.getkey (KeyCode.Space) | | Input.getmousebutton (0)) {Instantiate (M_rocket, m_transform.position, m_transform.rotation); M_audio. Playoneshot (M_shootclip);}}} void CoolDown () {m_around-= time.deltatime;if (m_around <= 0) {m_around = 1f;state=playerstate.normal;}}

Enemyai behavior Tree:


GitHub Address

https://github.com/RonTang/ShootingGamex/

Unity aircraft vs. enhanced version

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.