particle pool

This commit is contained in:
ethan merchant 2024-11-24 13:17:45 -05:00
parent 00c230b6d7
commit 32bb4364d6

View file

@ -5,6 +5,24 @@ namespace snake;
static class VFX static class VFX
{ {
public static Particle[] particles = new Particle[32];
static int index = 0;
public static void Init()
{
for (int i = 0; i < particles.Length; i++)
{
particles[i] = new();
}
}
public static void Play(XYZi pos)
{
for (int i = 0; i < 8; i++)
{
index = (index + 1) % particles.Length;
}
}
} }