Move the game intialization variable into a Game
class
pygame.init() surface = pygame.display.set_mode((500,400)) surface.fill((255,255,255))
Create an instance, game
of the Game
class in
in the main __init__
function
game = Game() game.run()
**The code will not run yet
class Game:
def __init__(self):
pygame.init()
self.surface = pygame.display.set_mode((500,400))
self.surface.fill((255,255,255))
def run(self):
pass