C++17 · SFML 3 · CW208 · Year 4
SNAP-IT

A top-down photography observation game. The player controls a camera viewfinder and photographs NPCs. Each capture advances the narrative, changes the world, and escalates the chaos.

C++17 SFML 3 Strategy Pattern State Machine Phase Manager SETU Carlow
The camera is the only tool. No weapons, no health bar, no combat. Each photograph you take moves the narrative forward and changes how the NPCs behave - from wandering peacefully to flocking, fleeing, and chasing.
5 NPC Behaviours
4 Narrative Phases
4 Design Patterns
60hz Fixed Timestep

What's in it.

Strategy Pattern NPC AI

NPC movement is fully decoupled from the NPC class via a swappable NPCBehaviour interface. Wander, Flee, Flock, AngryNPC (3-state machine), and Journalist behaviours can be assigned at runtime with setBehaviour().

Phase Progression

A dedicated PhaseManager tracks captures and handles all narrative phase logic, completely decoupled from the game loop. The game class only reads the current phase - it never directs it.

Factory Special Entities

createSpecialEntity() uses the Factory Method pattern to construct the correct phase-specific entity. Ownership transfers cleanly via std::unique_ptr. The Game class has no knowledge of construction details.

Composition Architecture

Entities are built from composition, not deep inheritance. NPC owns NPCBehaviour and Animation as components. The abstract Entity base provides shared interface via pure virtual methods.

Photo Capture System

Left-click triggers a shutter flash, SFML View zoom sequence, and AABB intersection check against all NPC bounds in frame. Highlighted NPCs receive a yellow overlay confirming capture. Special entities in frame trigger phase transitions.

Sprite Sheet Animation

The Animation class manages sprite sheet playback at 0.1s per frame across 3 horizontal frames. Visual states (default, hat, scared, angry, screaming) are driven by texture swaps per NPC state change.

What shaped the direction.

The game draws inspiration from observation and reaction mechanics in other titles - specifically the idea that the player's actions are the catalyst for world change, not just a response to it.

Core mechanic reference
Super Mario Party Jamboree
Nintendo - 2024
The photography minigame was part of the inspiration for Snap-It. In that minigame the player must capture NPCs at precisely the right moment, rewarding careful observation. Snap-It extends this idea into a full narrative loop: taking photographs doesn't just score points - it changes the world.
Emergent behaviour reference
Shiffman - The Nature of Code
Daniel Shiffman - 2012
Shiffman's treatment of steering vectors and flocking informed the flocking and emergent behaviour systems. The idea of velocity as an accumulated force vector, normalised before application, is reflected directly in Snap-It's calculateMovement() interface across all behaviour types.
AI architecture reference
Millington - AI for Games
Ian Millington - 2019
The primary technical reference for NPC behaviour design. Millington's kinematic wandering, flee steering, and finite state machine overview informed the wander, flee, and AngryNPCBehaviour implementations directly - including the timer-driven cyclic state transitions in the AngryNPC's Chasing / Screaming / Wandering cycle.

Sections.