Ejercicio: Ahora utiliza el generador para generar tamaños de paso basados en una distribución normal, con una media de 0 y desviación estándar de 2. Configura adecuadamente las variables en la parte superior y úsalas cuando calcules el tamaño de paso en el método walk.
var generator= new Random(1);
var standardDeviation=2;
var mean=0;
var Walker = function() {
this.x = width/2;
this.y = height/2;
};
Walker.prototype.display = function() {
strokeWeight(3);
stroke(0, 0, 0);
point(this.x, this.y);
};
// Randomly move up, down, left, right, or stay in one place
Walker.prototype.walk = function() {
var xStepSize = standardDeviation *generator+mean;
var yStepSize = standardDeviation *generator+mean;
this.x += xStepSize;
this.y += yStepSize;
};
var w = new Walker();
var draw = function() {
w.walk();
w.display();
};
No consigo resolver var xStepSize Y var yStepSize.