learn wp7 XNA game development (two. XNA Game Development Architecture)

Source: Internet
Author: User
Tags format serialization time interval touch

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



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.