I want to use a for loop to move a drawing between two points. However the loop is too fast to see all the positions. So I am trying to insert a pause in the loop but it doesn't work. Is there any solution compatible with a for loop ?
Thank you in advance.
Circle moving between two points chosen among a set of random ones
Without even looking at your code, this sounds like a classic problem; you're working under the assumption that anything in draw() is drawn automatically. Instead, however, the canvas is only updated at the end; you are effectively displaying only the last position.
You have to split it up across several frames (probably with an incremental variable)...