power up boss adjustments

This commit is contained in:
landgreen
2020-08-04 15:27:32 -07:00
parent 07f77e41a5
commit d13b1fb16d
8 changed files with 56 additions and 79 deletions

View File

@@ -306,20 +306,6 @@ const mobs = {
}
}
},
seePlayerByDistAndLOS() {
if (!(game.cycle % this.seePlayerFreq)) {
if (
this.distanceToPlayer2() < this.seeAtDistance2 &&
Matter.Query.ray(map, this.position, this.mechPosRange()).length === 0 &&
Matter.Query.ray(body, this.position, this.mechPosRange()).length === 0 &&
!mech.isStealth
) {
this.foundPlayer();
} else if (this.seePlayer.recall) {
this.lostPlayer();
}
}
},
isLookingAtPlayer(threshold) {
const diff = Vector.normalise(Vector.sub(player.position, this.position));
//make a vector for the mob's direction of length 1