Rename welcome message sprite

This commit is contained in:
Sourabh Verma 2023-06-19 04:22:34 +05:30
parent 35ecd4465e
commit 879c386d09
No known key found for this signature in database
GPG Key ID: 117177475D1726CF
2 changed files with 6 additions and 7 deletions

View File

@ -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),
)

View File

@ -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