feat(#10): reset camera position after changing level
This commit is contained in:
parent
e2c439d1f3
commit
abf334607e
6 changed files with 47 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue