I wrote this lines of code:
if event.type == pygame.KEYDOWN: if event.key == pygame.K_LEFT: PlayerX_change = -0.3 if event.key == pygame.K_RIG