diff --git a/Shared/SneakGame.cs b/Shared/SneakGame.cs index 99c5b28..d6b3eb4 100644 --- a/Shared/SneakGame.cs +++ b/Shared/SneakGame.cs @@ -67,13 +67,15 @@ namespace SemiColinGames { font = Content.Load("font"); player = new Player(Content.Load("Ninja_Female")); - world = new World(Content.Load("grassland")); + world = new World(Content.Load("grassland"), Levels.DEMO); grasslandBg1 = Content.Load("grassland_bg1"); grasslandBg2 = Content.Load("grassland_bg2"); } // Called once per game. Unloads all game content. protected override void UnloadContent() { + updateTimer.DumpStats(); + drawTimer.DumpStats(); } // Updates the game world. diff --git a/Shared/World.cs b/Shared/World.cs index d405776..f28d7c5 100644 --- a/Shared/World.cs +++ b/Shared/World.cs @@ -72,24 +72,6 @@ namespace SemiColinGames { get { return tileHeight * TileSize; } } - readonly string worldString = @" - - - - - X - . - X <======> <==X X <=> XX . - XXX . - XXXX . - XXXXX . - X <> <> = <> X X X X <> X X XX X <=X> XXXXXX . - <> [] [] XX XX XXX XX XXXXXXX - <> [] [] [] XXX XXX XXXX XXX <> <> XXXXXXXX - []12345678[]123456[]123456789[]1234567890 123456 123456 12345 1234 12345 1234 123XXXX XXXX1234XXXXX XXXX1234[]123 1234567[]XXXXXXXXX12345678 -====================> <====..========..======..=========..=========> <=============> <==============================================================> <=======..==============..============================== -....................] [............................................] [.............] [..............................................................] [......................................................."; - private static readonly Dictionary charToTerrain = new Dictionary() { { '=', Terrain.Grass }, @@ -102,9 +84,9 @@ namespace SemiColinGames { { 'X', Terrain.Block } }; - public World(Texture2D texture) { + public World(Texture2D texture, string levelSpecification) { var tilesList = new List(); - string[] worldDesc = worldString.Split('\n'); + string[] worldDesc = levelSpecification.Split('\n'); tileWidth = worldDesc.AsQueryable().Max(a => a.Length); tileHeight = worldDesc.Length; Debug.WriteLine("world size: {0}x{1}", tileWidth, tileHeight);