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:
commit
5aa906a66b
5 changed files with 23 additions and 18 deletions
|
@ -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
|
||||
|
|
|
@ -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"}
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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"}
|
||||
|
|
|
@ -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<string> { "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,7 +53,17 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue