diff --git a/frontend/models/Entity.ts b/frontend/models/Entity.ts index d7b416b..58d7f99 100644 --- a/frontend/models/Entity.ts +++ b/frontend/models/Entity.ts @@ -51,7 +51,9 @@ abstract class Entity { public abstract update(): void; public draw(): void { + push(); fill(this.fill); rect(this.position.x, this.position.y, this.width, this.height); + pop(); } } diff --git a/frontend/models/Obstacle.ts b/frontend/models/Obstacle.ts index cb79236..d239d5e 100644 --- a/frontend/models/Obstacle.ts +++ b/frontend/models/Obstacle.ts @@ -46,7 +46,6 @@ class Obstacle extends Entity implements Collidable{ } public draw(): void { - noFill(); this.pipeTop.draw(); this.pipeBottom.draw(); } diff --git a/frontend/models/Pipe.ts b/frontend/models/Pipe.ts index caeac69..b19489e 100644 --- a/frontend/models/Pipe.ts +++ b/frontend/models/Pipe.ts @@ -20,6 +20,7 @@ class Pipe extends Entity implements Collidable { } public draw(): void { + push(); image(this.image, this.position.x, this.position.y, this.width, this.height); noFill(); rect( @@ -28,6 +29,7 @@ class Pipe extends Entity implements Collidable { this.width, this.height ); + pop(); } collides(o: Entity): boolean { diff --git a/frontend/models/Raspberry.ts b/frontend/models/Raspberry.ts index 581c0f6..d844175 100644 --- a/frontend/models/Raspberry.ts +++ b/frontend/models/Raspberry.ts @@ -57,9 +57,9 @@ class Raspberry extends Entity { } public draw(): void { + push(); image(this.image, this.position.x, this.position.y, this.width, this.height); noFill(); - strokeWeight(50); if (!this.showHitbox) { noStroke(); } @@ -69,5 +69,6 @@ class Raspberry extends Entity { this.width, this.height ); + pop(); } } \ No newline at end of file