diff --git a/DangerousD/Content/Content.mgcb b/DangerousD/Content/Content.mgcb index 8d94070..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 - #begin File.spritefont /importer:FontDescriptionImporter /processor:FontDescriptionProcessor 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/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/Monsters/Frank.cs b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Frank.cs index cab454c..0434e4d 100644 --- a/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Frank.cs +++ b/DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Frank.cs @@ -15,10 +15,11 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters private bool isGoRight = false; public Frank(Vector2 position) : base(position) { - Width = 56; - Height = 80; + Width = 112; + Height = 160; GraphicsComponent.StartAnimation("FrankMoveLeft"); - monster_speed = 50; + monster_speed = 1; + name = "Фрэнк"; } protected override GraphicsComponent GraphicsComponent { get; } = new(new List { "FrankMoveRight", "FrankMoveLeft" }, "FrankMoveRight"); @@ -34,11 +35,17 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters public override void Move(GameTime gameTime) { + /* 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) @@ -46,8 +53,18 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters 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; + } } } }