Oct-25-2018, 02:25 AM
I don't believe you need all that for that function. This isn't tested (I don't have pygame), but it should accomplish the same task:
Give it a shot and see if it works.
def update(self): for co_ord in self.img_co_ords: #print "co_ord.sx = " + str(co_ord.sx) + " co_ord.ex = " + str(co_ord.ex) if not co_ord.in_place: if co_ord.sx != co_ord.ex: co_ord.sx += (co_ord.ex - co_ord.sx) if co_ord.sy != co_ord.ey: co_ord.sy += (co_ord.ey - co_ord.sy) co_ord.in_place == True self.draw()It's checking if the coordinates match. If they do not, it adds a value to the sx or sy attribute based on the difference between it and its associated partner. If the value is too high, this should add a negative to decrease it; if it is too low, this should add a position to raise it. With this logic, you should only require one pass through the list rendering the outer while loop, the done variable, and the done_count superfluous.
Give it a shot and see if it works.