Game Programming Class2
free game fonts XNA Redistributable Font Pack
note this font pack is now included in XNA 4
All of the examples for this class and the basic game library we wil be building is in our SVN repo this week we'll practice checking out a folder from the repo.
SNV checkout demo.
In the coming weeks we'll learn how to commit to the SNV. Until then all you need to know is how to checkout.
The XNA Game class has two private properties
- GraphicsDeviceManager graphics;
- ContentManager content;
//the game constuctor can be used to set some graphics settings. graphics.PreferredBackBufferHeight = 768; graphics.PreferredBackBufferWidth = 1024; //graphics.PreferredBackBufferHeight = 1080; //graphics.PreferredBackBufferWidth = 1920; //graphics.IsFullScreen = true;
- Declare SpriteBatch spriteBatch;
- Update(GameTime gameTime)
FrameRate and GameTime
Time and Timespan
Example of update using GameTime to calculate elapsed time
Understanding GameTime We'll revisit game time when we talk about performance profiling.
- Draw(GameTime gameTime)
Console And Trace
We will build a console class later and debug in game.
Texture2D and SpriteBatches
About textures and Batching
- Options SpriteBlendMode
- Additive Enable additive blending. http://blogs.msdn.com/etayrien/archive/2006/12/19/alpha-blending-part-3.aspx
- AlphaBlend Enable alpha blending. http://blogs.msdn.com/etayrien/archive/2006/12/19/alpha-blending-part-2.aspx
- None No blending specified.
- XNA Picture With Update
- Update your picture to include some movement with the update method. Use the keyboard or mouse to interact with something on the screen
- Read Chapter 2 in XNA 3.0
- Read Chapter 4 in XNA 3.0 (yes we skipped 3 we'll come back)