Initial Code, from last week’s random walk neon lines

In the initial code, basic variables x and y are used to represent position, requiring separate management for each coordinate.

https://editor.p5js.org/yc4351/sketches/7k_ZAt8rz

Week 2 Iteration: Using Vectors

In the initial code, basic variables x and y are used to represent position, requiring separate management for each coordinate.

Using createVector(), ppl can play with position, velocity, acceleration, etc., into a single entity.

Vector did improve code readability, also make it easier to try other physics.

https://editor.p5js.org/yc4351/sketches/g5Vi88OPi

Speed:

In the initial code, speed control was achieved by directly changing the position using a fixed step size (stepSize). Each update simply added a randomly selected step to the coordinates.

After vector:

Glow effect: same logic, but using vector

Iteration 2:

I was trying to making flashes but haven’t finished yet!

WIP⬇️