Login
Community
DARK THEME

All the objects in the list

I wonder how do I check for a value of an entire list of the same objects that have that value. I tried:

          for o in objects
             if o.HasMoved == true then
                I do my thing 
             end
          end

I request your help and thank you in advance :)

Been there, done that, still gets me, LOL
Encountered a similar problem when I tried to loop through the sprites list to check data.
Initial thought of mine was
for i in sprites print(i.width) end
, so similar to your. Outcome ... zero,zero,zero

BUT for i in sprites print(sprites[i].width) end did the trick :)

Hope that will do the trick for you too ... and don't ask me why , HAHA

As in, try if objects[o].HasMoved==true then ...

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community