From 879c386d096a2a646fa2af48dbf968471ae2974d Mon Sep 17 00:00:00 2001 From: Sourabh Verma Date: Mon, 19 Jun 2023 04:22:34 +0530 Subject: [PATCH] Rename welcome message sprite --- src/entities/welcome_message.py | 7 +++---- src/utils/images.py | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/entities/welcome_message.py b/src/entities/welcome_message.py index 964b107..b530dae 100644 --- a/src/entities/welcome_message.py +++ b/src/entities/welcome_message.py @@ -4,11 +4,10 @@ from .entity import Entity class WelcomeMessage(Entity): def __init__(self, config: GameConfig) -> None: + image = config.images.welcome_message super().__init__( config=config, - image=config.images.message, - x=int( - (config.window.width - config.images.message.get_width()) / 2 - ), + image=image, + x=(config.window.width - image.get_width()) // 2, y=int(config.window.height * 0.12), ) diff --git a/src/utils/images.py b/src/utils/images.py index 87df610..d68d38c 100644 --- a/src/utils/images.py +++ b/src/utils/images.py @@ -9,7 +9,7 @@ from .constants import BACKGROUNDS, PIPES, PLAYERS class Images: numbers: List[pygame.Surface] game_over: pygame.Surface - message: pygame.Surface + welcome_message: pygame.Surface base: pygame.Surface background: pygame.Surface player: Tuple[pygame.Surface] @@ -27,8 +27,8 @@ class Images: self.game_over = pygame.image.load( "assets/sprites/gameover.png" ).convert_alpha() - # message sprite for welcome screen - self.message = pygame.image.load( + # welcome_message sprite for welcome screen + self.welcome_message = pygame.image.load( "assets/sprites/message.png" ).convert_alpha() # base (ground) sprite