Develop Games for Windows Phone

XNA Game Studio and the XNA Framework are designed for cross-platform gaming scenarios with support for Windows Phone, Xbox 360, and Windows-based PCs. This allows you to target more platforms from the same code
base. It also allows developers to focus game design for each platform on real device differences such as
capabilities and experience, as opposed to writing with different frameworks for each targeted device.

Tasks

Discusses how to migrate games written for Zune and Zune HD
on XNA Game Studio 3.1 to Windows Phone with XNA Game Studio 4.0 Refresh.

Leverage Windows Phone-specific Features Through Silverlight

When you develop games for Windows Phone, you can leverage platform-specific features such as
location, accelerometer, and vibration interfaces that are provided through Silverlight 4.0. Similarly, most of
the XNA Framework can be accessed from Silverlight applications.

Tasks

Demonstrates how to detect and use accelerometer input in an XNA Game Studio game on Windows Phone.

On Windows Phone, writable user storage is handled by Silverlight, not by XNA Game Studio. You can use the XNA
Game Studio content pipeline to preprocess read-only game assets that are accessed by the content manager at run
time.

Describes how to use IntermediateSerializer from a Windows application to generate XML content to add to a XNA Game Studio application.

Simplified Graphics Interfaces

XNA Game Studio 4.0 introduces the concept of XNA Framework profiles. These profiles (Reach and HiDef) allow
you to create a clear development environment while targeting broadly or for specific platform
releases. The Reach profile is designed for compatibility across the largest possible range of devices,
including Windows Phone, Windows-based PCs, and Xbox 360 consoles. Choosing the HiDef platform in your
development environment allows you to use platform showcase features.

Configurable Effects

Game Studio 4.0 introduces new and updated configurable effects that will add more variety to your rendering
options. These configurable effects are available for both Reach and HiDef profiles and for all platforms,
including Windows Phone, Windows-based PCs, and Xbox 360 consoles.

Basic Effects—A basic effect includes transforms and basic lighting for Blinn-Phong shading. You have
the option of adding up to three more directional lights, fog, and a texture. Use one light for the fastest
performance, and use three lights for more interesting 3D lighting.

Dual-Texture Effects—A dual-texture effect uses two textures with two independent sets of texture
coordinates. When you blend the two textures, you generate a lot more visual complexity if the first texture
contains the basic color or detail, and the second texture contains complex lighting.

Alpha-Test Effects—An alpha-test effect uses a reference alpha and an alpha function to implement
alpha testing. This can greatly improve rendering performance by only updating pixels where objects are being
drawn in a scene. Alpha testing is common when depth/stencil buffers are not used.

Skinned Effects—A skinned effect uses bones and weights to influence vertex positions, that is, to
move or deform an object. This works very well for character animation and instancing. The effect supports up
to 72 bones, with up to 4 weights per bone.

Environment-Map Effects—An environment-map effect uses a diffuse texture to color or detail an
object, and a cube map texture containing an environment map to shade the object as a result of the
environment. Because the object reflects the scene, this makes the object look more like it is in a real
scene. Also, you can use the fresnel parameter to tune the amount of light reflected (shininess) based on the
geometry of the surface.

An effect initializes the graphics pipeline for performing transforms, lighting, applying textures, and adding per-pixel visual effects such as a glow or a lens flare. Under the covers, an effect implements at least one shader for processing vertices and at least one shader for processing pixels.

System Support for Scalars and Orientation

With new system support for scalars and orientation, you can write your game without worrying about native
resolution or orientation. Scalars can significantly improve game performance. This support comes automatically
when you use the XNA Framework.

Describes the event raised when the display orientation of the GameWindow changes. When this event occurs, the XNA Framework automatically adjusts the game orientation based on the value specified by the developer with SupportedOrientations.

Cross-Platform Input API

While the design of an input strategy for your game is likely to be highly specific to a particular game or
device experience, the XNA Framework provides a cross-platform input interface where an input capability is
likely to be available across multiple platforms. In this release, multitouch support has been added for Windows
and Windows Phone-based applications that use the XNA Framework. The XNA Framework input classes are
orientation-aware and resolution-aware, allowing for greater portability of code and fewer #ifdefs in your game
design.

Enhanced Audio Support

The XNA Framework Audio namespace now allows for audio capture and playback through the Microphone
and DynamicSoundEffect classes. You now have the ability to play back synthesized or buffered audio,
to capture audio through a microphone or Bluetooth headset, and to play it through a headset or speakers.

Microsoft.Xna.Framework.Graphics

New overloads to SpriteBatch.Begin provide an explicit way to draw sprites with a custom pixel
shader.

VertexBuffers are now strongly typed. VertexDeclaration usage has changed in XNA Game
Studio 4.0. Each VertexBuffer now has an associated VertexDeclaration, which becomes
immutable after the buffer is created, allowing for the XNA Framework to automatically adjust the bit layout
of vertex data as required for different platforms.

An effect initializes the graphics pipeline for performing transforms, lighting, applying textures, and adding per-pixel visual effects such as a glow or a lens flare. Under the covers, an effect implements at least one shader for processing vertices and at least one shader for processing pixels.