techwithtim / PygameForBeginners

A simple 2D python game designed to teach you the pygame module.
432 stars 373 forks source link

Pygame missing init line 3 and after quit event sys.exit() call #4

Open takonkle opened 3 years ago

takonkle commented 3 years ago

Using code as is had "pygame.error: video system not initialized" upon window close Pygame tutorial website says to add (before line 3): pygame.init() So that all modules are initialed... May or not be an issue.

in main() after one detects exit event, for loop is left to keep looking for events even though pygame.quit() is called, thus after line with pygame.quit() add: sys.exit() and perhaps import sys module in first line.

Summary of changes:

Tomasu-99 commented 2 years ago

I did this but now nothing comes up on the screen.