From bea077d5a231093dc4cd4fef31ec9b01dfff4cf0 Mon Sep 17 00:00:00 2001 From: Luke Murphy Date: Wed, 12 Feb 2020 20:21:38 +0100 Subject: [PATCH] Remove lastCollidedShape tracking --- voicegardens/static/voicegardens.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/voicegardens/static/voicegardens.js b/voicegardens/static/voicegardens.js index 33cccef..8c369ba 100644 --- a/voicegardens/static/voicegardens.js +++ b/voicegardens/static/voicegardens.js @@ -282,9 +282,6 @@ class GeneratedShape { this.destX = random(windowWidth); this.destY = random(windowHeight); - // the shape that was last collided with - this.lastCollidedShape; - this.initialise(); } @@ -324,7 +321,7 @@ class GeneratedShape { for (let i = 0; i < shapes.length; i++) { let shape = shapes[i]; - if (this === shape || this.lastCollidedShape === shape) { + if (this === shape) { continue; } @@ -338,7 +335,6 @@ class GeneratedShape { ); if (collision === true) { - this.lastCollidedShape = shape; return [true, shape]; } } @@ -528,9 +524,6 @@ function draw() { if (positionTick) { shape.destX = random(windowWidth); shape.destY = random(windowHeight); - - // also reset last collided shape - shape.lastCollidedShape = undefined; } shape.draw();