# Figure that returns to its initial position (walkers)

**URL:** <https://discourse.processing.org/t/figure-that-returns-to-its-initial-position-walkers/29670>\
**Category:** Coding Questions\
**Created:** [April 27, 2021, 1:04am UTC](https://discourse.processing.org/t/figure-that-returns-to-its-initial-position-walkers/29670 "2021-04-27T01:04:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kylu](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@kylu](https://discourse.processing.org/u/kylu)\
**Post date:** [April 27, 2021, 1:04am UTC](https://discourse.processing.org/t/figure-that-returns-to-its-initial-position-walkers/29670/1 "2021-04-27T01:04:54Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![jb4x](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jb4x/32/789_2.png) [@jb4x](https://discourse.processing.org/u/jb4x)\
**Post date:** [April 27, 2021, 8:43am UTC](https://discourse.processing.org/t/figure-that-returns-to-its-initial-position-walkers/29670/2 "2021-04-27T08:43:30Z")

</div>

Hi,

Can you show us what you got so far?

---

<div class="post-metadata">

**Author:** ![kylu](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@kylu](https://discourse.processing.org/u/kylu)\
**Post date:** [April 27, 2021, 5:33pm UTC](https://discourse.processing.org/t/figure-that-returns-to-its-initial-position-walkers/29670/3 "2021-04-27T17:33:46Z")

</div>

yes!

> **[lukhoury/tecnomultimedia](https://github.com/lukhoury/tecnomultimedia/tree/walkers)**
>
> walkers

there’s the code, thanks!

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [April 27, 2021, 6:34pm UTC](https://discourse.processing.org/t/figure-that-returns-to-its-initial-position-walkers/29670/4 "2021-04-27T18:34:36Z")

</div>

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! 😉

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 :

[![](https://img.youtube.com/vi/mhjuuHl6qHM/maxresdefault.jpg "Coding Challenge #124: Flocking Simulation") ](https://www.youtube.com/watch?v=mhjuuHl6qHM)

[![](https://img.youtube.com/vi/IoKfQrlQ7rA/maxresdefault.jpg "6.8: Combining Steering Behaviors: Flocking - The Nature of Code") ](https://www.youtube.com/watch?v=IoKfQrlQ7rA)

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` :

> **[PVector / Reference](https://processing.org/reference/pvector)**
>
> A class to describe a two or three dimensional vector, specifically a Euclidean (also known as geometric) vector. A vector is an entity that has both magnitude and direction. The datatype, however, st…

And the tutorial :

> **[PVector](https://processing.org/tutorials/pvector/)**
>
> An introduction to useing the PVector class in Processing.

---

<div class="post-metadata">

**Author:** ![kylu](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@kylu](https://discourse.processing.org/u/kylu)\
**Post date:** [April 27, 2021, 7:27pm UTC](https://discourse.processing.org/t/figure-that-returns-to-its-initial-position-walkers/29670/5 "2021-04-27T19:27:22Z")

</div>

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