xxxxxxxxxx
let xoff;
let yoff = 0;
let cells = [];
let position;
let velocity;
function setup() {
createCanvas(windowWidth, windowHeight);
background(100);
for(i = 0; i < width; i ++){
cells[i] = [];
xoff = 0;
for(j = 0; j < height; j ++){
let theta = map(noise(xoff,yoff),0,1,0,TWO_PI);
cells[i][j] = createVector(cos(theta),sin(theta));
}
yoff += 0.1;
}
}
function draw() {
position = createVector(200, 200);
velocity = cells[position.x][position.y];
position.add(velocity);
ellipse(position.x,position.y,30);
}