@@ -78,8 +78,12 @@ class BrownGuard extends Enemy {
|
||||
}
|
||||
|
||||
double diff = angle - angleToPlayer;
|
||||
while (diff <= -math.pi) diff += 2 * math.pi;
|
||||
while (diff > math.pi) diff -= 2 * math.pi;
|
||||
while (diff <= -math.pi) {
|
||||
diff += 2 * math.pi;
|
||||
}
|
||||
while (diff > math.pi) {
|
||||
diff -= 2 * math.pi;
|
||||
}
|
||||
|
||||
int octant = ((diff + (math.pi / 8)) / (math.pi / 4)).floor() % 8;
|
||||
if (octant < 0) octant += 8;
|
||||
|
||||
Reference in New Issue
Block a user