Saturday, March 10, 2012

Tim Thomas on XNA

One of the talks I attended yesterday was "Building Games with .NET and XNA Game Studio" by Headspring's Tim Thomas. XNA is a game development framework released by Microsoft in 2006 which is built on components of DirectX. It runs on Windows, XBox, and Windows Phone 7. There is a distinction between the client profile and the full version of ASP.NET in that the later will NOT run on XBOX or Windows Phones. Some features of the full ASP.NET such as datasets must be left out of the games made with XNA. In making a game, one creates a Windows Application and then incoporates XNA. Tim recommended pulling anything that needs to be tested out into a seperate project independent of the XNA code which is painful to test itself. Game design is very much of manual testing.

The XNA framework will give you a Game class. You will make a game by making a class that inherits from Game (which inherits from IDisposable). The majority of the work to be done involves overriding the methods of Game with your own methods. As mentioned, do pull what you can out to another project in the name of testing. Don't try to test around your Game child itself.

  • The Update method manages calculations and is processed by the CPU.
  • The Draw method's trappings are processed by the GPU. This is a good place to get away from that Color.CornflowerBlue default background color. Tim said he does this before he even checks code into a respository.

    protected override void Draw(GameTime gameTime)

    {

       Color backgroundColor;

       backgroundColor = new Color(255,255,0);

       GraphicsDevice.Clear(backgroundColor);

       base.Draw(gameTime);

    }

p> 
 

Addendum 5/17/2018: Microsoft DirectX is a collection of interfaces/APIs related to multimedia and game programming.

 
 

Addendum 10/7/2018: The X of XBox stands for DirectX. The X is DirectX is a standin for one of several APIs that could be used by DirectX. They are Direct3D, DirectDraw, DirectMusic, DirectPlay, and DirectSound. Do you see how they all start with Direct and then have something else on the end? Get it?

No comments:

Post a Comment