Time for action – the TileMap class – part 1
- In the Tile Engine project, rename the
Class1.cs
file that was generated by the Game Library project template toTileMap.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. - Double-click on the new
TileMap.cs
file to open it in the Visual Studio editor. - 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;
- 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.