significant optimzations
This commit is contained in:
parent
3ce6ded308
commit
37b516faee
5 changed files with 71 additions and 20 deletions
|
@ -13,6 +13,10 @@ class NPC {
|
|||
this.type = 'NPC';
|
||||
|
||||
this.immortal = true;
|
||||
|
||||
this.serverProps = [
|
||||
'type', 'pos','vel','you','immortal'
|
||||
];
|
||||
}
|
||||
handleTick(game) {
|
||||
let { entities } = game;
|
||||
|
|
|
@ -26,11 +26,19 @@ class Player {
|
|||
this.isMenu = false;
|
||||
|
||||
this.r = 1;
|
||||
|
||||
this.serverProps = [
|
||||
'type', 'camera','pos','vel','rot','dir','ticks','health','you','isPlayer','headCount','isMenu','r'
|
||||
];
|
||||
|
||||
this.legalProps = [
|
||||
'vel','dir','camera','ticks','isMenu','r'
|
||||
];
|
||||
}
|
||||
bump() {
|
||||
let player = this;
|
||||
|
||||
if (player.ticks < 7) {
|
||||
if (player.ticks < 15) {
|
||||
player.dir *= -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue