edited core enemy

This commit is contained in:
bmvolf 2023-08-17 09:56:55 +03:00
parent ff46f3694a
commit 5e5cc3ef74
4 changed files with 10 additions and 11 deletions

View file

@ -24,11 +24,6 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
public override void Update(GameTime gameTime) public override void Update(GameTime gameTime)
{ {
if (monster_health <= 0)
{
Death();
isAlive = false;
}
base.Update(gameTime); base.Update(gameTime);
} }
public abstract void Death(); public abstract void Death();
@ -36,5 +31,15 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities
public abstract void Attack(); public abstract void Attack();
public abstract void Move(GameTime gameTime); public abstract void Move(GameTime gameTime);
public void TakeDamage(int damage)
{
monster_health -= damage;
if (monster_health <= 0)
{
Death();
isAlive = false;
}
}
} }
} }

View file

@ -106,11 +106,5 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
} }
base.OnCollision(gameObject); base.OnCollision(gameObject);
} }
public void TakeDamage(int damage)
{
monster_health -= damage;
//play take damage animation
}
} }
} }