Browse Source

Shapes appear in the window view all the time now

main
Luke Murphy 4 years ago
parent
commit
0dd497342b
No known key found for this signature in database GPG Key ID: 5E2EF5A63E3718CC
  1. 16
      voicegardens/static/voicegardens.js

16
voicegardens/static/voicegardens.js

@ -216,12 +216,6 @@ class GeneratedShape {
this.accelX = 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.
this.springing = 0.0009;
@ -275,13 +269,19 @@ class GeneratedShape {
this.angle = radians(360 / this.edges);
// ???
this.centerX = random(windowWidth);
this.centerY = random(windowHeight);
this.centerX = random(windowWidth) - toScreenX;
this.centerY = random(windowHeight) - toScreenY;
// new destination for the shapes
this.destX = random(windowWidth);
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();
}

Loading…
Cancel
Save