Figure that returns to its initial position (walkers)

Hi! I have a question, I am working with a walking code and I need the lines that are formed, after a certain time, to progressively return to their initial position. Thanks!


Can you show us what you got so far?


there’s the code, thanks!

Hi @kylu,

In the branch you sent, your processing code is mixed with other branches with pure Javascript and web related stuff. Also if I open caminantes.pde, Processing warn me that it needs to be in a folder called caminantes.

So this is not ideal, you should refactor your GitHub repository / create a new one so we can properly test your project! :wink:

I managed to open the t2caminantes.pde by putting all the files in a folder but I think that you should look at the Boids and Flocking bird tutorials of the Coding Train :

Also you should look at vectors in order to store the location, direction (speed, acceleration) of your walkers. In Processing, the helpful class is PVector :

And the tutorial :

ohhh, you’re right about the branch, i’m going to change that, thanks tell me :slight_smile:
and thanks for the recomendation about the code

1 Like