aboutsummaryrefslogtreecommitdiff
path: root/src/objs/specks.lua
diff options
context:
space:
mode:
Diffstat (limited to 'src/objs/specks.lua')
-rw-r--r--src/objs/specks.lua9
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 = {}