feat(#8): improve performance
This commit is contained in:
parent
32dd2ad599
commit
07c64eadeb
4 changed files with 43 additions and 31 deletions
|
@ -18,22 +18,6 @@ export class MapManagement extends GameObject {
|
|||
});
|
||||
}
|
||||
|
||||
update(delta) {
|
||||
this.gameObjects.forEach((item) => {
|
||||
if (item.selected) {
|
||||
item.update(delta);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
render(ctx) {
|
||||
this.gameObjects.forEach((item) => {
|
||||
if (item.selected) {
|
||||
item.render(ctx);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onMouseClick(elementId) {
|
||||
if (
|
||||
!this.elementsId.includes(elementId) ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue