Python Forum
My game's code works but Python still freezes at random intervals.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
My game's code works but Python still freezes at random intervals.
#10
"This is "a" bottleneck, but maybe not "the" bottleneck. You are loading the wav files every single time you play them instead of saving it as an object. Every single time the ball hits the wall it has to load the file. One of these times it may fail. If not it is still bottlenecking your code."

That may explain why the game consistently crashes only immediately after impacting either a wall or one of the paddles. I'll test it out.

Edit: I removed the sound files entirely and have yet to experience a game crash. I feel confident at the moment that this was at the very least a major contributing issue.
Reply


Messages In This Thread
RE: My game's code works but Python still freezes at random intervals. - by game_slayer_99 - Nov-25-2021, 11:08 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  From python game in terminal to a website game using bottle Njanez 0 3,887 Aug-13-2021, 01:11 PM
Last Post: Njanez
  Pygame freezes after certain time GJG 2 5,390 May-06-2021, 10:52 AM
Last Post: GJG
  Game “Pong” I have problems with the code BenBach18 2 3,548 Jan-10-2021, 05:16 PM
Last Post: michael1789
  Bringing My Game Code Into Class Format ZQ12 1 2,239 Dec-22-2019, 05:32 AM
Last Post: michael1789

Forum Jump:

User Panel Messages

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