for i in objects:
if self.y + self.y_vel > HEIGHT+self.ySize:
self.y_vel = 0
break
elif pygame.Rect.colliderect(self.rect, i.rect):
self.y_vel = 0
break
else:
self.y_vel += 0.05
this code works all right till the last else because the for loop maybe hasn't reached the object its colliding with so it gives it gravity so my question is is there a way to do pygame.Rect.colliderect(self.rect, all(i).rect) but that doesn't work I experimented with all() but I don't really know how that would work any help is appreciated