Compare commits
No commits in common. "e2289fc3a2b03b0cc56a68815dffece8bde10151" and "b78b29f22b5a861ecdcfd805049f8a774120cfc1" have entirely different histories.
e2289fc3a2
...
b78b29f22b
1
Game
1
Game
|
|
@ -1 +0,0 @@
|
|||
Subproject commit b78b29f22b5a861ecdcfd805049f8a774120cfc1
|
||||
19
main.py
19
main.py
|
|
@ -20,7 +20,6 @@ enemy_img = pygame.image.load('Sprite-0001.png').convert()
|
|||
enemy_img = pygame.transform.scale(
|
||||
enemy_img,
|
||||
(int(enemy_img.get_width() * 0.3), int(enemy_img.get_height() * 0.3)))
|
||||
enemy_img.set_colorkey((0, 0, 0))
|
||||
|
||||
#end ekrāns
|
||||
end_img = pygame.image.load('Sprite-0002.png').convert()
|
||||
|
|
@ -77,7 +76,6 @@ class Player(pygame.sprite.Sprite):
|
|||
self.rect.centery = self.lane_centers[self.current_lane]
|
||||
|
||||
|
||||
# Vētras klase
|
||||
# Vētras klase (sarkanās blokas)
|
||||
class Enemy(pygame.sprite.Sprite):
|
||||
def __init__(self, image, lane_centers, speed=5):
|
||||
|
|
@ -96,7 +94,6 @@ 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)
|
||||
|
|
@ -107,15 +104,6 @@ def draw_end_screen(screen, final_score, high_score):
|
|||
font_med = pygame.font.Font(None, 60)
|
||||
font_small = pygame.font.Font(None, 40)
|
||||
|
||||
# "GAME OVER" uzraksts
|
||||
title = font_big.render("Spēle Beigusies", True, (220, 50, 50))
|
||||
screen.blit(title, title.get_rect(center=(SCREEN_WIDTH // 2, SCREEN_HEIGHT // 2 - 160)))
|
||||
|
||||
# Beigu punktu skaits
|
||||
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)))
|
||||
|
||||
# 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)))
|
||||
|
|
@ -130,14 +118,15 @@ def draw_end_screen(screen, final_score, high_score):
|
|||
hs_text = font_med.render(hs_label, True, hs_color)
|
||||
screen.blit(hs_text, hs_text.get_rect(center=(SCREEN_WIDTH // 2, SCREEN_HEIGHT // 2 + 10)))
|
||||
|
||||
# Instrukcijas lietotājam
|
||||
restart_text = font_small.render("Uzspiediet R lai sāktu no jauna", True, (100, 255, 100))
|
||||
quit_text = font_small.render("Uzspiediet Q lai izietu", True, (255, 100, 100))
|
||||
# Instructions
|
||||
restart_text = font_small.render("Press R to Restart", True, (100, 255, 100))
|
||||
quit_text = font_small.render("Press Q to Quit", True, (255, 100, 100))
|
||||
screen.blit(restart_text, restart_text.get_rect(center=(SCREEN_WIDTH // 2, SCREEN_HEIGHT // 2 + 90)))
|
||||
screen.blit(quit_text, quit_text.get_rect(center=(SCREEN_WIDTH // 2, SCREEN_HEIGHT // 2 + 140)))
|
||||
|
||||
|
||||
def reset_game(player, enemies):
|
||||
"""Reset all game state for a new run."""
|
||||
player.reset()
|
||||
enemies.empty()
|
||||
pygame.time.set_timer(SPAWN_FIRST, 1500)
|
||||
|
|
|
|||
Loading…
Reference in New Issue