Time for action – building the LevelManager class
Right-click on the Gemstone Hunter Content project and add a new folder called
Maps
.Add the
MAP001.MAP
andMAP002.MAP
sample maps from0669_08_GRAPHICPACK
to theMaps
folder.Click on each
.MAP
file in Solution Explorer and, in the Properties window, set the Build Action to None and the Copy to Output Directory property to Copy if newer.Add a new class file called
LevelManager.cs
to the Gemstone Hunter project.Add the following
using
directives to the LevelManager class:using Microsoft.Xna.Framework.Storage; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Tile_Engine;
Modify the declaration of the LevelManager class to make it
public
andstatic
:public static class LevelManager
Add declarations to the LevelManager class:
#region Declarations private static ContentManager Content; private static Player player; private static int currentLevel; private static Vector2 respawnLocation...