Phase 3: AR hunt /hunt + launch page /play - shared-visual ghosts, colour lure, hauntometer
This commit is contained in:
+4
-2
@@ -24,7 +24,9 @@ const COLORS = ['Red', 'Blue', 'Yellow'];
|
||||
export function createHunt(THREE, scene, opts = {}) {
|
||||
const roster = opts.roster || [];
|
||||
const maxActive = opts.maxActive ?? 4;
|
||||
const spawnArcDeg = opts.spawnArcDeg ?? 120; // ±60°
|
||||
const spawnArcDeg = opts.spawnArcDeg ?? 90; // ±45° — tighter so ghosts land in front
|
||||
const fleeMinMs = opts.fleeMinMs ?? 12000; // longer discovery window
|
||||
const fleeMaxMs = opts.fleeMaxMs ?? 18000;
|
||||
const onEvent = opts.onEvent || (() => {});
|
||||
|
||||
let luredColor = null; // set by the colour wheel
|
||||
@@ -77,7 +79,7 @@ export function createHunt(THREE, scene, opts = {}) {
|
||||
active.set(id, {
|
||||
ghost: g, visual, hp, maxHp: hp,
|
||||
state: 'idle',
|
||||
fleeAt: performance.now() + (6000 + Math.random() * 4000), // escapes if ignored
|
||||
fleeAt: performance.now() + (fleeMinMs + Math.random() * (fleeMaxMs - fleeMinMs)), // escapes if ignored
|
||||
});
|
||||
haunt = Math.min(100, haunt + 4); // presence raises the meter
|
||||
onEvent({ type: 'spawn', id, ghost: g, haunt });
|
||||
|
||||
Reference in New Issue
Block a user