restructured project

This commit is contained in:
2022-01-18 12:01:37 -05:00
parent 2286c33b12
commit d2ebbdef62
25 changed files with 64 additions and 2239 deletions

View File

@@ -0,0 +1,38 @@
using Godot;
// ReSharper disable once CheckNamespace
// ReSharper disable once ClassNeverInstantiated.Global
public class ParticleNode : Node2D
{
private Label _labelNode;
private Sprite _spriteNode;
public Vector2 CurrentSimulationPosition = new Vector2();
public Vector2 LastSimulationPosition;
public bool WasTeleportedLast = true;
public int SimulationId;
public override void _Ready()
{
_spriteNode = GetNode<Sprite>("Sprite");
_labelNode = GetNode<Label>("Label");
}
public override void _Process(float delta)
{
Position = WasTeleportedLast == false
? LastSimulationPosition.LinearInterpolate(CurrentSimulationPosition,
GetParent<Node2D>().GetParent<ParticleSimulationScene>().PhysicsInterpolationFraction)
: CurrentSimulationPosition;
}
public void SetLabelText(string text)
{
_labelNode.Text = text;
}
public void SetColor(float hue, float saturation, float opacity)
{
_spriteNode.Modulate = Color.FromHsv(hue, saturation, 1, opacity);
}
}