Dec-13-2020, 07:10 PM
when i use time.sleep() or pygame.time.wait() it always freezes the whole game instead of one specific thing.
lets say i want to make a door open and close every few seconds. when i do that instead of just pausing the door it pauses the whole game every few seconds:
elif self.flag == 'door_v':
self.x -= 3
if abs(self.x - self.door_prev_pos) > TILE:
self.door_open_trigger = False
pygame.time.wait(2000)
self.door_close_trigger = True
lets say i want to make a door open and close every few seconds. when i do that instead of just pausing the door it pauses the whole game every few seconds:
elif self.flag == 'door_v':
self.x -= 3
if abs(self.x - self.door_prev_pos) > TILE:
self.door_open_trigger = False
pygame.time.wait(2000)
self.door_close_trigger = True