[Game development-Learning notes] Rookie slowly Fly (iii)-Official tutorial Learn to be careful

Source: Internet
Author: User

    • Own things to do on their own

Example: The official tutorial "Tanks Tutorial", small tanks: mobile, mobile sound, shooting, health management, etc. component are mounted on the gameobject tank own body. Shells, then manage their own explosions and so on.
Many benefits:
~ more convenient when developing and maintaining
~ Meet the "face of the object" thinking

    • A script to do one thing
      Example: The official tutorial "Tanks Tutorial", the small tank: C # script divided into three, mobile, life management, shooting.
      Many benefits:
      ~ The blast script in the shells can call life management individually to change the health value.
      ~ More clarity of code
      ~ more convenient when developing and maintaining

Think: Is that the same thing in a big project?

    • Script Reuse
      For example: The official tutorial "Adventure Game Tutorial" has a lot of script reuse. This programming idea is very simple, that is, script x, you can give a at the same time, give B, for C. There are many benefits, you just write a script x. Of course there are advantages and difficulties, it requires you to have a better understanding of the project, which scripts can be reused, those functional scripts can be summed up together, which is not.

      The script is reused with the previous two contradictions. In fact, not contradictory:
      -Do your own thing yourself-for gameobject,
      -a script to do one thing, for the function of the script,
      -Script reuse, for script use

[Game development-Learning notes] Rookie slowly Fly (iii)-Official tutorial Learn to be careful

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.