Only draw frames when necessary

This commit is contained in:
Idrees Hassan
2025-10-28 20:42:08 -04:00
parent 72641cc818
commit a456b2269c
7 changed files with 178 additions and 37 deletions

View File

@@ -125,7 +125,6 @@ export class Birb {
* @returns {boolean} Whether the animation has completed (for non-looping animations)
*/
draw(species) {
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
const anim = this.animations[this.currentAnimation];
return anim.draw(this.ctx, this.direction, this.animStart, this.canvasPixelSize, species);
}