import pygame pygame.init() from datetime import date import Game pygame.display.set_caption("Climate Simulator : Global Organization") screen = pygame.display.set_mode((0,0), pygame.FULLSCREEN) #on récupère le mois actuelle pour le faire commencer à ce moment class month: def __init__ (self, str): self.month = str current_month = month(date.today().strftime("%b")) #background (2è scène) background = pygame.image.load('../assets/Interface/intro.webp') background = pygame.transform.scale(background, (screen.get_width(), screen.get_height())) #bouton play_button = pygame.image.load('../assets/Interface/button.png') play_button = pygame.transform.scale(play_button,(400,150)) play_button_rect = play_button.get_rect() play_button_rect.x = screen.get_width() / 2 - play_button.get_width()/2 play_button_rect.y = screen.get_height() / 2 - play_button.get_height()/2 #buisson #bush = pygame.image.load('../assets/buisson.png') #cadenas #lock = pygame.image.load('../assets/cadenas.png') screen.blit(background, (0,0)) screen.blit(play_button, play_button_rect) #screen.blit(bush, (100,100)) #screen.blit(lock, (bush.get_width()/2,bush.get_height()/2+40)) pygame.display.update() inMenu = True while inMenu: for event in pygame.event.get(): if event.type == pygame.MOUSEBUTTONDOWN and play_button_rect.contains(*event.pos,0,0): inMenu = False elif event.type == pygame.QUIT or event.type == pygame.KEYDOWN and event.key == pygame.K_ESCAPE: exit(0) # à l'appui du bouton start Game.Game().gameLoop()