diff options
author | Nat Lasseter <Nat Lasseter nathan@bytemark.co.uk> | 2017-06-29 10:57:11 +0100 |
---|---|---|
committer | Nat Lasseter <Nat Lasseter nathan@bytemark.co.uk> | 2017-06-29 10:57:11 +0100 |
commit | 66d0a0b2e2531b61ef513b68c41128aa2df4a95e (patch) | |
tree | 3b9c2e162fa57b1b4c02058e0e4f09794d8c8bd2 /sketch.js | |
parent | 8273006bf3923acf35490e2fa35e8da437cc5751 (diff) |
Diffstat (limited to 'sketch.js')
-rw-r--r-- | sketch.js | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -32,6 +32,11 @@ function draw() { ps[i].reflect(createVector(0.25*wid, -0.25*hei), 5); } + for(var j = ps.length - 1; j >= 0; j--) { + if(i != j && ps[i].collide(ps[j])) + console.log("COLLIDE" + ps[i] + ps[j]); + } + if (ps[i].pos.y >= hei) ps.splice(i, 1); } |