diff --git a/DangerousD/Content/Content.mgcb b/DangerousD/Content/Content.mgcb index b32dbb2..b5e65dd 100644 --- a/DangerousD/Content/Content.mgcb +++ b/DangerousD/Content/Content.mgcb @@ -13,18 +13,6 @@ #---------------------------------- Content ---------------------------------# -#begin ../../../animation1.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:../../../animation1.png;animation1.png - #begin File.spritefont /importer:FontDescriptionImporter /processor:FontDescriptionProcessor @@ -46,6 +34,18 @@ /processorParam:TextureFormat=Compressed /build:Font2.spritefont +#begin MonstersAnimations.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:MonstersAnimations.png + #begin PC_Computer_Dangerous_Dave_In_The_Haunted_Mansion_Death_Sequences.png /importer:TextureImporter /processor:TextureProcessor diff --git a/DangerousD/Content/MonstersAnimations.png b/DangerousD/Content/MonstersAnimations.png new file mode 100644 index 0000000..97e3e11 Binary files /dev/null and b/DangerousD/Content/MonstersAnimations.png differ diff --git a/DangerousD/Content/animation1.png b/DangerousD/Content/animation1.png deleted file mode 100644 index 01d185c..0000000 Binary files a/DangerousD/Content/animation1.png and /dev/null differ diff --git a/DangerousD/Content/animations/FrankMoveLeft b/DangerousD/Content/animations/FrankMoveLeft new file mode 100644 index 0000000..c1b8078 --- /dev/null +++ b/DangerousD/Content/animations/FrankMoveLeft @@ -0,0 +1 @@ +{"id":"FrankMoveLeft","textureName":"MonstersAnimations","startSpriteRectangle":{"X":1,"Y":413,"Width":56,"Height":80},"frameSecond":[{"Item1":0,"Item2":18}],"textureFrameInterval":1,"framesCount":4,"isCycle":true} diff --git a/DangerousD/Content/animations/FrankMoveRight b/DangerousD/Content/animations/FrankMoveRight new file mode 100644 index 0000000..b6fed48 --- /dev/null +++ b/DangerousD/Content/animations/FrankMoveRight @@ -0,0 +1 @@ +{"id":"FrankMoveRight","textureName":"MonstersAnimations","startSpriteRectangle":{"X":1,"Y":332,"Width":56,"Height":80},"frameSecond":[{"Item1":0,"Item2":18}],"textureFrameInterval":1,"framesCount":4,"isCycle":true} diff --git a/DangerousD/Content/animations/ZombieLeftAttack b/DangerousD/Content/animations/ZombieLeftAttack index a5eae6c..63d7675 100644 --- a/DangerousD/Content/animations/ZombieLeftAttack +++ b/DangerousD/Content/animations/ZombieLeftAttack @@ -1 +1 @@ -{"id":"ZombieLeftAttack","textureName":"animation1","startSpriteRectangle":{"X":126,"Y":50,"Width":50,"Height":40},"frameSecond":[{"Item1":0,"Item2":25}],"textureFrameInterval":1,"framesCount":3,"isCycle":false,"offset":"16, 0"} +{"id":"ZombieLeftAttack","textureName":"MonstersAnimations","startSpriteRectangle":{"X":126,"Y":50,"Width":50,"Height":40},"frameSecond":[{"Item1":0,"Item2":25}],"textureFrameInterval":1,"framesCount":3,"isCycle":false,"offset":"16, 0"} diff --git a/DangerousD/Content/animations/ZombieMoveLeft b/DangerousD/Content/animations/ZombieMoveLeft index 2f41b50..607e14e 100644 --- a/DangerousD/Content/animations/ZombieMoveLeft +++ b/DangerousD/Content/animations/ZombieMoveLeft @@ -1 +1 @@ -{"id":"ZombieMoveLeft","textureName":"animation1","startSpriteRectangle":{"X":1,"Y":50,"Width":24,"Height":40},"frameSecond":[{"Item1":0,"Item2":12}],"textureFrameInterval":1,"framesCount":4,"isCycle":true} +{"id":"ZombieMoveLeft","textureName":"MonstersAnimations","startSpriteRectangle":{"X":1,"Y":50,"Width":24,"Height":40},"frameSecond":[{"Item1":0,"Item2":12}],"textureFrameInterval":1,"framesCount":4,"isCycle":true} diff --git a/DangerousD/Content/animations/ZombieMoveRight b/DangerousD/Content/animations/ZombieMoveRight index c59cd6f..7adccea 100644 --- a/DangerousD/Content/animations/ZombieMoveRight +++ b/DangerousD/Content/animations/ZombieMoveRight @@ -1 +1 @@ -{"id":"ZombieMoveRight","textureName":"animation1","startSpriteRectangle":{"X":1,"Y":9,"Width":24,"Height":40},"frameSecond":[{"Item1":0,"Item2":12}],"textureFrameInterval":1,"framesCount":4,"isCycle":true} +{"id":"ZombieMoveRight","textureName":"MonstersAnimations","startSpriteRectangle":{"X":1,"Y":9,"Width":24,"Height":40},"frameSecond":[{"Item1":0,"Item2":12}],"textureFrameInterval":1,"framesCount":4,"isCycle":true} diff --git a/DangerousD/Content/animations/ZombieRightAttack b/DangerousD/Content/animations/ZombieRightAttack index d2e6456..2a48da2 100644 --- a/DangerousD/Content/animations/ZombieRightAttack +++ b/DangerousD/Content/animations/ZombieRightAttack @@ -1 +1 @@ -{"id":"ZombieRightAttack","textureName":"animation1","startSpriteRectangle":{"X":126,"Y":9,"Width":50,"Height":40},"frameSecond":[{"Item1":0,"Item2":25}],"textureFrameInterval":1,"framesCount":3,"isCycle":false,"offset":"16, 0"} +{"id":"ZombieRightAttack","textureName":"MonstersAnimations","startSpriteRectangle":{"X":126,"Y":9,"Width":50,"Height":40},"frameSecond":[{"Item1":0,"Item2":25}],"textureFrameInterval":1,"framesCount":3,"isCycle":false,"offset":"16, 0"} diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/CoreEnemy.cs b/DangerousD/GameCore/GameObjects/LivingEntities/CoreEnemy.cs index c5b7230..d4f160c 100644 --- a/DangerousD/GameCore/GameObjects/LivingEntities/CoreEnemy.cs +++ b/DangerousD/GameCore/GameObjects/LivingEntities/CoreEnemy.cs @@ -29,12 +29,15 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities Death(); isAlive = false; } + + Move(gameTime, AppManager.Instance.GameManager.Player); + base.Update(gameTime); } public abstract void Death(); public abstract void Attack(); - public abstract void Move(GameTime gameTime); + public abstract void Move(GameTime gameTime, Player player); } } diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/FlameSkull.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/FlameSkull.cs new file mode 100644 index 0000000..7bc1ef8 --- /dev/null +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/FlameSkull.cs @@ -0,0 +1,37 @@ +using DangerousD.GameCore.Graphics; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters +{ + public class FlameSkull : CoreEnemy + { + public FlameSkull(Vector2 position) : base(position) + { + + } + + protected override GraphicsComponent GraphicsComponent { get; } = new(new List { "FlameSkullMoveLeft", "FlameSkullMoveRight" }, "FlameSkullMoveRight"); + + public override void Attack(Player player) + { + + } + + public override void Death() + { + + } + + public override void Move(GameTime gameTime, Player player) + { + + } + } +} diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Frank.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Frank.cs new file mode 100644 index 0000000..9c0ad65 --- /dev/null +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Frank.cs @@ -0,0 +1,70 @@ +using DangerousD.GameCore.Graphics; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters +{ + internal class Frank : CoreEnemy + { + private bool isGoRight = false; + public Frank(Vector2 position) : base(position) + { + Width = 112; + Height = 160; + GraphicsComponent.StartAnimation("FrankMoveLeft"); + monster_speed = 1; + name = "Фрэнк"; + } + protected override GraphicsComponent GraphicsComponent { get; } = new(new List { "FrankMoveRight", "FrankMoveLeft" }, "FrankMoveRight"); + + public override void Attack(Player player) + { + + } + + public override void Death() + { + + } + + public override void Move(GameTime gameTime, Player player) + { + /* if (player.Pos.X - _pos.X <= 20 || player.Pos.X - _pos.X <= -20) + { + player.Death(name); + } */ + + if (isGoRight) + { + if (GraphicsComponent.GetCurrentAnimation != "FrankMoveRight") + { + GraphicsComponent.StartAnimation("FrankMoveRight"); + velocity = new Vector2(monster_speed, 0); + } + } + else if (!isGoRight) + { + if (GraphicsComponent.GetCurrentAnimation != "FrankMoveLeft") + { + GraphicsComponent.StartAnimation("FrankMoveLeft"); + velocity = new Vector2(-monster_speed, 0); + } + } + + if (_pos.X <= 1) + { + isGoRight = true; + } + else if (_pos.X >= 500) + { + isGoRight = false; + } + } + } +} diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Ghost.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Ghost.cs new file mode 100644 index 0000000..f0440de --- /dev/null +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Ghost.cs @@ -0,0 +1,36 @@ +using DangerousD.GameCore.Graphics; +using Microsoft.Xna.Framework; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters +{ + public class Ghost : CoreEnemy + { + public Ghost(Vector2 position) : base(position) + { + + } + + protected override GraphicsComponent GraphicsComponent { get; } = new(new List { "GhostMoveRight", "GhostMoveLeft", "GhostSpawn", "GhostAttack" }, ""); + + + public override void Attack(Player player) + { + + } + + public override void Death() + { + + } + + public override void Move(GameTime gameTime, Player player) + { + + } + } +} diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Hunchman.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Hunchman.cs new file mode 100644 index 0000000..1690ba3 --- /dev/null +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Hunchman.cs @@ -0,0 +1,36 @@ +using DangerousD.GameCore.Graphics; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters +{ + public class Hunchman : CoreEnemy + { + public Hunchman(Vector2 position) : base(position) + { + } + + protected override GraphicsComponent GraphicsComponent { get; } = new(new List { "HunchmanMoveLeft", "HunchmanMoveRight", "HunchmanAttackLeft", "HunchmanAttackRight" }, "HunchmanMoveRight"); + + public override void Attack(Player player) + { + + } + + public override void Death() + { + + } + + public override void Move(GameTime gameTime, Player player) + { + + } + } +} diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/SilasHands.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/SilasHands.cs new file mode 100644 index 0000000..6c13e1b --- /dev/null +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/SilasHands.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters +{ + internal class SilasHands + { + } +} diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/SilasMaster.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/SilasMaster.cs new file mode 100644 index 0000000..4a5d727 --- /dev/null +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/SilasMaster.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters +{ + public class SilasMaster + { + } +} diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Slime.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Slime.cs new file mode 100644 index 0000000..d0e3003 --- /dev/null +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Slime.cs @@ -0,0 +1,38 @@ +using DangerousD.GameCore.Graphics; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters +{ + public class Slime : CoreEnemy + { + public Slime(Vector2 position) : base(position) + { + } + + protected override GraphicsComponent GraphicsComponent { get; } = new(new List { "SlimeMoveLeftTop", "SlimeMoveLeftBottom", "SlimeMoveRightTop", + "SlimeMoveRightBottom", "SlimeReadyJumpRightBottom", "SlimeReadyJumpRightTop", "SlimeReadyJumpLeftBottom", "SlimeReadyJumpLeftTop", "SlimeJumpRightBottom", + "SlimeJumpRightTop", "SlimeJumpLeftBottom", "SlimeJumpLeftTop" }, ""); + + public override void Attack(Player player) + { + + } + + public override void Death() + { + + } + + public override void Move(GameTime gameTime, Player player) + { + + } + } +} diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Spider.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Spider.cs new file mode 100644 index 0000000..0dfcef4 --- /dev/null +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Spider.cs @@ -0,0 +1,36 @@ +using DangerousD.GameCore.Graphics; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters +{ + public class Spider : CoreEnemy + { + public Spider(Vector2 position) : base(position) + { + } + + protected override GraphicsComponent GraphicsComponent { get; } = new(new List { "SpiderMoveRight", "SpiderMoveLeft", "SpiderDown", "SpiderUp" }, ""); + + public override void Attack(Player player) + { + + } + + public override void Death() + { + + } + + public override void Move(GameTime gameTime, Player player) + { + + } + } +} diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Werewolf.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Werewolf.cs new file mode 100644 index 0000000..dc4df47 --- /dev/null +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Werewolf.cs @@ -0,0 +1,36 @@ +using DangerousD.GameCore.Graphics; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters +{ + public class Werewolf : CoreEnemy + { + public Werewolf(Vector2 position) : base(position) + { + } + + protected override GraphicsComponent GraphicsComponent { get; } = new(new List { "WolfMoveRight", "WolfMoveLeft", "WolfJumpRight", "WolfJumpLeft" }, ""); + + public override void Attack(Player player) + { + + } + + public override void Death() + { + + } + + public override void Move(GameTime gameTime, Player player) + { + + } + } +} diff --git a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Zombie.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Zombie.cs index 68e2881..053f2e5 100644 --- a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Zombie.cs +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Zombie.cs @@ -61,7 +61,7 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters } - public override void Move(GameTime gameTime) + public override void Move(GameTime gameTime, Player player) { double delta = gameTime.ElapsedGameTime.TotalSeconds; if (isGoRight) diff --git a/DangerousD/GameCore/Levels/Level1.cs b/DangerousD/GameCore/Levels/Level1.cs index 1716044..835674c 100644 --- a/DangerousD/GameCore/Levels/Level1.cs +++ b/DangerousD/GameCore/Levels/Level1.cs @@ -13,6 +13,7 @@ namespace DangerousD.GameCore.Levels var Трава = new GrassBlock(new Vector2(0, 128)); var Death = new TestAnimationDeath(new Vector2(128, 128)); var Zombie = new Zombie(new Vector2(256, 128)); + var Frank = new Frank(new Vector2(384, 128)); } } }