Week 13 — Nov 17 — Ex 9: Curves & Locks · GDD due

Exercise: Ex 9 — Curves & Locks. Health, score, a difficulty ramp, and one lock-and-key puzzle.

Also due: the Game Design Doc (10 pts, Canvas), expanding the One Sheet into mechanics, levels, UI, asset list, and scope. It's homework, not class time, but expect questions about it during lab.

Lecture topics, expanded

Health and Score events. The helper library's Health and Score components expose events (damage taken, death, score changed, high score beaten) rather than requiring other scripts to poll them every frame — the same event-driven pattern from TriggerZone and GameStateManager, now applied to the numbers that make a game feel like it has stakes. A HUD element that updates via a subscribed event stays correct automatically; one that polls in Update() is one refactor away from silently going stale.

Spawner/ObjectPool and difficulty ramps. Spawner on a timer or wave pattern, paired with ObjectPool so spawning a hundred enemies over a level doesn't mean a hundred Instantiate/Destroy calls. The design layer on top: a difficulty curve is a schedule of spawn-rate and enemy-mix changes over time, not a single global "difficulty" number — worth sketching as an actual curve on the whiteboard, ramp up, plateau, spike, before anyone touches the Spawner's Inspector fields.

Classes and inheritance for lock-and-key logic. The lightest possible touch of object-oriented structure: a base Lock class checked by any number of Key types, or a PickupBase that Key, Coin, and PowerUp all extend. This is intentionally the first and only place inheritance gets taught directly — most of the semester's modularity comes from composition (components on a GameObject) rather than class hierarchies, and it's worth naming that contrast explicitly.

Connecting it forward

No milestone lands this week, but Ex 9's balance and puzzle work is the last new system before Ex 10's playtesting pass — which means whatever's undertuned here (a spike too sudden, a lock-and-key puzzle that's more confusing than challenging) is exactly what next week's playtesters will surface. Students should leave today thinking of Ex 9 as raw material for a playtest, not a finished feature.