@@ -14,17 +14,17 @@ def __init__(self):
1414 # Screen
1515 self .screen_width , self .screen_height = 600 , 600
1616 self .screen = pygame .display .set_mode ((self .screen_width , self .screen_height ))
17- pygame .display .set_caption (" Dodgy Square" )
17+ pygame .display .set_caption (' Dodgy Square' )
1818
1919 # Colours
2020 self .WHITE : tuple = (255 , 255 , 255 )
2121 self .BLACK : tuple = (0 , 0 , 0 )
2222 self .RED : tuple = (255 , 99 , 71 )
23- self .BLUE : tuple = (65 ,105 ,225 )
23+ self .BLUE : tuple = (65 , 105 , 225 )
2424
2525 # Font
26- default_font : str = pygame .font .get_default_font ()
27- self .font : Font = pygame .font .Font (default_font , 26 )
26+ self . default_font : str = pygame .font .get_default_font ()
27+ self .font : Font = pygame .font .Font (self . default_font , 26 )
2828
2929 # Player
3030 self .player_size : int = 30
@@ -89,7 +89,7 @@ def detect_collision(self, player_pos: list[int], enemy_pos: list[int]) -> bool:
8989 def show_game_over (self ):
9090 """Display game-over text"""
9191
92- game_over_text = self .font .render (" Game Over" , True , self .WHITE )
92+ game_over_text = self .font .render (' Game Over' , True , self .WHITE )
9393 self .screen .blit (game_over_text , (self .screen_width // 2 - 70 , self .screen_height // 2 - 16 ))
9494
9595 # Replay the game
@@ -160,7 +160,7 @@ def run(self):
160160 self .draw_character (self .RED , enemy_pos , self .enemy_size )
161161
162162 # Display the score
163- score_text = self .font .render (" Score: " + str (self .score ), True , self .WHITE )
163+ score_text = self .font .render (' Score: ' + str (self .score ), True , self .WHITE )
164164 self .screen .blit (score_text , [10 , 10 ])
165165
166166 # Increment the frame count
0 commit comments