DangerousD/DangerousD/GameCore/GameObjects/LivingEntities/Diamond.cs
2023-08-18 15:55:53 +03:00

28 lines
567 B
C#

using System;
using System.Collections.Generic;
using DangerousD.GameCore.Graphics;
using Microsoft.Xna.Framework;
namespace DangerousD.GameCore.GameObjects.LivingEntities
{
public class Diamond : Entity
{
protected override GraphicsComponent GraphicsComponent { get; } = new GraphicsComponent(new List<string>() { "spriteDiamond" }, "spriteDiamond");
public Diamond(Vector2 position) : base(position)
{
}
public void Update(Player player)
{
if (Rectangle.Intersects(player.Rectangle))
{
player.score++;
}
}
}
}