Sep-29-2017, 02:31 PM
Hey Python Programmers...
I get an script to change the colour of the screen into an other color (screen.fill),
but it doesn't works. This my script:
I try to work with events and keys... but pyGame don't change the screen display of my simple
test...
Can anyone help me to correctivate my code, just i get an example how i can activate an events,
use keys in pyGame ?...
Can anyone help me to correctivate my code ?... The screen settup is good, but the screen will
not change the color... my display screen remains white, but i want activate an event thad makes
the screen red, when you press "SPACE" as key... can anyone give my an code and diffrence examples
how i can activate pyGame Key Events ?...
Thanks for help, Jamie.
I get an script to change the colour of the screen into an other color (screen.fill),
but it doesn't works. This my script:
import pygame import sys screen = pygame.display.set_mode((800,600)) done = False while not done: for event in pygame.event.get(): if event.type == pygame.QUIT: done = True elif event.type == pygame.KEYDOWN: if event.key == pygame.K_ESCAPE: done = True screen.fill((255,255,255)) pygame.display.update() pygame.quit() sys.exit() for event in pygame.event.get(): if event.type == pygame.KEYDOWN: if event.key == pygame.K_SPACE: screen.fill((255,000,000)) pygame.display.update()The seccond for loop must be change the screen to an red colour whenether you press K_SPACE.
I try to work with events and keys... but pyGame don't change the screen display of my simple
test...
Can anyone help me to correctivate my code, just i get an example how i can activate an events,
use keys in pyGame ?...
Can anyone help me to correctivate my code ?... The screen settup is good, but the screen will
not change the color... my display screen remains white, but i want activate an event thad makes
the screen red, when you press "SPACE" as key... can anyone give my an code and diffrence examples
how i can activate pyGame Key Events ?...
Thanks for help, Jamie.