more performance fixes

This commit is contained in:
Anton Lavrenov
2020-06-23 17:22:28 -05:00
parent 4a776910ec
commit d62645609d
7 changed files with 1385 additions and 82 deletions

View File

@@ -93,6 +93,8 @@
x: 10,
y: 10,
perfectDrawEnabled: false,
width: wabbitTexture.width,
height: wabbitTexture.height,
});
bunny.speedX = Math.random() * 10;
@@ -101,7 +103,22 @@
bunnys.push(bunny);
layer.add(bunny);
}
layer.draw();
// layer.draw();
// console.clear();
// bunnys.forEach((b) => {
// b.position({
// x: Math.random() * window.innerWidth,
// y: Math.random() * window.innerHeight,
// });
// });
// layer.draw();
// bunnys.forEach((b) => {
// b.position({
// x: Math.random() * window.innerWidth,
// y: Math.random() * window.innerHeight,
// });
// });
// layer.draw();
}
function onTouchStart(event) {
@@ -124,6 +141,8 @@
x: 0,
y: 0,
perfectDrawEnabled: false,
width: wabbitTexture.width,
height: wabbitTexture.height,
});
bunny.speedX = Math.random() * 10;
bunny.speedY = Math.random() * 10 - 5;