DangerousD/DangerousD/GameCore/GameObjects/LivingEntities/Player/Player.cs
2023-08-17 10:56:50 +03:00

43 lines
1.3 KiB
C#

using DangerousD.GameCore.Graphics;
using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DangerousD.GameCore.GameObjects.PlayerDeath;
namespace DangerousD.GameCore.GameObjects.LivingEntities
{
public class Player : LivingEntity
{
bool isAlive = true;
public Player(Vector2 position) : base(position)
{
Width = 32;
Height = 64;
GraphicsComponent.actionOfAnimationEnd += () =>
{
AppManager.Instance.ChangeGameState(GameState.GameOver);
};
}
public bool IsAlive { get { return isAlive; } }
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> { "ZombieMoveRight", "ZombieMoveLeft", "ZombieRightAttack", "ZombieLeftAttack", "DeathFromZombie" }, "ZombieMoveLeft");//TODO: Change to player
public void Kill()
{
}
public void Death(string monsterName)
{
if(monsterName == "Zombie")
{
DeathRectangle deathRectangle = new DeathRectangle(Pos, "DeathFrom" + monsterName);
GraphicsComponent.actionOfAnimationEnd();
}
isAlive = false;
}
}
}