1. indentation is off. KEYUP will never be called in KEYDOWN.
You should check into keys states.
You should check into keys states.
# Keys state. still need pygame.event.get() or pygame.event.pump() before getting states. keyspressed = pygame.key.get_pressed() if keyspressed[pygame.LEFT]: x -=5 if keyspressed[pygame.RIGHT]: x += 5 # etc2. pygame has builtin colors
import pygame print(pygame.color.THECOLORS.keys()) print() print(pygame.Color('red'))
99 percent of computer problems exists between chair and keyboard.