How do I make an object spawned from the edge of the map follow a diagonal line towards the middle?

I’ve been stuck on trying to make my object follow a diagonal line towards the middle without lots of lag. I’ve only been able to create a robust path for the object, making only right, left, up or down movements. while running: pygame.draw.rect(screen,(0,0,0),(0,0,width,height)) hero() ewaste() if distance(ex,ey,(width//2),(height//2)) != 0: (dx,dy) = ((x – ex)/math.sqrt((x -…

Details