diff --git a/DangerousD/Content/Content.mgcb b/DangerousD/Content/Content.mgcb index 37d9842..9924833 100644 --- a/DangerousD/Content/Content.mgcb +++ b/DangerousD/Content/Content.mgcb @@ -21,18 +21,6 @@ /processorParam:TextureFormat=Compressed /build:ButtonFont.spritefont -#begin checkboxs_off-on.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:checkboxs_off-on.png - #begin checkboxs_off.png /importer:TextureImporter /processor:TextureProcessor @@ -45,6 +33,18 @@ /processorParam:TextureFormat=Color /build:checkboxs_off.png +#begin checkboxs_off-on.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:checkboxs_off-on.png + #begin checkboxs_on.png /importer:TextureImporter /processor:TextureProcessor @@ -87,6 +87,18 @@ /processorParam:Quality=Best /build:DoomTestSong.mp3 +#begin doors.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:doors.png + #begin Font_12.spritefont /importer:FontDescriptionImporter /processor:FontDescriptionProcessor @@ -235,18 +247,6 @@ /processorParam:TextureFormat=Color /build:textboxbackground1-1.png -#begin textboxbackground2-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:textboxbackground2-1.png - #begin textboxbackground2,5-1.png /importer:TextureImporter /processor:TextureProcessor @@ -259,6 +259,18 @@ /processorParam:TextureFormat=Color /build:textboxbackground2,5-1.png +#begin textboxbackground2-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:textboxbackground2-1.png + #begin textboxbackground6-1.png /importer:TextureImporter /processor:TextureProcessor diff --git a/DangerousD/Content/Door.tsx b/DangerousD/Content/Door.tsx new file mode 100644 index 0000000..a250dd5 --- /dev/null +++ b/DangerousD/Content/Door.tsx @@ -0,0 +1,4 @@ + + + + diff --git a/DangerousD/Content/doors.png b/DangerousD/Content/doors.png new file mode 100644 index 0000000..60742ae Binary files /dev/null and b/DangerousD/Content/doors.png differ diff --git a/DangerousD/Content/lvl.tmx b/DangerousD/Content/lvl.tmx index 0f91aa8..b26fa01 100644 --- a/DangerousD/Content/lvl.tmx +++ b/DangerousD/Content/lvl.tmx @@ -1,7 +1,8 @@ - + - + + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -311,137 +312,7 @@ - - - -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,149,152,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,150,153,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,151,154,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0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, -0,0,0,0,0,0,0,0,0,0,149,152,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,150,153,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,151,154,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,149,152,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,150,153,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,151,154,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - - - - + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -466,7 +337,7 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, +0,0,0,0,0,0,0,147,199,199,148,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, @@ -517,7 +388,7 @@ - + 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29, @@ -559,15 +430,15 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144, 157,157,157,178,179,157,157,157,157,157,157,157,157,157,157,157, -157,157,157,191,192,157,157,252,253,157,157,157,157,157,157,258, -157,157,157,157,157,157,157,265,266,157,157,157,696,697,157,271, -204,204,204,204,204,204,204,278,279,204,204,204,709,710,204,284, +157,157,157,191,192,157,157,149,152,157,157,157,157,157,157,258, +157,157,157,157,157,157,157,150,153,157,157,157,696,697,157,271, +204,204,204,204,204,204,204,151,154,204,204,204,709,710,204,284, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144, 157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157, -157,157,157,157,157,157,258,157,157,157,252,253,157,157,157,157, -157,157,157,157,157,157,271,157,157,157,265,266,157,696,697,157, -157,157,272,204,204,204,284,204,204,204,278,279,204,709,710,204, +157,157,157,157,157,157,258,157,157,157,149,152,157,157,157,157, +157,157,157,157,157,157,271,157,157,157,150,153,157,696,697,157, +157,157,272,204,204,204,284,204,204,204,151,154,204,709,710,204, 157,157,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 157,157,144,144,144,144,144,144,144,144,144,144,144,144,144,144, 157,157,157,157,157,157,157,157,157,157,157,167,157,157,209,210, @@ -589,25 +460,25 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144, 211,212,157,157,157,157,157,157,157,157,157,157,157,157,157,157, -224,225,157,157,252,253,157,248,249,157,157,258,157,157,157,157 +224,225,157,157,149,152,157,248,249,157,157,258,157,157,157,157 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, -144,144,144,144,144,144,144,144,621,622,144,144,144,0,0,0, -157,157,157,157,157,157,157,157,634,635,157,157,157,0,0,0, -157,248,249,157,157,157,272,157,647,648,157,272,157,0,0,0, +144,144,144,144,144,144,144,144,79,80,144,144,144,0,0,0, +157,157,157,157,157,157,157,157,92,93,157,157,157,0,0,0, +157,248,249,157,157,157,272,157,105,106,157,272,157,0,0,0, 157,250,251,157,157,157,145,147,199,200,148,145,157,0,0,0, 204,239,240,204,204,204,204,160,199,200,161,204,204,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 144,144,144,144,144,144,144,144,144,144,144,144,144,0,0,0, 178,179,157,157,157,157,157,243,157,157,157,157,157,0,0,0, -191,192,157,157,157,157,157,256,257,157,252,253,157,0,0,0, -157,157,157,157,157,157,157,269,270,157,265,266,157,0,0,0, -204,204,204,204,204,204,204,282,283,204,278,279,204,0,0,0, +191,192,157,157,157,157,157,256,257,157,149,152,157,0,0,0, +157,157,157,157,157,157,157,269,270,157,150,153,157,0,0,0, +204,204,204,204,204,204,204,282,283,204,151,154,204,0,0,0, 0,0,0,147,199,148,0,0,0,0,0,0,0,0,0,0, 144,144,144,147,199,148,144,144,144,144,144,144,144,0,0,0, 157,157,157,147,199,148,157,243,157,157,157,157,157,0,0,0, -254,255,157,147,199,148,157,256,257,157,252,253,157,0,0,0 +254,255,157,147,199,148,157,256,257,157,149,152,157,0,0,0 29,29,29,29,29,29,29,29,29,29,29,29,29,29,29,29, @@ -633,9 +504,9 @@ 29,29,29,29,0,0,0,0,0,0,0,0,157,157,260,157, 29,29,29,29,0,0,144,144,144,144,144,144,157,157,260,157, 29,29,29,29,0,0,157,167,157,157,157,157,157,157,260,157, -29,29,29,29,0,0,157,180,157,252,253,157,157,157,260,157, -29,29,29,29,0,0,157,193,157,265,266,157,157,157,260,157, -6,29,29,29,0,0,204,204,204,278,279,204,272,157,260,157, +29,29,29,29,0,0,157,180,157,149,152,157,157,157,260,157, +29,29,29,29,0,0,157,193,157,150,153,157,157,157,260,157, +6,29,29,29,0,0,204,204,204,151,154,204,272,157,260,157, 29,29,29,29,0,0,0,0,0,0,0,0,0,157,260,157, 29,29,29,29,0,0,144,144,144,144,144,144,144,157,260,157, 29,29,29,29,0,0,157,157,157,157,157,157,157,219,220,221, @@ -657,15 +528,15 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144, 157,157,157,157,157,157,157,157,243,157,157,209,210,211,212,157, -157,252,253,157,157,258,157,157,256,257,157,222,223,224,225,157, -218,265,266,157,157,271,157,157,269,270,157,235,236,237,238,157, -231,278,279,204,204,284,204,204,282,283,204,204,204,204,204,204, +157,149,152,157,157,258,157,157,256,257,157,222,223,224,225,157, +218,150,153,157,157,271,157,157,269,270,157,235,236,237,238,157, +231,151,154,204,204,284,204,204,282,283,204,204,204,204,204,204, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -237,238,157,157,265,266,157,250,251,157,157,271,157,157,157,157, -204,204,204,204,278,279,204,239,240,204,204,284,204,204,204,204, +237,238,157,157,150,153,157,250,251,157,157,271,157,157,157,157, +204,204,204,204,151,154,204,239,240,204,204,284,204,204,204,204, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144, 157,157,157,157,157,157,157,157,157,243,157,157,209,210,211,212, @@ -682,26 +553,26 @@ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -267,268,157,147,199,148,157,269,270,157,265,266,218,0,0,0, -280,281,204,160,200,161,204,282,283,204,278,279,231,0,0,0, +267,268,157,147,199,148,157,269,270,157,150,153,218,0,0,0, +280,281,204,160,200,161,204,282,283,204,151,154,231,0,0,0, 0,0,0,147,199,148,0,0,0,0,0,0,0,0,0,0, 144,144,144,147,199,148,144,144,144,144,144,144,144,0,0,0, 157,157,157,147,199,148,157,157,157,157,157,157,157,0,0,0, -157,157,157,147,199,148,157,157,157,157,252,253,157,0,0,0, -157,157,157,147,199,148,157,217,157,157,265,266,157,0,0,0, -204,204,204,160,200,161,204,230,204,204,278,279,204,0,0,0, +157,157,157,147,199,148,157,157,157,157,149,152,157,0,0,0, +157,157,157,147,199,148,157,217,157,157,150,153,157,0,0,0, +204,204,204,160,200,161,204,230,204,204,151,154,204,0,0,0, 0,0,0,147,199,148,0,0,0,0,0,0,0,0,0,0, 144,144,144,147,199,148,144,144,144,144,144,144,144,0,0,0, 157,157,159,160,200,161,162,157,157,157,157,157,157,0,0,0, -157,171,172,173,199,174,175,176,157,157,252,253,157,0,0,0, -183,184,185,186,199,187,188,189,190,157,265,266,157,0,0,0, -196,197,198,199,199,200,201,202,203,204,278,279,204,0,0,0, +157,171,172,173,199,174,175,176,157,157,149,152,157,0,0,0, +183,184,185,186,199,187,188,189,190,157,150,153,157,0,0,0, +196,197,198,199,199,200,201,202,203,204,151,154,204,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 - + @@ -756,4 +627,16 @@ + + + + + + + + + + + + diff --git a/DangerousD/GameCore/GameObjects/Entities/Door.cs b/DangerousD/GameCore/GameObjects/Entities/Door.cs index bd823d5..cacaf22 100644 --- a/DangerousD/GameCore/GameObjects/Entities/Door.cs +++ b/DangerousD/GameCore/GameObjects/Entities/Door.cs @@ -6,21 +6,34 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Microsoft.Xna.Framework.Graphics; namespace DangerousD.GameCore.GameObjects.Entities { public class Door : Entity { - public Door(Vector2 position) : base(position) + private Rectangle _sourceRectangle; + + public Door(Vector2 position, Vector2 size, Rectangle sourceRectangle) : base(position) { + _sourceRectangle = sourceRectangle; + Width = (int)size.X; + Height = (int)size.Y; } - protected override GraphicsComponent GraphicsComponent { get; } = new(new List { "SilasBallMove" }, "SilasBallMove"); + protected override GraphicsComponent GraphicsComponent { get; } = new("doors"); + public override void Update(GameTime gameTime) { base.Update(gameTime); } + + public override void Draw(SpriteBatch spriteBatch) + { + GraphicsComponent.DrawAnimation(Rectangle, spriteBatch, _sourceRectangle); + //spriteBatch.Draw(debugTexture, new Rectangle(Rectangle.X - GraphicsComponent.CameraPosition.X, Rectangle.Y - GraphicsComponent.CameraPosition.Y, Rectangle.Width, Rectangle.Height), Color.White); + } public override void OnCollision(GameObject gameObject) { base.OnCollision(gameObject); diff --git a/DangerousD/GameCore/GameObjects/Entities/Items/Coin.cs b/DangerousD/GameCore/GameObjects/Entities/Items/Coin.cs new file mode 100644 index 0000000..a42900e --- /dev/null +++ b/DangerousD/GameCore/GameObjects/Entities/Items/Coin.cs @@ -0,0 +1,13 @@ +using DangerousD.GameCore.Graphics; +using Microsoft.Xna.Framework; + +namespace DangerousD.GameCore.GameObjects.Entities.Items; + +public class Coin : Entity +{ + public Coin(Vector2 position) : base(position) + { + } + + protected override GraphicsComponent GraphicsComponent { get; } +} \ No newline at end of file diff --git a/DangerousD/GameCore/GameObjects/Entities/Items/Diamond.cs b/DangerousD/GameCore/GameObjects/Entities/Items/Diamond.cs new file mode 100644 index 0000000..7f81c6b --- /dev/null +++ b/DangerousD/GameCore/GameObjects/Entities/Items/Diamond.cs @@ -0,0 +1,13 @@ +using DangerousD.GameCore.Graphics; +using Microsoft.Xna.Framework; + +namespace DangerousD.GameCore.GameObjects.Entities.Items; + +public class Diamond : Entity +{ + public Diamond(Vector2 position) : base(position) + { + } + + protected override GraphicsComponent GraphicsComponent { get; } +} \ No newline at end of file diff --git a/DangerousD/GameCore/Managers/MapManager.cs b/DangerousD/GameCore/Managers/MapManager.cs index 6ab49b0..d45d53d 100644 --- a/DangerousD/GameCore/Managers/MapManager.cs +++ b/DangerousD/GameCore/Managers/MapManager.cs @@ -9,15 +9,18 @@ using Microsoft.Xna.Framework.Graphics; using System.Xml.Serialization; using DangerousD.GameCore.GameObjects; using System.Globalization; +using System.IO; +using DangerousD.GameCore.GameObjects.Entities; using DangerousD.GameCore.GameObjects.LivingEntities; namespace DangerousD.GameCore.Managers { public class MapManager { - private int _columns; + private int _scale; - + private int _columns; + public MapManager(int scale) { _scale = scale; @@ -78,6 +81,7 @@ namespace DangerousD.GameCore.Managers private void LoadTilesData() { + XmlDocument xml = new(); xml.Load($"../../../Content/map.tsx"); XmlNode root = xml.DocumentElement; @@ -102,6 +106,11 @@ namespace DangerousD.GameCore.Managers { inst = (Entity)Activator.CreateInstance(type, pos, false); } + else if (type.Equals(typeof(Door))) + { + int gid = entity.Attributes["type"] is not null ? int.Parse(entity.Attributes["type"].Value) : 0; + inst = (Entity)Activator.CreateInstance(type, pos, new Vector2(32, 48), new Rectangle(0, 0, 32, 48)); + } else { inst = (Entity)Activator.CreateInstance(type, pos);