共用方式為


Creating a Zune Game or Library Project

Describes how XNA Game Studio includes a set of project templates that will help you to develop game projects for Zune using the XNA Framework.

Starting a New Project

To begin a new Zune project, click File, and then click New Project.

Dd282465.UsingXNA_NewProjectDialog_Zune(en-US,XNAGameStudio.30).png

Project Types

XNA Game Studio provides template types for XNA Framework game development in the XNA Game Studio 3.0 section of the Visual C# project types. The templates offered for developing XNA Framework games for Zune are:

  • Zune Game (3.0) – A project for creating an XNA Framework 3.0 game application for Zune.
  • Zune Game Library (3.0) – A project for creating an XNA Framework 3.0 game library for Zune.
  • Content Pipeline Extension Library (3.0) – A project for creating an XNA Framework 3.0 Content Pipeline Extension Library. For more information, see Creating a Windows Game or Library Project.

For information about XNA Game Studio project templates for Windows or Xbox 360, see Creating a Windows Game or Library Project and Creating an Xbox 360 Game or Library Project.

Zune Game (3.0)

XNA Game Studio provides an Zune Game template that creates and loads a set of starter files. This new project contains basic code that renders a colored background.

Results

The new starter project contains the following important features.

Dd282465.UsingXNA_SolutionExplorer_Zune_GameSolution(en-US,XNAGameStudio.30).png

Project Properties

These properties control many aspects of your current project. Some examples include general application settings, debug settings, and additional project resources. You can use the Project Designer to modify the values for these properties.

In addition to these properties, assembly information (such as the game title) is stored in the AssemblyInfo.cs file. You can use the Assembly Information dialog box to modify this information or you can manually edit the .cs file.

References

References to the Microsoft.Xna.Framework and Microsoft.Xna.Framework.Game assemblies exist in the project as well as the mscorlib, System, System.Core and System.Xml.Linq assemblies. In addition to these standard assemblies, you can add other assemblies, depending on the project type.

Content

The nested content project stores and builds content for the game. For more information, see Game Content Project.

Game1.cs File

This file is a good starting point for adding simple game logic and basic features. It implements a single class (derived from Game and called Game1) and overrides five methods: LoadContent, UnloadContent, Initialize, Draw, and Update. In addition, the Game1 constructor is defined by this file. Use these methods to initialize your game components, load and render your game content, and handle any input from the user or changes to the game environment.

GameThumbnail.png

The icon displayed in the Games Library, and when this game is packed for distribution as a .ccgame. For more information on distribution, see Sharing Your Game Package.

Program.cs File

This file also implements a single class (called Program) that provides an entry point to game execution. Usually, little code is added to this file unless the game is fairly advanced.

To create an Zune Game (3.0) project

  1. From the File menu, click New Project.

  2. Select the Zune Game (3.0) project type.

  3. Type the name for the game project in the Name text box.

    You can also modify the default values for the Location and Solution Name controls.

  4. Click OK to create and load the new project.

Zune Game Library (3.0)

XNA Game Studio provides an Zune Game Library (3.0) template that creates and loads a set of starter files. Typically, projects of this type contain managed classes that implement basic or advanced features used by a game engine. Once completed, these class libraries can be referenced by other Zune projects and provide common functionality without having that code reside within the game project.

The new project contains basic code that implements an empty library, usable by other Zune Game projects or Zune Game libraries.

Results

The new starter project contains the following important features.

Dd282465.UsingXNA_SolutionExplorer_Zune_Library(en-US,XNAGameStudio.30).png

Project Properties

These properties control many aspects of your current project. Some examples include general application settings, debug settings, and additional project resources. You can modify the values for these properties using the Project Designer.

In addition to these properties, assembly information (such as the library title) is stored in the AssemblyInfo.cs file. This information can be modified using the Assembly Information dialog box or manually editing the .cs file.

References

References to the Microsoft.Xna.Framework and Microsoft.Xna.Framework.Game assemblies exist in the project as well as the mscorlib, System, System.Core and System.Xml.Linq assemblies. In addition to these standard assemblies, you can add other assemblies, depending on the project type.

Content

The nested Content project stores and builds content that is to be included in the game library. This is useful for including reusable content assets that support the classes and methods in the game library. For more information, see Game Content Project.

Class1.cs File

This file implements an empty C# class within a namespace, providing a starting point for the class library.

To create an Zune Game Library (3.0) project

  1. From the File menu, click New Project.

  2. Select the Zune Game Library (3.0) project type.

  3. Type the name for the library project in the Name text box.

    You can also modify the default values for the Location and Solution Name controls.

  4. Click OK to create and load the new project.

See Also

Developing Xbox 360 Games
Creating a Windows Game or Library Project
Sharing Your Game Package