slime wrote:Well, if you use a numeric for then you're probably going to be using the # operator on the table, and that will also not like gaps in the array part. Just try to either not have gaps in arrays (use table.remove), or discard the notion of iterating over the whole array sequentially if there are gaps. :p
I just tried table.remove... Now I don't have to use something that I hate Thank you, Slime!
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
Jasoco wrote:It has in my experience of sorting my objects by Y.
You can't depend on it, in the documentation it says:
The order in which the indices are enumerated is not specified, even for numeric indices.
Well I'm just saying in all the time I've depended on it for making sure my objects are drawn from top to bottom even when moving around, I've never had it get out of order as long as I use pairs(). And this is with it sorting every single frame.
Personally, if table.sort didn't work right, I don't know what I would do.
if you're getting a meaningful iteration order out of pairs then that means you're either really lucky or it's not actually working like you think it is but haven't seen it mess up yet