Python Forum
Game “Pong” I have problems with the code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Game “Pong” I have problems with the code
#3
You get the error when you close the window? Then I don't it's not a problem necessarily.

I've spent many hours over exotic errors as it seems once you hit the close button on the window pygame.QUIT() a bunch of pygame stuff is unitilized, so code between the pygame.QUIT() and the actual end of the program which needs pygame ititalized can throw errors.

I've had it say my joystick wasn't initialized my "Text has zero width", and others.

try exiting the program instantly rather than allowing the loop to play out.

 for event in pygame.event.get():
            if event.type == pygame.QUIT: 
                pygame.quit()
metulburr likes this post
Reply


Messages In This Thread
RE: Game “Pong” I have problems with the code - by michael1789 - Jan-10-2021, 05:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation pong paddles wont move skullkat232 5 2,405 Feb-13-2023, 03:53 PM
Last Post: Vadanane
  My game's code works but Python still freezes at random intervals. game_slayer_99 13 7,804 Dec-09-2021, 11:23 AM
Last Post: metulburr
  Problem with my pong code Than999 3 3,497 Oct-22-2021, 08:50 AM
Last Post: Qanima
  [PyGame] Problems with jump code in pygame Joningstone 4 5,431 Aug-23-2021, 08:23 PM
Last Post: deanhystad
  [PyGame] Creating Pong in Pygame Russ_CW 2 2,838 Oct-11-2020, 11:56 AM
Last Post: Russ_CW
  Bringing My Game Code Into Class Format ZQ12 1 2,226 Dec-22-2019, 05:32 AM
Last Post: michael1789
  Trying to make a simple pong game. kevindadmun 1 3,939 Aug-05-2019, 06:39 AM
Last Post: kevindadmun
  Smiley Pong Help Jasmineleroy 6 4,774 May-22-2019, 11:36 AM
Last Post: metulburr
  [PyGame] How do I add more balls to basic Pong game? JUtah 2 4,479 Apr-18-2019, 08:40 PM
Last Post: JUtah
  [PyGame] Pong game key.event problem erickDarko 2 4,231 Dec-12-2018, 03:17 PM
Last Post: erickDarko

Forum Jump:

User Panel Messages

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