“Comment changer la couleur du carré en pygame avec la basse pression” Réponses codées

Comment changer la couleur du carré en pygame avec la basse pression

circlerect = pygame.draw.circle(SCREEN, COLOR, POS, RADIUS)
pygame.display.update(circlerect)
Vivacious Vicuña

Comment changer la couleur du carré en pygame avec la basse pression

while True:
    for events in pygame.event.get():
        if events.type == pygame.QUIT:
            pygame.quit()
            sys.exit()
        #Here for any commands inside the for loop  
        if (events.type == pygame.KEYDOWN) and (events.key == pygame.K_SPACE):
            COLOR = (random.randint(ZEROINTENSITY, MAXINTENSITY), random.randint(ZEROINTENSITY, MAXINTENSITY), random.randint(ZEROINTENSITY, MAXINTENSITY))
            #note- we have skipped the last parameter and by default, 0 is taken
     pygame.draw.circle(SCREEN, COLOR, POS, RADIUS)
     pygame.display.update()
Vivacious Vicuña

Réponses similaires à “Comment changer la couleur du carré en pygame avec la basse pression”

Questions similaires à “Comment changer la couleur du carré en pygame avec la basse pression”

Plus de réponses similaires à “Comment changer la couleur du carré en pygame avec la basse pression” dans Python

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code