Feb 13, 2020 03:57 AM
(This post was last modified: Feb 13, 2020 04:00 AM by Bora or Hyuna.)
Hi there,
I am trying to iterate through a list of objects, what I want to do is if only 1 object in the list returns true, the program should continue until all the other objects return True.
Here is my update method:
Here is my method for returning a boolean value:
At the current moment what this does is, when I run the program I initialise a few objects so they are run, but after my first object in the list returns True, all my other objects stops what they are doing and my program stops working. How can I make changes so that the program will stop only after all the objects have returned True. Please let me know if you need to see more of my code, thanks!
I am trying to iterate through a list of objects, what I want to do is if only 1 object in the list returns true, the program should continue until all the other objects return True.
Here is my update method:
Code
def next_frame(self):
global finish
if(Clock.time%(random.randrange(1,60, 2))==0):
self.set_frame(self.frame + 1)
if(self.done()):
finish = TrueHere is my method for returning a boolean value:
Code
def done(self):
global finish
if((self.frame == (self.grid_s[0]*self.grid_s[1])-1)):
#finish = True
return True
else:
return False

![[Image: 0DvFxnA.gif]](https://i.imgur.com/0DvFxnA.gif)