main
Romans Zubenko 2026-02-24 00:01:36 +02:00
commit e2289fc3a2
1 changed files with 12 additions and 0 deletions

12
main.py
View File

@ -78,6 +78,7 @@ class Player(pygame.sprite.Sprite):
# Vētras klase
# Vētras klase (sarkanās blokas)
class Enemy(pygame.sprite.Sprite):
def __init__(self, image, lane_centers, speed=5):
super().__init__()
@ -96,6 +97,8 @@ class Enemy(pygame.sprite.Sprite):
def draw_end_screen(screen, final_score, high_score):
# Puscaurspīdīgais tumšais fons
"""Draw the game over overlay with final score and options."""
# Semi-transparent dark overlay
overlay = pygame.Surface((SCREEN_WIDTH, SCREEN_HEIGHT), pygame.SRCALPHA)
overlay.fill((0, 0, 0, 180))
screen.blit(overlay, (0, 0))
@ -113,6 +116,15 @@ def draw_end_screen(screen, final_score, high_score):
screen.blit(score_text, score_text.get_rect(center=(SCREEN_WIDTH // 2, SCREEN_HEIGHT // 2 - 60)))
# Labākais punktu skaits
# "GAME OVER" title
title = font_big.render("GAME OVER", True, (220, 50, 50))
screen.blit(title, title.get_rect(center=(SCREEN_WIDTH // 2, SCREEN_HEIGHT // 2 - 160)))
# Final score
score_text = font_med.render(f"Score: {final_score}", True, (255, 255, 255))
screen.blit(score_text, score_text.get_rect(center=(SCREEN_WIDTH // 2, SCREEN_HEIGHT // 2 - 60)))
# High score
hs_color = (255, 215, 0) if final_score >= high_score else (180, 180, 180)
hs_label = "NEW BEST!" if final_score >= high_score else f"Best: {high_score}"
hs_text = font_med.render(hs_label, True, hs_color)