Python Forum
My game's code works but Python still freezes at random intervals. - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Game Development (https://python-forum.io/forum-11.html)
+--- Thread: My game's code works but Python still freezes at random intervals. (/thread-35637.html)

Pages: 1 2


RE: My game's code works but Python still freezes at random intervals. - game_slayer_99 - Nov-26-2021

(Nov-25-2021, 02:33 PM)metulburr Wrote: You really should use github so people can run the code without having to downloaded every single file. as well as have access to the images.
I've attached all the Python files, images, sounds, and text files I used to the link below.
https://github.com/GameSlayer99/PepePong


RE: My game's code works but Python still freezes at random intervals. - game_slayer_99 - Nov-26-2021

I also just noticed that I am unpausing the main track every single time the main loop restarts in game_functions.py, line 12. Could this hurt my performance as well?


RE: My game's code works but Python still freezes at random intervals. - game_slayer_99 - Dec-09-2021

I was able to resolve the issue. I moved all sound file loading commands to a single class so that they weren't being loaded every time the sound file is played. I also deleted the line of code that made the main music replay every cycle through the main loop. My game hasn't crashed once since making these adjustments. Thank you all for the help.


RE: My game's code works but Python still freezes at random intervals. - metulburr - Dec-09-2021

Glad you fixed it. You made it farther than some who assume python is too slow and switches languages before realizing their mistake. I'm sure they are out there now doing the same bottlenecks in C++ wondering why their game is lagging/crashing.