I’m doing nothing wrong. Why isn’t my video system initialized?

20 views Asked by At
import sys
import pygame


class AlienInvasion:
    """Overall class to manage game assets and behavior"""

    def __int__(self):
        """Initialize the game, and create game resources."""
        pygame.init()

        self.screen = pygame.display.set_mode((1200, 800))
        pygame.display.set_caption("Alien Invasion")

        self.bg_color = (230, 230, 230)

    def run_game(self):
        """Start the main loop for the game"""
        while True:
            # Watch for keyboard and mouse events.
            for event in pygame.event.get():
                if event.type == pygame.QUIT:
                    sys.exit()

            # Make the most recently drawn screen visible.
            pygame.display.flip()


if __name__ == '__main__':
    ai = AlienInvasion()
    ai.run_game()

I'm trying to make an Alien Invasion game while following a tutorial. I did everything right (I think), and the tutorial should work for python 3.X. The code should make a blank screen when run. Is this a problem with my code or with my pyCharm?

0

There are 0 answers