diff options
| author | ne_mene <[email protected]> | 2026-03-30 00:58:50 +0200 |
|---|---|---|
| committer | ne_mene <[email protected]> | 2026-03-30 00:58:50 +0200 |
| commit | 1256b1d5b43e899c9972fba47eef28d513740024 (patch) | |
| tree | bfa7ee8cc1c0816ac05032dfc8b9753793db0dcb /src/objs/specks.lua | |
| parent | 227bcba36ebc1f12cfd0c21c62216177e63e9424 (diff) | |
speck oneshot and emitting flag
Diffstat (limited to 'src/objs/specks.lua')
| -rw-r--r-- | src/objs/specks.lua | 9 |
1 files changed, 8 insertions, 1 deletions
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 = {} |
