Untitled
unknown
plain_text
a month ago
912 B
4
Indexable
import pygame # Importa il modulo pygame pygame.init () # Inizializza il modulo # Crea una finestra con una determinata dimensione SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 screen_surface = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT)) # Dai un nome alla tua finestra pygame.display.set_caption( 'Mega Schermo Nero Blocca Tutto' ) # Variabile che decide se la finestra deve essere chiusa game_isRunning = True # Codice in esecuzione fino all'apertura della finestra while game_isRunning : # Leggere un evento registrato dal computer events = pygame.event.get() for event in events: print ( event ) # Controlla se l'applicazione deve essere chiusa if event.type == pygame.QUIT : game_isRunning = False # L'utente ha fatto clic sul pulsante X? pygame.display.update() # Aggiorna la finestra pygame.quit() # Esci dall'applicazione quit() # Chiude lo script
Editor is loading...
Leave a Comment