marked attributes of a few classes as protected
This commit is contained in:
@@ -29,17 +29,18 @@ class GameSurface(pygame.Surface):
|
||||
game_fps: How many frames per second the game will run at.
|
||||
"""
|
||||
super().__init__(game_res, pygame.SRCALPHA)
|
||||
self.running = True
|
||||
self.running = True # Surfaces should be running by default
|
||||
self.next_surface = None
|
||||
self.resource_dir = resources_dir
|
||||
self._clock = pygame.time.Clock()
|
||||
self.game_fps = game_fps
|
||||
self._input_handler = InputHandler(self._clock)
|
||||
self.additional_args = {}
|
||||
self.dev_override = False
|
||||
|
||||
self.bg = pygame.image.load(self.resource_dir + '/images/bg.png').convert_alpha()
|
||||
self.sprites = pygame.sprite.Group()
|
||||
self.background = pygame.image.load(self.resource_dir + '/images/bg.png').convert_alpha()
|
||||
|
||||
self._clock = pygame.time.Clock()
|
||||
self._input_handler = InputHandler(self._clock)
|
||||
self._sprites = pygame.sprite.Group()
|
||||
|
||||
def preprocess(self):
|
||||
"""
|
||||
@@ -47,12 +48,11 @@ class GameSurface(pygame.Surface):
|
||||
"""
|
||||
self._clock.tick(self.game_fps)
|
||||
|
||||
self.blit(self.bg, (0, 0))
|
||||
self.sprites.update()
|
||||
self.sprites.draw(self)
|
||||
self.blit(self.background, (0, 0))
|
||||
self._sprites.update()
|
||||
self._sprites.draw(self)
|
||||
|
||||
self._input_handler.update()
|
||||
if self._input_handler.dev_found:
|
||||
self.next_surface = 'dev_menu'
|
||||
self.dev_override = True
|
||||
self.running = False
|
||||
|
Reference in New Issue
Block a user