Concept
For this project, I created a random walker that moves using dynamic probabilities instead of fixed directions. At every step, the walker makes a decision: it has a 50% chance to move toward the mouse and a 50% chance to move in a random direction. This creates motion that sometimes feels intentional and sometimes unpredictable.
To connect motion to another medium, I mapped movement into color by letting the walker walk through HSB color space. As the walker moves, its hue slowly shifts, leaving a trail of changing colors. This makes the motion visible not only through position, but also through color.
Code Highlight
The part I am most proud of is the simple probability rule that controls the walker’s behavior:
// 50% chance: move toward mouse
if (random(1) < 0.5) {
let target = createVector(mouseX, mouseY);
let dir = p5.Vector.sub(target, pos);
dir.setMag(step);
pos.add(dir);
}
// 50% chance: random move
else {
let angle = random(TWO_PI);
pos.x += cos(angle) * step;
pos.y += sin(angle) * step;
}
With only one small decision, the system creates two very different behaviors: attraction and randomness. This balance makes the motion feel alive without being complicated.
Embedded Sketch
Reflection and Future Work
This project showed me how simple rules can create expressive motion. Even with only two possible choices, the walker feels responsive and unpredictable at the same time. I also liked how color helped reveal the path and rhythm of the movement.
In the future, I would like to change the probability based on the distance to the mouse so the attraction becomes stronger or weaker depending on position. I would also like to add multiple walkers with different behaviors and experiment with Gaussian step sizes to create smoother motion. Another idea is to map movement to sound, such as pitch or stereo pan, instead of color.
Overall, this project helped me understand how probability and interaction can shape motion in simple but interesting ways.