Trigger core loop events from world movement. Connect space to risk.
Location + Probability = Event. Now we connect the zones from last week to game events. Being in a dangerous area creates a chance of something happening. The world is no longer passive — it reacts to where the player is standing.
When the player is in the Manhattan (danger) zone, there is a small percentage chance per second to trigger an encounter. The higher the risk level, the more likely an encounter fires. For now, an encounter is just a console message — no UI yet.
When standing on a buildable lot, the player can press "E" to accept a job. Each job appears with a cost (materials needed), a payout (karma earned), and a simulated time to complete. Jobs are the economic trigger — without accepting one, nothing happens.
The triggerEncounter() function creates an encounter and stores it in game state:
The createJob() function generates a job offer:
Store the active event in gameState:
Walking in the danger zone eventually triggers an encounter. Standing on a lot generates a job. Both events appear in the console.
No animations. No UI panels yet. Console output only.
Encounter triggering every frame — use a timer or cooldown so encounters don't fire 60 times per second.
Job generating without being on a lot — always check zone before creating a job.
Not clearing the previous event before creating a new one — check gameState.activeEvent before firing a new trigger.
This is where the world comes alive. The connection between space (Day 9-10) and events (today) is the core architectural insight. The player's position in the world now has consequences — that's what makes a game feel real. Ask: "Why must events be triggered by space?"