XNa advanced programming: Xbox 360 and Windows 4-1

Source: Internet
Author: User
4.1 Overview of this Chapter

This chapter mainly discusses Game Basic Principles of the class and related concepts of game components. In the next chapter, you will develop your own image engine, but before that, you need several new helper classes. Where Basegame Class is used to implement more features, and it will use all other helper classes currently. This class inherits from Game Class ( Microsoft. xNa. Framework. Game ) To use all existing XNa Features. Similarly, the main test class Testgame Inherited from Basegame Used to perform static unit tests in the game. In addition Texturefont Class, allowing you to draw text on the screen, Which is not possible out of the box in xNa . Finally, add some functions implemented in the previous chapters, such as user input, controller processing, and sound output, and encapsulate them into special classes. In this way, when developing a new game, it will make things easier. This chapter describes how to use an actual game example.

Unlike the previous chapter, this chapter does not start with the write helper class, but starts with the write unit test and the game master class, and then adds the game components to the project one after another. The problems encountered in the previous projects are very simple. once solved, there is no need to make improvements. However, the Games to be developed in this chapter have a lot of room for improvement, and the larger the game project, the more obvious this point. Processing the oldCodeAnd when improving the game, code refactoring is still the most important thing you must remember. Sometimes, you may even find that the code snippets in the unit test end with the final release of the game code.

Here we will use a Tetris game as an example. It supports the keyboard and Gamepad Input, there is a large game area, there will be blocks of different colors to fall, there is a area to show what is the next square, there is also a score panel that displays the current level, scores, and several rows of bricks are eliminated. If you are a Russian Square Game Fan and often play like me, this game will be very interesting to you. Tetris is the most popular Puzzle Arcade One of the games, it's Russian Alexey pazhitnov In 1985 Invented Nintendo In 1989 Release it Game Boy The system has always been popular.

Related Article

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.