How do you fix: “AttributeError: 'Boundary' object has no attribute 'rect'”?
问题 I am making a platformer game where there is a boundary in the beginning of the level, so the player can't just keep going to the left for no reason. I decided to make a class called boundary and add it into a list where the rules are you can't pass it. However, I keep getting this error: "AttributeError: 'Boundary' object has no attribute 'rect'". Can anybody fix this? Also, a better way to do this would also be accepted. Thanks! class Boundary(pygame.sprite.Sprite): def __init__(self):