Dec-13-2020, 09:43 PM
Those functions pause the whole script. Do you have a game loop? What you need are timed updates for your doors, where they measure how much time has passed and open and close how you want.
class Door(): def __init__(self): self.last_update = pygame.time.get_ticks() self.interval = 1000 # 1 second self.state = "closed" def update(self): now = pygame.time.get_ticks() if now - self.last_update > self.interval: self.last_update = now if self.state == "closed": self.state = "open" else: self.state = "closed"