add enemy
This commit is contained in:
parent
276e11fb49
commit
edd005cb4d
7 changed files with 137 additions and 10 deletions
5
game.js
5
game.js
|
@ -1,5 +1,6 @@
|
|||
import GameBasic from "./common/game_basic.js";
|
||||
import NPC from "./common/npc.js";
|
||||
import Shooter from "./common/shooter.js";
|
||||
|
||||
import initDb from './db.js';
|
||||
|
||||
|
@ -102,6 +103,10 @@ class Game extends GameBasic {
|
|||
that.entities.push(new NPC(false,that))
|
||||
}
|
||||
|
||||
for (let i = 0; i < 30; i++) {
|
||||
that.entities.push(new Shooter(false,that))
|
||||
}
|
||||
|
||||
setInterval(function () { that.sync(false) }, 1000 / 10);
|
||||
setInterval(function () { that.sync(true) }, 1000);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue