import { BaseZoneScene } from './BaseZoneScene.js?v=20260427c';
import { dominantDirection } from '../systems/behavioral.js?v=20260427c';
import { ZONE_DEFINITIONS } from '../systems/session.js?v=20260427c';
export class Zone4Scene extends BaseZoneScene {
constructor() {
super('Zone4Scene', ZONE_DEFINITIONS[3]);
}
buildHorizontalLevel() {
super.buildHorizontalLevel();
for (let x = 640; x < this.levelWidth - 240; x += 380) {
const top = 120 + (x % 3) * 40;
this.add.rectangle(x, top, 1, this.scale.height - 230, 0x61f3ff, 0.28);
this.add.circle(x, top + 80, 8, 0x61f3ff, 0.65);
}
}
spawnZoneThreats(time) {
if (!this.nextPredictionAt) this.nextPredictionAt = time + 1800;
if (time < this.nextPredictionAt) return;
this.nextPredictionAt = time + 1900;
const direction = dominantDirection(this.session);
const ahead = direction === 'left' ? 145 : direction === 'right' ? 230 : 185;
const x = this.player.sprite.x + ahead;
const y = Math.max(120, Math.min(this.scale.height - 160, this.player.sprite.y - 45));
const wall = this.add.rectangle(x, y, 28, 130, 0xffffff, 0.75);
this.hazards.add(wall);
wall.body.setSize(28, 130);
this.algorithm.say(`I notice you prefer ${direction}. Optimizing the path.`);
}
zonePrompts() {
return [
{
at: 8,
key: 'Enable personalization',
title: 'Enable personalization?',
copy: 'Let the experience adapt to you. Platforms, prompts, and obstacles may become more relevant.',
accept: 'Enable',
decline: 'Keep default',
onAccept: () => {
this.session.flags.personalized = true;
this.session.currencies.cookies += 45;
this.algorithm.say('Thank you. Your defaults have been replaced with destiny.');
},
},
];
}
}