TPA - Windows Phone: XNA - Introduction
TPA - Windows Phone: XNA - Introduction
XNA introduction
Agenda
Basic information about XNA XNA endless loop First XNA game XNA vs Silverlight and using them together Bouncing balls Game examples
XNA is a set of tools with a managed runtime environment to make developers life a lot easier when It comes to game development. XNA same source code of a game can be run on the WP7, Xbox 360 and Windows PC. Games can be written in any .NET-compliant language, but only C# in XNA Game Studio Express IDE and all versions of Visual Studio 2008 and 2010 (as of XNA 4.0) are officially supported. Games can be submitted with the AppHub membership for Xbox and Windows Phone
LoadContent
Called before anything is draw in the screen (before the game even starts) You can load here all of your content like Textures, Vectors, 3D models, etc.
Update
Here all the logic is updated from collision to moving sprites, etc Most of the time you will be here as this is what makes the game do whatever is supposed to do.
Draw
Here all you content like player, menu, map, enemies, etc will actually get draw on the screen.
UnloadContent
Game resources are released / disposed.
XNA vs Silverlight
Silverlight - event driven application and UI framework which has a lot of controls with awesome tool support for styling them.
3D graphics are supported through perspective effects using PlaneProjection transform.
XNA vs Silverlight
XNA uses a frame loop that's designed around game development and high performance graphical applications.
It has fast rendering which supports full 3D through Hardware Accelerated 3D API's.
When developing applications for Windows Phone it is a common scenario to use some classes from the other framework. Using XNA in Silverlight
A Silverlight application can use any XNA Framework class except classes from the following assemblies: Microsoft.Xna.Framework.Game and Microsoft.Xna.Framework.Graphics
Bouncing Balls
Create ball.png file
white Circle 512x512 on transparent background
Create project for Bouncing Balls Add ball.png file to the content project Set the Game to FullScreen
Bouncing Balls
Load Your Sprites Texture
Bouncing Balls
Create Ball class
Bouncing Balls
Bouncing Balls
Storing the Balls
Handling Touch Events and Creating Balls
Bouncing Balls
Handling Touch Events and Creating Balls
Bouncing Balls
Drawing the balls
Bouncing Balls
Finall result
Bouncing Balls 3D
XNA to SilverXNA
XNA to Silverlight integration tutorial
Q&A
??