particle pool
This commit is contained in:
parent
00c230b6d7
commit
32bb4364d6
1 changed files with 19 additions and 1 deletions
18
src/VFX.cs
18
src/VFX.cs
|
@ -5,6 +5,24 @@ namespace snake;
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue