diff --git a/src/VFX.cs b/src/VFX.cs index 6600d4d..6913362 100644 --- a/src/VFX.cs +++ b/src/VFX.cs @@ -74,6 +74,30 @@ static class VFX // } } } + + for (int i = 0; i < leafs.count; i++) + { + Particle particle = leafs.particles[i]; + particle.state.Step(particle.pos.y > 0); + if (particle.state.state) + { + particle.pos += particle.vel * Time.Stepf; + float x_wind = Maths.smooth_stop(Maths.u_scalar(SKMath.Sin((particle.pos.x * 0.5f) - Time.Totalf))); + particle.vel.x += x_wind * Time.Stepf; + particle.vel += Vec3.Up * -9.81f * 0.1f * Time.Stepf; + particle.ori = Quat.LookDir(particle.vel) * Quat.FromAngles(0, 0, 90); + } + else + { + particle.pos.y = 0; + particle.vel = Vec3.Zero; + + if (particle.state.delta == -1) + { + Ripple(particle.pos); + } + } + } } }