Performance optimizations and refacturing.

This commit is contained in:
Mal
2020-02-12 23:30:04 +01:00
parent b06186043f
commit 72589544bd
6 changed files with 138 additions and 26 deletions

View File

@@ -109,7 +109,9 @@ export default class Movable
draw(context, camera)
{
this.animations[this.currentAnimation].setFootPosition(this.position.x, this.position.y);
this.animations[this.currentAnimation].draw(context, camera);
if (camera.isMovableInsideView(this)) {
this.animations[this.currentAnimation].setFootPosition(this.position.x, this.position.y);
this.animations[this.currentAnimation].draw(context, camera);
}
}
}