feat(#8): fix 2d camera support
This commit is contained in:
parent
07c64eadeb
commit
c1fe3acc11
5 changed files with 103 additions and 36 deletions
|
@ -28,9 +28,15 @@ export class GameObject {
|
|||
});
|
||||
}
|
||||
|
||||
render(ctx) {
|
||||
render(ctx, ...args) {
|
||||
this.gameObjects.forEach((item) => {
|
||||
item.render(ctx);
|
||||
item.render(ctx, ...args);
|
||||
});
|
||||
}
|
||||
|
||||
onKeyPressed(key) {
|
||||
this.gameObjects.forEach((item) => {
|
||||
item.onKeyPressed(key);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue