GKChallenge of bounce to-fro: modify in update() method if(this.x===0){ this.count--; } if(this.x===canvas.width){ this.count++; } if(this.count===0){ this.x += this.speedX; this.y += this.speedY; } else{ this.x -= this.speedX; this.y -= this.speedY; } initially count is supposed to be 1Comment·Article·Apr 8, 2022·02 Game Loops
GKThank you bro<3Reply·Article·Aug 15, 2021·Learn How Laravel Facade Works By Building Your Own Facade