for i,v in ipairs(cubes.cube) do
if v.y < height - 20 then
v.y = v.y + cubes.speed
else
if v.ttl > ttlg then
table.remove(cubes.cube, i)
end
end
v.ttl = v.ttl + 1
end
When I moved the table.reomve() outside the if it did remove them but right after hitting the bottom.
I added the ttl variable so that they can stay there for a while (ttlg = 100) and when ttl > ttlg then it would remove it but it doesn't.
Tought that table.remove() might be the problem as people don't like this solution so i used cubes.cube = nil but that removed all of them.
The problem could also be in something else I'm just a beginner in both Lua and LÖVE.
(They were pictures of cubes before but replaced them with snowflakes since x-mas is getting closer)