From 1256b1d5b43e899c9972fba47eef28d513740024 Mon Sep 17 00:00:00 2001 From: ne_mene Date: Mon, 30 Mar 2026 00:58:50 +0200 Subject: speck oneshot and emitting flag --- src/objs/specks.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/objs/specks.lua') diff --git a/src/objs/specks.lua b/src/objs/specks.lua index 9424680..061f0fb 100644 --- a/src/objs/specks.lua +++ b/src/objs/specks.lua @@ -75,6 +75,9 @@ function Speck_Sys.new() self.x = 0 self.y = 0 self.spawn_timer = self.interval + + self.oneshot = false + self.emitting = true return self end @@ -140,10 +143,13 @@ function Speck_Sys:update(dt) -- particle spawning self.spawn_timer = self.spawn_timer - dt - if self.spawn_timer <= 0 then + if self.spawn_timer <= 0 and self.emitting then self.spawn_timer = self.interval self:spawn_particles() + if self.oneshot then + self.emitting = false + end end -- particles processing @@ -247,6 +253,7 @@ function export_speck_sys(sys, filename) "interval", "texture_path", "gradient", + "oneshot", "bounce", } local exp = {} -- cgit v1.3-2-g0d8e