I'm making a pong game to learn more about pygame and than i came on this problem:
keys = pygame.key.get_pressed()
if keys[K_UP]:
y -= 1
if keys[K_DOWN]:
y += 1
It returns "name K_UP is not defined".
All the solutions i found resulted in spaghetti code or extreme lag. Does anyone knows how to solve this?