ended work on zombie
This commit is contained in:
parent
d65320f21b
commit
ac1b3b6373
2 changed files with 5 additions and 3 deletions
|
@ -12,7 +12,8 @@ namespace DangerousD.GameCore
|
|||
{
|
||||
public abstract class GameObject : IDrawableObject
|
||||
{
|
||||
public Vector2 Pos { get; protected set; }
|
||||
private Vector2 _pos;
|
||||
public Vector2 Pos => _pos;
|
||||
public int Width { get; protected set; }
|
||||
public int Height { get; protected set; }
|
||||
public Rectangle Rectangle => new Rectangle((int)Pos.X, (int)Pos.Y, Width, Height);
|
||||
|
@ -21,7 +22,7 @@ namespace DangerousD.GameCore
|
|||
protected abstract GraphicsComponent GraphicsComponent { get; }
|
||||
public GameObject(Vector2 pos)
|
||||
{
|
||||
Pos = pos;
|
||||
_pos = pos;
|
||||
Width = 500;
|
||||
Height = 101;
|
||||
//Animator = new GraphicsComponent(new() { "playerIdle" });
|
||||
|
|
|
@ -18,9 +18,10 @@ namespace DangerousD.GameCore.GameObjects.LivingEntities.Monsters
|
|||
Width = 72;
|
||||
Height = 120;
|
||||
monster_speed = 100;
|
||||
GraphicsComponent.StartAnimation("ZombieLeftAttack");
|
||||
name = "Zombie";
|
||||
}
|
||||
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "ZombieMoveRight", "ZombieMoveLeft", "ZombieRightAttack", "ZombieLeftAttack" }, "ZombieMoveRight");
|
||||
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "ZombieMoveRight", "ZombieMoveLeft", "ZombieRightAttack", "ZombieLeftAttack" }, "ZombieMoveLeft");
|
||||
|
||||
public override void Update(GameTime gameTime)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue