[Python] Pygame screen.fill() not filling up the color properly

Discussão em 'Python' iniciado por Stack, Janeiro 29, 2025.

  1. Stack

    Stack Membro Participativo

    I've just started learning Pygame . I'm following this tutorial. I ran the following program but it shows black color instead of blue :

    import pygame

    h = input("Enter the height of the window : ")
    w = input("Enter the width of the window : ")
    screen = pygame.display.set_mode((w,h))

    running = True
    while running:
    event = pygame.event.poll()
    if event.type == pygame.QUIT:
    running=0

    screen.fill((0,0,1))
    pygame.display.flip()

    Continue reading...

Compartilhe esta Página