I have placed a condition that if person moves to the right draw a line. code:
if event.key == pygame.K_RIGHT: personX_change = 1