This document provides an overview and introduction to XNA game development. It discusses the XNA framework and content pipeline for loading textures, audio, and other game assets. It also explains the typical lifecycle methods like Initialize, LoadContent, UnloadContent, Update, and Draw that are used in the main Game1 class. References are provided for books, tutorials, and the author's own game projects and publications related to XNA.
4. References of this Course
• Books
– All of previous slide
• Web sites
– Many of them!
• http://www.riemers.net/
• http://rbwhitaker.wikidot.com/xna-tutorials (very good one)
5. Take a Look on XNA and My Other Courses
@ http://www.slideshare.net/ZGTRZGTR
and @ http://mohammadshaker.com/
Available courses to the date of this slide:
6. Explore My
Authoring tool for Cut the Rope!
A Full implementation of a clone of Cut the Rope for Research Purposes
19. XNA Game Studio 4.0
• Powerful platform
– Managed code platform, no unsafe code
– XNA Game Studio 4.0 is C# exclusive
– Performance
– Productivity
• The XNA Framework
– Game Loop
– Graphics
– Audio and Media
• MicBluetooth
• Music
• Photos and Video
– Input
• TouchJoystick
– Sensors
• Silverlight
• Accelorometer
– Target Platforms
• Windows Phone Xbox PC
• Faaaaaaaaaaast Developement
31. New XNA Project!
• Game1()
– Class “Game1” constructor
Initialize
LoadContent
UnloadContent
Update
Draw
Game1
32. New XNA Project!
• Initialize()
– Allows the game to perform any initialization it needs to before starting to run.
– This is where it can query for any required services and load any non-graphic related content.
Calling base.Initialize will enumerate through any component and initialize them as well.
Initialize
LoadContent
UnloadContent
Update
Draw
Game1
33. New XNA Project!
• LoadContent()
– LoadContent will be called once per game and is the place to load all of your content.
Initialize
LoadContent
UnloadContent
Update
Draw
Game1
34. New XNA Project!
• UnloadContent()
– UnloadContent will be called once per game and is the place to unload all content.
Initialize
LoadContent
UnloadContent
Update
Draw
Game1
35. New XNA Project!
• Update(GameTime gameTime)*
– Allows the game to run logic such as updating the world, checking for collisions, gathering
input, and playing audio.
• Draw(GameTime gameTime)*
• This is called when the game should draw itself.
* “gameTime” Provides a snapshot of timing values.
Initialize
LoadContent
UnloadContent
Update
Draw
Game1
47. Update() vs. Draw()
• Update and Draw are called at different rates depending on whether
IsFixedTimeStep is true or false.
– If IsFixedTimeStep is false, Update and Draw will be called in a continuous loop.
– If IsFixedTimeStep is true, Update will be called at the interval specified in TargetElapsedTime,
while Draw will only be called if an Update is not due.
– If Draw is not called, IsRunningSlowly will be set to true.
Find out more @ http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.game.update.aspx