Auxiliary class -- Summary

Source: Internet
Author: User
Summary

In this chapter, you have learned a lot of classes that will be useful in future projects. Unit testing is also an important knowledge point, and I want to persuade you to write unit testing first as a way to start game development. This chapter focuses on breakout games. This chapter contains a lot of content. Fortunately, you can skip some of the knowledge points of the breakout game, because many parts of the game can reuse the pong game in the previous chapter.

The center of the next chapter will be a little more on game programming and how to use components to build a game. This chapter shows the usefulness of the helper class. Now you are ready to extend this idea to the game.CodeThis is very important for creating more complex games.

Here is a summary of what you have learned in this chapter:

  • Try to use helper classes to encapsulate code into methods or helper classes, especially those that will be used multiple times.

  • Always write the unit test first and then perform the specific implementation.

  • Unit testing should be simple. You do not have to waste time writing unit tests that are too complex for the helper class, or make static unit tests more complex than the game itself. Unit testing is not important for the final game (in fact, you can use the # If debug command to exclude them), they just make your work more calm, helps you test and reuse new and existing code.

  • Each time you modify the code, you must run the unit test to ensure that no problem exists:

    • Use testdriven. Net to run a single test, or run each test in each class or namespace in Solution Explorer.

    • Or use nunit GUI for testing.ProgramAll unit tests in a set. For static unit tests, use the program class for manual tests.

    • Test the most complex parts of the game as much as possible, such as collision detection in the breakout game.

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.