movement = function (ctx, resolution, cell, t) {
let x = cell.x + resolution / 2;
let y = cell.y + resolution / 4;
if (t > 0.5) {
x = randomIntFromInterval(cell.x, cell.x + resolution);
y = randomIntFromInterval(cell.y, cell.y + resolution);
} else if (t > 0.35) {
let padding = resolution / 2.7;
x = randomIntFromInterval(cell.x + padding, cell.x + resolution - padding);
y = randomIntFromInterval(cell.y + padding, cell.y + resolution - padding);
} else if (t > 0.25) {
let padding = resolution / 2.5;
x = randomIntFromInterval(cell.x + padding, cell.x + resolution - padding);
y = randomIntFromInterval(cell.y + padding, cell.y + resolution - padding);
} else if (t > 0.15) {
let padding = resolution / 2.3;
x = randomIntFromInterval(cell.x + padding, cell.x + resolution - padding);
y = randomIntFromInterval(cell.y + padding, cell.y + resolution - padding);
} else if (t > 0) {
let padding = resolution / 2.1;
x = randomIntFromInterval(cell.x + padding, cell.x + resolution - padding);
y = randomIntFromInterval(cell.y + padding, cell.y + resolution - padding);
}
ctx.beginPath();
ctx.arc(x, y, resolution / 5, 0, 2 * Math.PI);
ctx.fillStyle = "black";
ctx.fill();
}