Shifting positions in spread for each element

i currently try to create a snake version in vvvv and I do it based on p5 example. I now want to shift the positions in my spread for each element.

  this.update = function() {
    for (var i = 0; i < this.tail.length - 1; i++) {
      this.tail[i] = this.tail[i + 1];
    }
...

I have this but i get a spread of spread out of the for each which i kind of understand but don’t know how to fix it :D

Whole code is here
[The Snake Game by codingtrain -p5.js Web Editor](https://p5 sketch)

Thanks for the help. Appreciated

Hello levoxtrip,
there is the node “shift” that do exactly that but its included in the addons pack

1 Like

Oh yeah! Thanks! that helps already but another question comes up then. How do I process each instance of a spread with a node that wants a spread. Because the shift node creates the same Spread of Spread :/

You can use Flatten, or Aggregate, or create a spread builder and pass slices thru accumulator