unibutton/common/game_basic.js

24 lines
No EOL
510 B
JavaScript

class GameBasic {
constructor() {
let player = new Player(true);
let entities = [player];
for (let i = 0; i < 50; i++) {
entities.push(new Player())
}
this.player = player;
this.entities = entities;
}
main() {
let { entities } = this;
for (let ent of entities) {
ent.handleTick(this);
}
}
init() {
let that = this;
setInterval(function () { that.main() }, 1000 / 60);
}
}