Merge remote-tracking branch 'origin/livingEntities'

# Conflicts:
#	DangerousD/Content/Content.mgcb
#	DangerousD/Content/MonstersAnimations.png
#	DangerousD/Content/animation1.png
#	DangerousD/GameCore/GameObjects/LivingEntities/CoreEnemy.cs
#	DangerousD/GameCore/GameObjects/LivingEntities/Monsters/Zombie.cs
This commit is contained in:
SergoDobro 2023-08-16 14:42:41 +03:00
commit 5aa906a66b
5 changed files with 23 additions and 18 deletions

View file

@ -13,18 +13,6 @@
#---------------------------------- Content ---------------------------------# #---------------------------------- 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 #begin File.spritefont
/importer:FontDescriptionImporter /importer:FontDescriptionImporter
/processor:FontDescriptionProcessor /processor:FontDescriptionProcessor

View file

@ -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"}

View file

@ -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}

View file

@ -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"}

View file

@ -15,10 +15,11 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
private bool isGoRight = false; private bool isGoRight = false;
public Frank(Vector2 position) : base(position) public Frank(Vector2 position) : base(position)
{ {
Width = 56; Width = 112;
Height = 80; Height = 160;
GraphicsComponent.StartAnimation("FrankMoveLeft"); GraphicsComponent.StartAnimation("FrankMoveLeft");
monster_speed = 50; monster_speed = 1;
name = "Фрэнк";
} }
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "FrankMoveRight", "FrankMoveLeft" }, "FrankMoveRight"); protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "FrankMoveRight", "FrankMoveLeft" }, "FrankMoveRight");
@ -34,11 +35,17 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
public override void Move(GameTime gameTime) 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 (isGoRight)
{ {
if (GraphicsComponent.GetCurrentAnimation != "FrankMoveRight") if (GraphicsComponent.GetCurrentAnimation != "FrankMoveRight")
{ {
GraphicsComponent.StartAnimation("FrankMoveRight"); GraphicsComponent.StartAnimation("FrankMoveRight");
velocity = new Vector2(monster_speed, 0);
} }
} }
else if (!isGoRight) else if (!isGoRight)
@ -46,8 +53,18 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
if (GraphicsComponent.GetCurrentAnimation != "FrankMoveLeft") if (GraphicsComponent.GetCurrentAnimation != "FrankMoveLeft")
{ {
GraphicsComponent.StartAnimation("FrankMoveLeft"); GraphicsComponent.StartAnimation("FrankMoveLeft");
velocity = new Vector2(-monster_speed, 0);
} }
} }
if (_pos.X <= 1)
{
isGoRight = true;
}
else if (_pos.X >= 500)
{
isGoRight = false;
}
} }
} }
} }