Phase by phase.

The PhaseManager controls all phase logic, completely decoupled from the Game class. The game loop only calls onCaptureOccurred() and reads the current phase. All thresholds, entity spawning, and world changes are internal to PhaseManager.

01

Introduction Active

Game starts with all NPCs assigned the WanderBehavior. There are no special entities. Potatoes and Fennels coexist peacefully. The player can observe the world and begin taking photographs to accumulate captures toward the first threshold.

02

FirstCapture Active

Triggered when the Peaceful SpecialEntity is photographed. A percentage of NPCs receive hat sprites. NPCs without hats that are within a defined radius of a hat-wearing NPC are assigned the FleeBehavior with a direction vector pointing away from the nearest hat-wearer. The world visually divides for the first time.

03

Tension Active

Triggered when the AngryNPC SpecialEntity is photographed. Two leaders are designated - one for hat-wearing NPCs, one for normal NPCs. Remaining NPCs are assigned FlockBehavior and interpolate their velocity toward their respective leader's direction. The AngryNPC begins its internal Chasing cycle, targeting hat-wearers.

04

Escalation / Ending Active

Triggered when the Journalist SpecialEntity is photographed. m_waitingForGameOver is set. Once the NPCReaction state completes displaying the ending caption, a black screen is shown for five seconds, then the game resets to the main menu.

The phase triggers.

Special entities are unique NPCs introduced by PhaseManager once a capture threshold is met. They move using the same NPCBehaviour system as regular NPCs. Photographing one advances the current phase. Once photographed, markForRemoval() is called and the entity is cleaned up at the start of the next update.

Peaceful Entity

Assigned WanderBehavior. NPCs within 150px of the peaceful entity are assigned IdleBehavior, reacting to its presence. Once outside the radius, they return to their current phase behaviour. Photographing it triggers FirstCapture.

Type: SpecialEntityType::Peaceful

AngryNPC Entity

Assigned AngryNPCBehavior - the three-state machine (Chasing, Screaming, Wandering). Targets hat-wearing NPCs. Its sprite switches between the angry sheet during chase/wander and the screaming sheet during the screaming state. Photographing it triggers Tension.

Type: SpecialEntityType::AngryNpc

Journalist Entity

Assigned JournalistBehavior - two-state machine (Wandering, Idle). Swaps sprite between FennelHatSpriteSheet when wandering and JournalistNPCSpriteSheet when idle. Photographing the Journalist ends the game.

Type: SpecialEntityType::Journalist

What changes and when.

Each phase transition produces visible, observable changes in the world - both visually through sprite swaps and behaviourally through strategy pattern reassignment. The pacing is player-driven: frequent photographs progress the narrative faster.

Introduction → FirstCapture

Trigger: Peaceful entity photographed

A percentage of NPCs receive hat sprites. NPCs without hats near a hat-wearer are assigned FleeBehavior. The world divides visually for the first time - hat faction vs non-hat faction.

FirstCapture → Tension

Trigger: AngryNPC entity photographed

Two faction leaders designated. Remaining NPCs assigned FlockBehavior pointing toward their leader. AngryNPC entity spawns and begins its Chasing/Screaming/Wandering cycle targeting hat-wearers.

Tension → Escalation

Trigger: Journalist entity photographed

m_waitingForGameOver is set. The game enters the ending phase. NPCReaction state displays the final caption sequence before returning to main menu.

Proximity Behaviour

Continuous - all phases

checkNPCsNearSpecialEntity() assigns IdleBehavior when an NPC enters the peaceful entity's radius, restoring previous behavior on exit. checkNPCsNearHatWearers() continuously reassigns FleeBehavior to non-hat NPCs in range.