DangerousD/DangerousD/GameCore/GameObjects/LivingEntities/Player/DeathRectangle.cs
2023-08-17 11:40:52 +03:00

35 lines
971 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DangerousD.GameCore.GameObjects;
using DangerousD.GameCore.Graphics;
using Microsoft.Xna.Framework;
namespace DangerousD.GameCore.GameObjects.PlayerDeath
{
public class DeathRectangle : GameObject
{
public DeathRectangle(Vector2 pos, string DeathType) : base(pos)
{
Height = 128;
Width = 128;
PlayDeath(DeathType);
}
protected override GraphicsComponent GraphicsComponent { get; } = new(new List<string> {"DeathFromZombie"},
"DeathFromZombie");
public GraphicsComponent Gr => GraphicsComponent;
private void PlayDeath(string deathName)
{
if (GraphicsComponent.GetCurrentAnimation != "DeathFromZombie")
{
GraphicsComponent.StartAnimation("DeathFromZombie");
}
}
}
}