O'Reilly logo

XNA 4.0 Game Development by Example Beginner's Guide by Kurt Jaegers

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - the TileMap class - part 1

  1. In the Tile Engine project, rename the Class1.cs file that was generated by the Game Library project template to TileMap.cs. Visual Studio will ask you if you wish to rename all references to the class as well. Go ahead and click on Yes. We have not referenced our new class anywhere, so no other code is actually updated.
  2. Double-click on the new TileMap.cs file to open it in the Visual Studio editor.
  3. Add the following using directives to the top of the class file:
    using Microsoft.Xna.Framework.Storage;
    using System.IO;
    using System.Xml.Serialization;
    using System.Runtime.Serialization.Formatters.Binary;
    
  4. Modify the declaration of the TileMap class to make the class public and static:
     public static class ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required