Feb-22-2021, 05:39 PM
self.stars
is a SpriteGroup that you draw each frame. It looks like the only place you add items to that sprite group is in StarrySky.create_grid()
... but I don't see anywhere where that function gets called. Should that be included in the __init__ method?Something like:
def __init__(self): """Initialise the game and create game resources.""" pygame.init() # initialise the background settings # which the game needs to work properly self.settings = Settings() self.screen = pygame.display.set_mode((0,0), pygame.FULLSCREEN) # tells pygame to figure out a window size to fill the screen self.settings.screen_width = self.screen.get_rect().width self.settings.screen_height = self.screen.get_rect().height # updates the screen settings after fullscreen has been created pygame.display.set_caption("Starry Sky") self.star = Star(self) self.stars = pygame.sprite.Group() self.create_grid()