12
Game Development with Microsoft XNA Studio Tran Minh Triet Faculty of Information Technolog University of Science, VNU-HCM

Overview

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Overview

Game Development with Microsoft XNA Studio

Tran Minh TrietFaculty of Information TechnologyUniversity of Science, VNU-HCM

Page 2: Overview

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

Page 3: Overview

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

Page 4: Overview

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

Page 5: Overview

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

Page 6: Overview

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

Page 7: Overview

Game Flow (1)

LoadContentStart

Update

Draw

EndUnloadContent

Page 8: Overview

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");

}

Page 9: Overview

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);}

Page 10: Overview

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);}

Page 11: Overview

Texture, Sprite, 2D Graphics

Page 12: Overview

Demo