summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/particle.lua1
-rw-r--r--src/walk_particle.lua1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/particle.lua b/src/particle.lua
index d3543d4..087f02c 100644
--- a/src/particle.lua
+++ b/src/particle.lua
@@ -12,6 +12,7 @@ local g = anim8.newGrid(16, 16, Particle.image:getWidth(),
function Particle:new(x, y, dx, dy)
if not particles then
+ self:destroy()
return nil
end
self.x = x or 0
diff --git a/src/walk_particle.lua b/src/walk_particle.lua
index edb81d4..b7e927f 100644
--- a/src/walk_particle.lua
+++ b/src/walk_particle.lua
@@ -12,6 +12,7 @@ local g = anim8.newGrid(8, 8, Particle.image:getWidth(),
function Particle:new(x, y, dx)
if not particles then
+ self:destroy()
return nil
end
self.x = x or 0