diff --git a/Source/MonoGame.Extended/BitmapFonts/BitmapFontReader.cs b/Source/MonoGame.Extended/BitmapFonts/BitmapFontReader.cs index 170b0017..5490a31d 100644 --- a/Source/MonoGame.Extended/BitmapFonts/BitmapFontReader.cs +++ b/Source/MonoGame.Extended/BitmapFonts/BitmapFontReader.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; +using MonoGame.Extended.Content; using MonoGame.Extended.TextureAtlases; namespace MonoGame.Extended.BitmapFonts @@ -10,7 +11,7 @@ namespace MonoGame.Extended.BitmapFonts { protected override BitmapFont Read(ContentReader reader, BitmapFont existingInstance) { - var relativeAssetFolder = GetRelativeAssetFolder(reader.AssetName); + var assetDirectory = ContentTypeReaderHelper.GetDirectory(reader.AssetName); var textureAssetCount = reader.ReadInt32(); var assets = new List(); @@ -21,7 +22,7 @@ namespace MonoGame.Extended.BitmapFonts } var textures = assets - .Select(assetName => reader.ContentManager.Load(relativeAssetFolder + assetName)) + .Select(textureName => reader.ContentManager.Load(assetDirectory + textureName)) .ToArray(); var lineHeight = reader.ReadInt32(); @@ -45,15 +46,5 @@ namespace MonoGame.Extended.BitmapFonts return new BitmapFont(regions, lineHeight); } - - private string GetRelativeAssetFolder(string assetPath) - { - var pathNodes = assetPath.Split(new[] {'\\', '/'}); - - if (pathNodes.Length > 1) - return string.Join("/", pathNodes.Take(pathNodes.Length - 1).ToArray()) + "/"; - - return string.Empty; - } } } \ No newline at end of file diff --git a/Source/MonoGame.Extended/Content/ContentTypeReaderHelper.cs b/Source/MonoGame.Extended/Content/ContentTypeReaderHelper.cs new file mode 100644 index 00000000..4a495704 --- /dev/null +++ b/Source/MonoGame.Extended/Content/ContentTypeReaderHelper.cs @@ -0,0 +1,17 @@ +using System.Linq; + +namespace MonoGame.Extended.Content +{ + internal static class ContentTypeReaderHelper + { + public static string GetDirectory(string assetPath) + { + var pathNodes = assetPath.Split('\\', '/'); + + if (pathNodes.Length > 1) + return string.Join("/", pathNodes.Take(pathNodes.Length - 1).ToArray()) + "/"; + + return string.Empty; + } + } +} \ No newline at end of file diff --git a/Source/MonoGame.Extended/Maps/Tiled/TiledMapReader.cs b/Source/MonoGame.Extended/Maps/Tiled/TiledMapReader.cs index 8b3e3933..2a14a338 100644 --- a/Source/MonoGame.Extended/Maps/Tiled/TiledMapReader.cs +++ b/Source/MonoGame.Extended/Maps/Tiled/TiledMapReader.cs @@ -9,6 +9,7 @@ namespace MonoGame.Extended.Maps.Tiled { protected override TiledMap Read(ContentReader reader, TiledMap existingInstance) { + var assetDirectory = ContentTypeReaderHelper.GetDirectory(reader.AssetName); var backgroundColor = reader.ReadColor(); var renderOrder = (TiledRenderOrder) Enum.Parse(typeof (TiledRenderOrder), reader.ReadString(), true); var tiledMap = new TiledMap( @@ -29,8 +30,8 @@ namespace MonoGame.Extended.Maps.Tiled for (var i = 0; i < tilesetCount; i++) { - var assetName = reader.ReadString(); - var texture = reader.ContentManager.Load(assetName); + var textureName = reader.ReadString(); + var texture = reader.ContentManager.Load(assetDirectory + textureName); var tileset = tiledMap.CreateTileset( texture: texture, firstId: reader.ReadInt32(), @@ -52,7 +53,7 @@ namespace MonoGame.Extended.Maps.Tiled return tiledMap; } - private void ReadCustomProperties(ContentReader reader, TiledProperties properties) + private static void ReadCustomProperties(ContentReader reader, TiledProperties properties) { var count = reader.ReadInt32(); @@ -63,8 +64,10 @@ namespace MonoGame.Extended.Maps.Tiled private TiledLayer ReadLayer(ContentReader reader, TiledMap tiledMap) { var layerName = reader.ReadString(); + // ReSharper disable UnusedVariable var visible = reader.ReadBoolean(); var opacity = reader.ReadSingle(); + // ReSharper restore UnusedVariable var layerType = reader.ReadString(); if (layerType == "TileLayer") diff --git a/Source/MonoGame.Extended/MonoGame.Extended.csproj b/Source/MonoGame.Extended/MonoGame.Extended.csproj index ba71d148..3e3c6102 100644 --- a/Source/MonoGame.Extended/MonoGame.Extended.csproj +++ b/Source/MonoGame.Extended/MonoGame.Extended.csproj @@ -40,6 +40,7 @@ + diff --git a/Source/MonoGame.Extended/TextureAtlases/TextureAtlasReader.cs b/Source/MonoGame.Extended/TextureAtlases/TextureAtlasReader.cs index cde98581..a4c50f88 100644 --- a/Source/MonoGame.Extended/TextureAtlases/TextureAtlasReader.cs +++ b/Source/MonoGame.Extended/TextureAtlases/TextureAtlasReader.cs @@ -1,5 +1,6 @@ using Microsoft.Xna.Framework.Content; using Microsoft.Xna.Framework.Graphics; +using MonoGame.Extended.Content; namespace MonoGame.Extended.TextureAtlases { @@ -7,8 +8,9 @@ namespace MonoGame.Extended.TextureAtlases { protected override TextureAtlas Read(ContentReader reader, TextureAtlas existingInstance) { + var assetDirectory = ContentTypeReaderHelper.GetDirectory(reader.AssetName); var assetName = reader.ReadString(); - var texture = reader.ContentManager.Load(assetName); + var texture = reader.ContentManager.Load(assetDirectory + assetName); var atlas = new TextureAtlas(texture); var regionCount = reader.ReadInt32(); diff --git a/Source/Sandbox/CollisionGrid.cs b/Source/Sandbox/CollisionGrid.cs index efe6bd3b..28d2b227 100644 --- a/Source/Sandbox/CollisionGrid.cs +++ b/Source/Sandbox/CollisionGrid.cs @@ -1,7 +1,6 @@ using System; using System.Collections.Generic; using Microsoft.Xna.Framework; -using MonoGame.Extended.Shapes; namespace Sandbox { diff --git a/Source/Sandbox/Content/Hills_1.png b/Source/Sandbox/Content/Backgrounds/Hills_1.png similarity index 100% rename from Source/Sandbox/Content/Hills_1.png rename to Source/Sandbox/Content/Backgrounds/Hills_1.png diff --git a/Source/Sandbox/Content/Hills_2.png b/Source/Sandbox/Content/Backgrounds/Hills_2.png similarity index 100% rename from Source/Sandbox/Content/Hills_2.png rename to Source/Sandbox/Content/Backgrounds/Hills_2.png diff --git a/Source/Sandbox/Content/Hills_3.png b/Source/Sandbox/Content/Backgrounds/Hills_3.png similarity index 100% rename from Source/Sandbox/Content/Hills_3.png rename to Source/Sandbox/Content/Backgrounds/Hills_3.png diff --git a/Source/Sandbox/Content/Hills_4.png b/Source/Sandbox/Content/Backgrounds/Hills_4.png similarity index 100% rename from Source/Sandbox/Content/Hills_4.png rename to Source/Sandbox/Content/Backgrounds/Hills_4.png diff --git a/Source/Sandbox/Content/Hills_Couds.png b/Source/Sandbox/Content/Backgrounds/Hills_Couds.png similarity index 100% rename from Source/Sandbox/Content/Hills_Couds.png rename to Source/Sandbox/Content/Backgrounds/Hills_Couds.png diff --git a/Source/Sandbox/Content/Hills_Sky.png b/Source/Sandbox/Content/Backgrounds/Hills_Sky.png similarity index 100% rename from Source/Sandbox/Content/Hills_Sky.png rename to Source/Sandbox/Content/Backgrounds/Hills_Sky.png diff --git a/Source/Sandbox/Content/hills.png b/Source/Sandbox/Content/Backgrounds/hills.png similarity index 100% rename from Source/Sandbox/Content/hills.png rename to Source/Sandbox/Content/Backgrounds/hills.png diff --git a/Source/Sandbox/Content/Content.mgcb b/Source/Sandbox/Content/Content.mgcb index feb35e0c..8bfd95aa 100644 --- a/Source/Sandbox/Content/Content.mgcb +++ b/Source/Sandbox/Content/Content.mgcb @@ -14,126 +14,6 @@ #---------------------------------- Content ---------------------------------# -#begin hills.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:TextureFormat=Color -/build:hills.png - -#begin desert.tmx -/copy:desert.tmx - -#begin tmw_desert_spacing.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:TextureFormat=Color -/build:tmw_desert_spacing.png - -#begin free-tileset.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:TextureFormat=Color -/build:free-tileset.png - -#begin level01.tmx -/importer:TiledMapImporter -/processor:TiledMapProcessor -/build:level01.tmx - -#begin test-tileset.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:TextureFormat=Color -/build:test-tileset.png - -#begin test-tileset-map1.tmx -/importer:TiledMapImporter -/processor:TiledMapProcessor -/build:test-tileset-map1.tmx - -#begin stump.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:TextureFormat=Color -/build:stump.png - -#begin test-tileset-left-down.tmx -/importer:TiledMapImporter -/processor:TiledMapProcessor -/build:test-tileset-left-down.tmx - -#begin test-tileset-left-up.tmx -/importer:TiledMapImporter -/processor:TiledMapProcessor -/build:test-tileset-left-up.tmx - -#begin test-tileset-right-down.tmx -/importer:TiledMapImporter -/processor:TiledMapProcessor -/build:test-tileset-right-down.tmx - -#begin test-tileset-right-up.tmx -/importer:TiledMapImporter -/processor:TiledMapProcessor -/build:test-tileset-right-up.tmx - -#begin test-tileset-atlas.json -/importer:TexturePackerJsonImporter -/processor:TexturePackerProcessor -/build:test-tileset-atlas.json - -#begin fireball.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:TextureFormat=Color -/build:fireball.png - -#begin zombie-atlas.json -/importer:TexturePackerJsonImporter -/processor:TexturePackerProcessor -/build:zombie-atlas.json - -#begin zombie.png -/importer:TextureImporter -/processor:TextureProcessor -/processorParam:ColorKeyColor=255,0,255,255 -/processorParam:ColorKeyEnabled=True -/processorParam:GenerateMipmaps=False -/processorParam:PremultiplyAlpha=True -/processorParam:ResizeToPowerOfTwo=False -/processorParam:TextureFormat=Color -/build:zombie.png - #begin Fonts/courier-new-32.fnt /importer:BitmapFontImporter /processor:BitmapFontProcessor @@ -147,15 +27,11 @@ /processorParam:GenerateMipmaps=False /processorParam:PremultiplyAlpha=True /processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False /processorParam:TextureFormat=Color /build:Fonts/courier-new-32_0.png -#begin isometric.tmx -/importer:TiledMapImporter -/processor:TiledMapProcessor -/build:isometric.tmx - -#begin isometric_tileset.png +#begin Backgrounds/hills.png /importer:TextureImporter /processor:TextureProcessor /processorParam:ColorKeyColor=255,0,255,255 @@ -163,6 +39,213 @@ /processorParam:GenerateMipmaps=False /processorParam:PremultiplyAlpha=True /processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False /processorParam:TextureFormat=Color -/build:isometric_tileset.png +/build:Backgrounds/hills.png + +#begin Backgrounds/Hills_1.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Backgrounds/Hills_1.png + +#begin Backgrounds/Hills_2.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Backgrounds/Hills_2.png + +#begin Backgrounds/Hills_3.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Backgrounds/Hills_3.png + +#begin Backgrounds/Hills_4.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Backgrounds/Hills_4.png + +#begin Backgrounds/Hills_Couds.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Backgrounds/Hills_Couds.png + +#begin Backgrounds/Hills_Sky.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Backgrounds/Hills_Sky.png + +#begin Tilesets/free-tileset.json +/importer:TexturePackerJsonImporter +/processor:TexturePackerProcessor +/build:Tilesets/free-tileset.json + +#begin Tilesets/free-tileset.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Tilesets/free-tileset.png + +#begin Tilesets/isometric.tmx +/importer:TiledMapImporter +/processor:TiledMapProcessor +/build:Tilesets/isometric.tmx + +#begin Tilesets/isometric_tileset.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Tilesets/isometric_tileset.png + +#begin Tilesets/level01.tmx +/importer:TiledMapImporter +/processor:TiledMapProcessor +/build:Tilesets/level01.tmx + +#begin Tilesets/test-tileset-atlas.json +/importer:TexturePackerJsonImporter +/processor:TexturePackerProcessor +/build:Tilesets/test-tileset-atlas.json + +#begin Tilesets/test-tileset-left-down.tmx +/importer:TiledMapImporter +/processor:TiledMapProcessor +/build:Tilesets/test-tileset-left-down.tmx + +#begin Tilesets/test-tileset-left-up.tmx +/importer:TiledMapImporter +/processor:TiledMapProcessor +/build:Tilesets/test-tileset-left-up.tmx + +#begin Tilesets/test-tileset-map1.tmx +/importer:TiledMapImporter +/processor:TiledMapProcessor +/build:Tilesets/test-tileset-map1.tmx + +#begin Tilesets/test-tileset-right-down.tmx +/importer:TiledMapImporter +/processor:TiledMapProcessor +/build:Tilesets/test-tileset-right-down.tmx + +#begin Tilesets/test-tileset-right-up.tmx +/importer:TiledMapImporter +/processor:TiledMapProcessor +/build:Tilesets/test-tileset-right-up.tmx + +#begin Tilesets/test-tileset.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Tilesets/test-tileset.png + +#begin Sprites/fireball.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Sprites/fireball.png + +#begin Sprites/shadedDark42.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Sprites/shadedDark42.png + +#begin Sprites/stump.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Sprites/stump.png + +#begin Sprites/zombie-atlas.json +/importer:TexturePackerJsonImporter +/processor:TexturePackerProcessor +/build:Sprites/zombie-atlas.json + +#begin Sprites/zombie.png +/importer:TextureImporter +/processor:TextureProcessor +/processorParam:ColorKeyColor=255,0,255,255 +/processorParam:ColorKeyEnabled=True +/processorParam:GenerateMipmaps=False +/processorParam:PremultiplyAlpha=True +/processorParam:ResizeToPowerOfTwo=False +/processorParam:MakeSquare=False +/processorParam:TextureFormat=Color +/build:Sprites/zombie.png diff --git a/Source/Sandbox/Content/fireball.png b/Source/Sandbox/Content/Sprites/fireball.png similarity index 100% rename from Source/Sandbox/Content/fireball.png rename to Source/Sandbox/Content/Sprites/fireball.png diff --git a/Source/Sandbox/Content/shadedDark42.png b/Source/Sandbox/Content/Sprites/shadedDark42.png similarity index 100% rename from Source/Sandbox/Content/shadedDark42.png rename to Source/Sandbox/Content/Sprites/shadedDark42.png diff --git a/Source/Sandbox/Content/stump.png b/Source/Sandbox/Content/Sprites/stump.png similarity index 100% rename from Source/Sandbox/Content/stump.png rename to Source/Sandbox/Content/Sprites/stump.png diff --git a/Source/Sandbox/Content/zombie-atlas.json b/Source/Sandbox/Content/Sprites/zombie-atlas.json similarity index 100% rename from Source/Sandbox/Content/zombie-atlas.json rename to Source/Sandbox/Content/Sprites/zombie-atlas.json diff --git a/Source/Sandbox/Content/zombie.png b/Source/Sandbox/Content/Sprites/zombie.png similarity index 100% rename from Source/Sandbox/Content/zombie.png rename to Source/Sandbox/Content/Sprites/zombie.png diff --git a/Source/Sandbox/Content/free-tileset.json b/Source/Sandbox/Content/Tilesets/free-tileset.json similarity index 100% rename from Source/Sandbox/Content/free-tileset.json rename to Source/Sandbox/Content/Tilesets/free-tileset.json diff --git a/Source/Sandbox/Content/free-tileset.png b/Source/Sandbox/Content/Tilesets/free-tileset.png similarity index 100% rename from Source/Sandbox/Content/free-tileset.png rename to Source/Sandbox/Content/Tilesets/free-tileset.png diff --git a/Source/Sandbox/Content/free-tileset.tps b/Source/Sandbox/Content/Tilesets/free-tileset.tps similarity index 100% rename from Source/Sandbox/Content/free-tileset.tps rename to Source/Sandbox/Content/Tilesets/free-tileset.tps diff --git a/Source/Sandbox/Content/isometric.tmx b/Source/Sandbox/Content/Tilesets/isometric.tmx similarity index 100% rename from Source/Sandbox/Content/isometric.tmx rename to Source/Sandbox/Content/Tilesets/isometric.tmx diff --git a/Source/Sandbox/Content/isometric_tileset.png b/Source/Sandbox/Content/Tilesets/isometric_tileset.png similarity index 100% rename from Source/Sandbox/Content/isometric_tileset.png rename to Source/Sandbox/Content/Tilesets/isometric_tileset.png diff --git a/Source/Sandbox/Content/level01.tmx b/Source/Sandbox/Content/Tilesets/level01.tmx similarity index 99% rename from Source/Sandbox/Content/level01.tmx rename to Source/Sandbox/Content/Tilesets/level01.tmx index 6d48365e..8560ba78 100644 --- a/Source/Sandbox/Content/level01.tmx +++ b/Source/Sandbox/Content/Tilesets/level01.tmx @@ -4,7 +4,7 @@ - + diff --git a/Source/Sandbox/Content/test-tileset-atlas.json b/Source/Sandbox/Content/Tilesets/test-tileset-atlas.json similarity index 100% rename from Source/Sandbox/Content/test-tileset-atlas.json rename to Source/Sandbox/Content/Tilesets/test-tileset-atlas.json diff --git a/Source/Sandbox/Content/test-tileset-left-down.tmx b/Source/Sandbox/Content/Tilesets/test-tileset-left-down.tmx similarity index 100% rename from Source/Sandbox/Content/test-tileset-left-down.tmx rename to Source/Sandbox/Content/Tilesets/test-tileset-left-down.tmx diff --git a/Source/Sandbox/Content/test-tileset-left-up.tmx b/Source/Sandbox/Content/Tilesets/test-tileset-left-up.tmx similarity index 100% rename from Source/Sandbox/Content/test-tileset-left-up.tmx rename to Source/Sandbox/Content/Tilesets/test-tileset-left-up.tmx diff --git a/Source/Sandbox/Content/test-tileset-map1.tmx b/Source/Sandbox/Content/Tilesets/test-tileset-map1.tmx similarity index 100% rename from Source/Sandbox/Content/test-tileset-map1.tmx rename to Source/Sandbox/Content/Tilesets/test-tileset-map1.tmx diff --git a/Source/Sandbox/Content/test-tileset-right-down.tmx b/Source/Sandbox/Content/Tilesets/test-tileset-right-down.tmx similarity index 100% rename from Source/Sandbox/Content/test-tileset-right-down.tmx rename to Source/Sandbox/Content/Tilesets/test-tileset-right-down.tmx diff --git a/Source/Sandbox/Content/test-tileset-right-up.tmx b/Source/Sandbox/Content/Tilesets/test-tileset-right-up.tmx similarity index 100% rename from Source/Sandbox/Content/test-tileset-right-up.tmx rename to Source/Sandbox/Content/Tilesets/test-tileset-right-up.tmx diff --git a/Source/Sandbox/Content/test-tileset.png b/Source/Sandbox/Content/Tilesets/test-tileset.png similarity index 100% rename from Source/Sandbox/Content/test-tileset.png rename to Source/Sandbox/Content/Tilesets/test-tileset.png diff --git a/Source/Sandbox/Content/desert.tmx b/Source/Sandbox/Content/desert.tmx deleted file mode 100644 index e09c83c8..00000000 --- a/Source/Sandbox/Content/desert.tmx +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - eJztmNkKwjAQRaN9cAPrAq5Yq3Xf6v9/nSM2VIbQJjEZR+nDwQZScrwztoORECLySBcIgZ7nc2y4KfyWDLx+Jb9nViNgDEwY+KioAXUgQN4+zpoCMwPmQAtoAx2CLFbA2oDEo9+hwG8DnIDtF/2K8ks086Tw2zH0uyMv7HcRr/6/EvvhnsPrsrxwX7rwU/0ODig/eV3mh3N1ld8eraWPaX6+64s9McesfrqcHfg1MpoifxcVEWjukyw+9AtFPl/I71pER3Of6j4bv7HI54s+MChhqLlPdZ/P3qMmFuo5h5NnTOhjM5tReN2yT51n5/v7J3F0vi46fk+ne7aX0i9l6If7mpufTX3f5wsqv9TAD2fJLT9VrTn7UeZnM5tR+v0LMQOHXwFnxe2/warGFRWf8QDjOLfP - - - diff --git a/Source/Sandbox/Content/tmw_desert_spacing.png b/Source/Sandbox/Content/tmw_desert_spacing.png deleted file mode 100644 index 4e9995c0..00000000 Binary files a/Source/Sandbox/Content/tmw_desert_spacing.png and /dev/null differ diff --git a/Source/Sandbox/Sandbox.csproj b/Source/Sandbox/Sandbox.csproj index 4016cd4c..a0ff0c7a 100644 --- a/Source/Sandbox/Sandbox.csproj +++ b/Source/Sandbox/Sandbox.csproj @@ -53,37 +53,35 @@ - - - - - + + + + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - + + + + + + + diff --git a/Source/Sandbox/SandboxGame.cs b/Source/Sandbox/SandboxGame.cs index 8bdcff14..88801c76 100644 --- a/Source/Sandbox/SandboxGame.cs +++ b/Source/Sandbox/SandboxGame.cs @@ -60,7 +60,7 @@ namespace Sandbox { _spriteBatch = new SpriteBatch(GraphicsDevice); _bitmapFont = Content.Load("Fonts/courier-new-32"); - _tiledMap = Content.Load("level01"); + _tiledMap = Content.Load("Tilesets/level01"); var collisionData = _tiledMap .GetLayer("Tile Layer 1") .Tiles @@ -68,7 +68,7 @@ namespace Sandbox .ToArray(); _collisionGrid = new CollisionGrid(collisionData, _tiledMap.Width, _tiledMap.Height, _tiledMap.TileWidth, _tiledMap.TileHeight); - var fireballTexture = Content.Load("fireball"); + var fireballTexture = Content.Load("Sprites/fireball"); var spriteSheetAtlas = TextureAtlas.Create(fireballTexture, 512, 197); _sprite = new Sprite(spriteSheetAtlas[0]) @@ -78,7 +78,7 @@ namespace Sandbox }; _spriteAnimator = new SpriteAnimator(_sprite, spriteSheetAtlas, 15); - var zombieSheet = Content.Load("zombie-atlas"); + var zombieSheet = Content.Load("Sprites/zombie-atlas"); _zombie = new Zombie(zombieSheet) { Position = new Vector2(300, 500) @@ -124,10 +124,6 @@ namespace Sandbox _zombie.Velocity += new Vector2(0, 600) * deltaSeconds; _zombie.Position += _zombie.Velocity * deltaSeconds; - - - - _zombie.Update(gameTime); _camera.LookAt(_zombie.Position);