From a645f9e208c2559f8b210fc23062888693ce23b6 Mon Sep 17 00:00:00 2001 From: Fr3deric Date: Sun, 3 Mar 2019 18:46:44 +0100 Subject: [PATCH] fix crown collision check --- baumgen.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/baumgen.js b/baumgen.js index d763702..f1786cf 100644 --- a/baumgen.js +++ b/baumgen.js @@ -75,6 +75,10 @@ class Crown { delete this._path; } } + + collides(other) { + return this._path.intersects(other._path); + } } @@ -172,8 +176,7 @@ class Branch { } collides_crown(other) { - return false; - //return this._crown.intersects(other._crown); + return this.crown.collides(other.crown); } }