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 TileMap ...

Get XNA 4.0 Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.