unibutton/common/game_basic.js

28 lines
593 B
JavaScript
Raw Normal View History

2024-09-29 03:55:22 -04:00
import Player from "./player.js";
class GameBasic {
constructor() {
2024-09-29 03:16:15 -04:00
let player = new Player(false,true);
let entities = [player];
2024-09-29 04:11:47 -04:00
/*for (let i = 0; i < 50; i++) {
2024-09-29 03:16:15 -04:00
entities.push(new Player(false,false))
2024-09-29 04:11:47 -04:00
}*/
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);
}
2024-09-29 03:55:22 -04:00
}
export default GameBasic;