I made a rect2 for my class DS and added this class to a group called(DSgroup1) and I want to check the collide between the p1 and rect2
def colids(self):
if pygame.sprite.spritecollide(p1.sprite, DSgroup1, False) or pygame.sprite.spritecollide(p1.sprite, DSgroup1.rect2, False):
self.hp -= 1
print(self.hp)
so what should I do to reference rect2 from DSgroup1
btw this def is inside the Player class
this is diffrent I am not asking how to examin a coll I am asking how to examin a coll with rect2 wich is a value in a class in a group
New contributor
ggfban1 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
0