From ad286983b58442721f4b805cb24b98156bb0a6b5 Mon Sep 17 00:00:00 2001 From: Eduardo Russo Date: Sun, 25 Dec 2022 07:13:13 +0000 Subject: [PATCH] Fixed howManyNeeded howManyNeeded was howManyNedeed --- pipe.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pipe.js b/pipe.js index f67f086..39aadae 100644 --- a/pipe.js +++ b/pipe.js @@ -45,13 +45,13 @@ class Pipe { } drawHalf() { - let howManyNedeed = 0; + let howManyNeeded = 0; let peakRatio = pipePeakSprite.height / pipePeakSprite.width; let bodyRatio = pipeBodySprite.height / pipeBodySprite.width; //this way we calculate, how many tubes we can fit without stretching - howManyNedeed = Math.round(height / (this.w * bodyRatio)); + howManyNeeded = Math.round(height / (this.w * bodyRatio)); //this <= and start from 1 is just my HACK xD But it's working - for (let i = 0; i < howManyNedeed; ++i) { + for (let i = 0; i < howManyNeeded; ++i) { let offset = this.w * (i * bodyRatio + peakRatio); image(pipeBodySprite, -this.w / 2, offset, this.w, this.w * bodyRatio); }