Phase 3: AR hunt /hunt + launch page /play - shared-visual ghosts, colour lure, hauntometer

This commit is contained in:
2026-06-23 11:19:47 +10:00
parent 6a5fb9d8c6
commit a6c45437c3
2 changed files with 15 additions and 12 deletions
+4 -2
View File
@@ -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 });