Add maze mini-boss and rebalance progression
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import type { Game } from './Game';
|
||||
import { Ghost } from './Ghost';
|
||||
|
||||
const ACTIVATE_RADIUS = 8;
|
||||
|
||||
// Labyrinth-Wächter: steht still am Wegpunkt und greift erst an,
|
||||
// wenn der Spieler in die Nähe kommt.
|
||||
export class MazeGuard extends Ghost {
|
||||
private activated = false;
|
||||
|
||||
protected chase(dt: number, game: Game) {
|
||||
if (!this.activated) {
|
||||
const dx = game.player.body.position.x - this.body.position.x;
|
||||
const dz = game.player.body.position.z - this.body.position.z;
|
||||
if (Math.hypot(dx, dz) < ACTIVATE_RADIUS) {
|
||||
this.activated = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
super.chase(dt, game);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user