“Como mudar a cor do quadrado em pygame com KeyPress” Respostas de código

Como mudar a cor do quadrado em pygame com KeyPress

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

Como mudar a cor do quadrado em pygame com KeyPress

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

Respostas semelhantes a “Como mudar a cor do quadrado em pygame com KeyPress”

Perguntas semelhantes a “Como mudar a cor do quadrado em pygame com KeyPress”

Mais respostas relacionadas para “Como mudar a cor do quadrado em pygame com KeyPress” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código