For a new XNA for WP7 project, you can see in its engineering files: Initialize (), Loadcontent (), Update (), Draw () The main functions, It is also possible to see a basic architecture for the XNA Development game:
Loading: Used to load all the resources that guarantee that the game will work, this state runs only before the game starts in the entire system, which means that the entire game is only run once in its lifecycle.
Update: This state is driven by the time interval set, which recalculates the status of each character in the game at each time interval, as well as the game score and various game logic. The default is 30 times per second (frame), and if the setting interval is too large, the game may not start.
Draw: This state is also driven by the time interval set, which is used to draw various changes to the display settings.
For XNA Resources, when a new project is created, a content project is created together, and all resources (images, sounds, videos, fonts, 3D shapes, textures, etc.) are loaded into the project. This project is compiled into the. xnb format of the XNA binaries so that they can be loaded into the game and invoked.
Supported resource formats:
? Autodesk FBX format (. FBX)
? DirectX Effect file format (. fx)
? Font description specified in a. spritefont file
? Texture file. The following types are supported:. bmp,. DDS,. Dib,. HDR,. jpg,. PFM,. png,. ppm, and. TGA
? Game audio specified in the Microsoft cross-platform audio Creation (Tool) format (. XACT)
For XNA Games, you also need input to interact with the game, such as clicking on the screen, various sensors (such as accelerometer). The related namespaces are:
Microsoft.Xna.Framework.Input: For keyboard, button, mouse, etc. input. Only buttons can be used on the WP7 (back, start).
Microsoft.Xna.Framework.Touch: Input for touch. These include gesture and touch location.
In addition, there is a content Pipeline, it is a very important part of the XNA. The material pipeline is used to input, compile, and load game resources, such as textures, 3D models, and sound files. It greatly reduces the amount of code that users get for their own images, 3D data, and shaders in the game. The DLLs that it includes:
Microsoft.Xna.Framework.Content.Pipeline
Microsoft.Xna.Framework.Content.Pipeline.Audio
Microsoft.Xna.Framework.Content.Pipeline.Graphics
Microsoft.Xna.Framework.Content.Pipeline.Processors
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Compiler
Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate
Microsoft.Xna.Framework.Content.Pipeline.Tasks