Python Forum
Pygame freezes after certain time
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pygame freezes after certain time
#3
For some reason it freezes on Windows, I'll check on linux later, but it worked once I used a while loop instead of iterator and added event check. It's a simple letter puzzle game for assembling words, kind of like 2D rubik's cube.
count = 0
while count < 100:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            run = False
    if count % 2 == 0:
        anim_move_right(randint(0, ltr_range - 1))
    else:
        anim_move_up(randint(0, ltr_range - 1))
    count += 1

pygame.quit()
Thanks for checking!
Reply


Messages In This Thread
Pygame freezes after certain time - by GJG - May-03-2021, 02:53 AM
RE: Pygame freezes after certain time - by GJG - May-06-2021, 10:52 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  My game's code works but Python still freezes at random intervals. game_slayer_99 13 7,574 Dec-09-2021, 11:23 AM
Last Post: metulburr
  [PyGame] Pygame.time.wait is not behaving as expected zootechdrum 2 3,080 Mar-19-2019, 03:27 AM
Last Post: Windspar

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020