feat(#10): reset camera position after changing level

This commit is contained in:
Juan Sebastián Montoya 2024-09-14 23:51:24 -05:00
parent e2c439d1f3
commit abf334607e
6 changed files with 47 additions and 2 deletions

View file

@ -27,6 +27,11 @@ export class Camera extends GameObject {
(acc, item) => ({ ...acc, [item.key]: item }),
{}
);
this.eventEmitter.on("changeLevel", () => {
this.x = x;
this.y = y;
this.moveCamera(0, 0, 0);
});
}
update(delta) {