particles/Particle.cs

24 lines
441 B
C#
Raw Normal View History

2021-12-26 15:56:57 -05:00
using Godot;
public class Particle : Node2D
{
private Sprite _spriteNode;
2021-12-26 16:45:02 -05:00
private ParticleType _type;
2021-12-26 15:56:57 -05:00
2021-12-26 21:16:28 -05:00
public Vector2 Velocity { get; set; }
2021-12-26 16:45:02 -05:00
public ParticleType Type
2021-12-26 15:56:57 -05:00
{
2021-12-26 16:45:02 -05:00
get => _type;
2021-12-26 15:56:57 -05:00
set
{
2021-12-26 16:45:02 -05:00
_type = value;
_spriteNode.Modulate = Color.FromHsv(_type.Hue, 1, 1);
2021-12-26 15:56:57 -05:00
}
}
public override void _Ready()
{
_spriteNode = GetNode<Sprite>("Sprite");
}
}