significant optimzations

This commit is contained in:
biglyderv 2024-11-25 14:14:20 -05:00
parent 3ce6ded308
commit 37b516faee
5 changed files with 71 additions and 20 deletions

View file

@ -13,6 +13,10 @@ class NPC {
this.type = 'NPC';
this.immortal = true;
this.serverProps = [
'type', 'pos','vel','you','immortal'
];
}
handleTick(game) {
let { entities } = game;

View file

@ -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;
}