reduce number of npcs because of lag
This commit is contained in:
parent
e1d5131789
commit
2e524c5c8c
1 changed files with 3 additions and 3 deletions
6
game.js
6
game.js
|
@ -199,15 +199,15 @@ class Game extends GameBasic {
|
|||
let that = this;
|
||||
that.entities = [];
|
||||
|
||||
for (let i = 0; i < 20; i++) {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
that.entities.push(new NPC(false, that))
|
||||
}
|
||||
|
||||
for (let i = 0; i < 35; i++) {
|
||||
for (let i = 0; i < 10; i++) {
|
||||
that.entities.push(new Shooter(false, that))
|
||||
}
|
||||
|
||||
setInterval(function () { that.sync(false) }, 1000 / 5);
|
||||
setInterval(function () { that.sync(false) }, 1000 / 10);
|
||||
setInterval(function () { that.sync(true) }, 1000);
|
||||
setInterval(function () { that.clean() }, 1000);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue