Upload
boybuon205
View
1.220
Download
0
Embed Size (px)
DESCRIPTION
Citation preview
Game Development with Microsoft XNA Studio
Tran Minh TrietFaculty of Information TechnologyUniversity of Science, VNU-HCM
AcknowledgementThis presentation reuses materials from:
“XNA Game Studio 3.0”by Frank Savage, Architect, Microsoft Corporationpresented at PDC 2008“XNA Studio: Introduction to XNA”by Brian Keller, Product Manager, Microsoft Corporationpresented at PDX 2006
Demonstration “Mini Age of Empires”by Nguyen Khac Huy, Le Vu Thai BaoUniversity of Science, VNU-HCM, 2009
XNA Timeline
Showed progress on tools convergenceAnnounced
“XNA Studio”
Windows and Xbox tools convergence
XACT, PIX Common Controller, Live on Windows
SDK teams committed to this effort for current and new tools
Tech Preview at GDCXNA Game Studio Express
2004 2005 2006
XNA Timeline
XNA Game Studio 3.0for Visual Studio 2008
XNA Game Studio 2.0To be used with all versions of Visual Studio 2005
2007 2008 Future
What is XNA Game Studio?
Framework
XNA Game StudioExtends Visual Studio 2008to create games using C#
XNA FrameworkCross-platform gamedevelopment framework and runtime
.NET for Xbox 360 and ZuneCustom version of the .NET Compact Framework
XNA Game Studio
XNAFramework
Networking
Graphics
Input
Audio Math
GamerServices
XNAGame Studio
Visual Studio 2008
Platform Windows Xbox 360 Zune
Application Model Content Pipeline
ContentPipeline
DeviceManagement
Game Flow (1)
LoadContentStart
Update
Draw
EndUnloadContent
Game Flow (2)
// This is a texture we can render.Texture2D myTexture;// Set the coordinates to draw the sprite at.Vector2 spritePosition = Vector2.Zero;
protected override void LoadContent(){ // Create a new SpriteBatch,
// which can be used to draw textures.spriteBatch = new SpriteBatch(GraphicsDevice);myTexture = Content.Load<Texture2D>("mytexture");
}
Game Flow (3)
protected override void Draw(GameTime gameTime){
graphics.GraphicsDevice.Clear(Color.CornflowerBlue); // Draw the sprite.
spriteBatch.Begin(SpriteBlendMode.AlphaBlend);
spriteBatch.Draw(myTexture, spritePosition, Color.White);
spriteBatch.End();
base.Draw(gameTime);}
Game Flow (4)
protected override void Update(GameTime gameTime){
// Allows the game to exit if (GamePad.GetState(PlayerIndex.One).Buttons.Back
== ButtonState.Pressed) this.Exit();
// Move the sprite around. spritePosition.X += 1; spritePosition.Y += 1; base.Update(gameTime);}
Texture, Sprite, 2D Graphics
Demo