|
@ -216,12 +216,6 @@ class GeneratedShape { |
|
|
this.accelX = 0.0; |
|
|
this.accelX = 0.0; |
|
|
this.accelY = 0.0; |
|
|
this.accelY = 0.0; |
|
|
|
|
|
|
|
|
// The x, y destination values which the shape moves towards. This can be
|
|
|
|
|
|
// calculated against the `mouseX` and `mouseY` values, for example. Then
|
|
|
|
|
|
// the shape will follow the mouse.
|
|
|
|
|
|
this.deltaX = 0.0; |
|
|
|
|
|
this.deltaY = 0.0; |
|
|
|
|
|
|
|
|
|
|
|
// The speed at which the shape 'springs' towards its final destination.
|
|
|
// The speed at which the shape 'springs' towards its final destination.
|
|
|
this.springing = 0.0009; |
|
|
this.springing = 0.0009; |
|
|
|
|
|
|
|
@ -275,13 +269,19 @@ class GeneratedShape { |
|
|
this.angle = radians(360 / this.edges); |
|
|
this.angle = radians(360 / this.edges); |
|
|
|
|
|
|
|
|
// ???
|
|
|
// ???
|
|
|
this.centerX = random(windowWidth); |
|
|
this.centerX = random(windowWidth) - toScreenX; |
|
|
this.centerY = random(windowHeight); |
|
|
this.centerY = random(windowHeight) - toScreenY; |
|
|
|
|
|
|
|
|
// new destination for the shapes
|
|
|
// new destination for the shapes
|
|
|
this.destX = random(windowWidth); |
|
|
this.destX = random(windowWidth); |
|
|
this.destY = random(windowHeight); |
|
|
this.destY = random(windowHeight); |
|
|
|
|
|
|
|
|
|
|
|
// The x, y destination values which the shape moves towards. This can be
|
|
|
|
|
|
// calculated against the `mouseX` and `mouseY` values, for example. Then
|
|
|
|
|
|
// the shape will follow the mouse.
|
|
|
|
|
|
this.deltaX = this.destX - this.centerX - toScreenX; |
|
|
|
|
|
this.deltaY = this.destY - this.centerY - toScreenY; |
|
|
|
|
|
|
|
|
this.initialise(); |
|
|
this.initialise(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|