Create your first game pong-what does it look like on Xbox 360?

Source: Internet
Author: User

 

What does it look like on Xbox 360?

Now the game is complete, and you have done a lot of tests on the Windows platform. As I have explained in chapter 1, there are several steps to start and run the xNa framework on Xbox 360. If the xNa game launcher on Xbox 360 has been started, you can try to compile your xNa pong game and deploy it on the console.

For Xbox 360, there are some important things to remember:

  • Do not use any external DLL unless necessary-Although xNa game library DLL is supported, most DLL files on Windows platforms will call windows system DLL files, which do not exist on the Xbox 360 platform, even worse, it is not supported to use p-invoke to call Unmanaged DLL files on the Xbox 360 platform for security reasons. Do not use non-securityCodeOr try to call external code, access devices, or use unsupported features. This is a waste of time. You 'd better follow the rules.

  • Always test-In the project test, if you change the output settings to Xbox 360, You need to test whether the code can be compiled. Many of the methods you use do not exist on Xbox 360. For example, the dynamic library system. dll on Xbox 360 does not have the tryparse method, and there are some xNa methods and classes, such as the mousestate class, which are not even supported by default.

  • Do not load content directly-On Windows, it is feasible to directly load textures and shaders with the help of texture2d or compiledeffect constructor. On Xbox 360, these methods do not exist at all; you can only use content pipelines to load content. If you use dynamic loading or reload textures/shaders code, they only work on Windows platforms, so they are built for Xbox 360ProgramTo use # If! Xbox 360... # Endif mark to include the code.

  • Save the game and load other content-To save the game, you can use the content namespace and many useful helper classes. Storagecontaine. titlelocation can also be used on Windows platforms, and only output folders are used. With it, you must always ensure that the correct path is used to load content. Loading from other locations in Xbox 360 may cause access denied exceptions for Io operations.

  • Test resolution-The Xbox 360 supports many resolutions different from those of the PC, so you should test at least two or three different resolutions to ensure the normal operation of the game.

  • Allow gamepad to operate everything-Most xNa games I have seen make a mistake in that they only support keyboard input or gamepad input, this means that they can only run on windows, or on Xbox 360. It makes sense for your game to support as many input devices as possible.

  • Debug and unit testing on Xbox 360-There is no difference between debug debugging and unit testing on the Xbox 360 console; the same rules can be applied. It may be difficult to track errors and record information, but xNa can be used to perform step-by-step debugging and detection unit testing. Make good use of this. By the way: on the Windows platform, If you edit the code during debugging, you can continue to execute it, but not for Xbox 360 games. This is really annoying. However, most of you are mainly engaged in development on the Windows platform.

This xNa pong game always takes into account the Xbox 360 when coding; all the methods and features you use are supported on the Xbox 360. So there is no big problem in testing this game on Xbox 360. You can directly deploy it, start it, and run normally, as shown in Figure 2-11.


Figure 2-11

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.