Upload files to "/"

main
Irina Ternovaja 2024-02-19 08:18:32 +00:00
parent cc90e6b467
commit 7e7d0566e8
1 changed files with 28 additions and 2 deletions

30
main.py
View File

@ -11,7 +11,7 @@ def main():
icon = pygame.image.load("ICON.png")
pygame.display.set_icon(icon)
background = pygame.image.load("space.jpg")
background = pygame.transform.scale(background, (1000,700))
# background = pygame.transform.scale(background, (1000,700))
hangar = pygame.image.load("HANGAR.jpg")
@ -49,9 +49,35 @@ def main():
running = True
difficulty = 0
def draw_text(text, font, text_col, x, y):
text = font.render(text, True, text_col)
screen.blit(text, (x, y))
while running:
match scene:
case "menu":
screen.blit(hangar, (0, 0)) #menu
if new_game_button.draw(screen):
scene = "game"
if difficulty_button.draw(screen):
scene = "difficulty"
if best_score_button.draw(screen):
scene = "best_score"
case "best_score":
screen.blit(hangar, (0, 0))
print_best_score(best_score[difficulty])
if back_button.draw(screen):
scene = "menu"
case "difficulty":
screen.blit(hangar, (0, 0))
draw_text("Choose the difficulty", font, text_color, 350, 50)
for i in range(0, len(difficulty_buttons)):
if difficulty_buttons[i].draw(screen):
difficulty = i
scene = "menu"
if back_button.draw(screen):
scene = "menu"
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False