This video looks at how an object can store a history of positions. This allows you to render the object’s trail while keeping background() in the draw() loop. I look briefly at p5.Vector and createVector() as well as the push() and splice() functions in JavaScript arrays.

Source code:


All JavaScript/p5.js videos:

Help us caption & translate this video!