I`m trying to recreate pong using python/pygame but I got stuck on the player movement. Whenever the 2 players are moving at the same time, they will lag or even stop moving.
I think this has to do with the way I read keyboard key inputs I have tried to change it several times but still no success.
while run1v1:
clock.tick(60)
window.fill((black))
for event in pg.event.get():
keys = pg.key.get_pressed()
playerposY += (keys[pg.K_s] - keys[pg.K_w]) * speed
player2posY += (keys[pg.K_DOWN] - keys[pg.K_UP]) * speed