Improved visuals.
This commit is contained in:
1 parent
ce6f49f42b
commit
bd2dbc97ab
1 file changed
+6
-4
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/python3
|
#!/usr/bin/python3
|
||||||
# Description: blockwars - A simple game written in Python.
|
# Description: blockwars - A simple game written in Python.
|
||||||
# Usage: python3 blockwars.py
|
# Usage: python3 blockwars-game.py
|
||||||
# Author: Justin Oros
|
# Author: Justin Oros
|
||||||
# Source: https://github.com/JustinOros
|
# Source: https://github.com/JustinOros
|
||||||
|
|
||||||
@@ -367,15 +367,17 @@ def game():
|
|||||||
# Show final score on death
|
# Show final score on death
|
||||||
def show_final_score(score):
|
def show_final_score(score):
|
||||||
font_large = pygame.font.SysFont(None, 80)
|
font_large = pygame.font.SysFont(None, 80)
|
||||||
neon_blue = (0, 200, 255) # Same as player glow blue
|
if score == 0:
|
||||||
final_score_text = font_large.render(f"Final Score: {score}", True, neon_blue)
|
text = "GAME OVER"
|
||||||
|
else:
|
||||||
|
text = f"Final Score: {score}"
|
||||||
|
final_score_text = font_large.render(text, True, RED)
|
||||||
screen.fill(DARK_GRAY)
|
screen.fill(DARK_GRAY)
|
||||||
screen.blit(final_score_text, (SCREEN_WIDTH // 2 - final_score_text.get_width() // 2,
|
screen.blit(final_score_text, (SCREEN_WIDTH // 2 - final_score_text.get_width() // 2,
|
||||||
SCREEN_HEIGHT // 2 - final_score_text.get_height() // 2))
|
SCREEN_HEIGHT // 2 - final_score_text.get_height() // 2))
|
||||||
pygame.display.flip()
|
pygame.display.flip()
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
game()
|
game()
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user