game
The world-component that owns the entire "Godzilla in San Francisco" game: run state machine (menu → map select → playing → paused → results), all zui screens (via `godzilla.gameui` tree builders), zinput handling, the third-person kaiju camera, every ability (claw / grab+throw /…
godzilla.game
The world-component that owns the entire "Godzilla in San Francisco" game:
run state machine (menu → map select → playing → paused → results), all zui
screens (via godzilla.gameui tree builders), zinput handling, the third-person
kaiju camera, every ability (claw / grab+throw / stomp / tail sweep / roar /
atomic breath / frenzy), the military spawner + per-kind AI + projectiles,
score / combo / threat / survival timer, audio triggers (via godzilla.sfx),
and persistence (/zero/source/godzilla/save/progress.json).
Mount exactly one instance in the scene (entity GameRoot in scenes.main).
Gameplay runs in play mode; edit mode leaves the world untouched for authoring.
Controls: WASD move · mouse look · LMB claw · RMB grab/throw · Space stomp · Q tail sweep · R roar · F atomic breath (hold) · Shift frenzy (rage full) · Esc pause.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2godzilla.game — the world-component for "Godzilla in San Francisco". Run state machine, input, camera, abilities, military AI, score/threat, all zui screens, audio triggers, persistence. See README.md.
clamp(v: ?, lo: ?, hi: ?) → void
Small math helpers
| arg | type | description |
|---|---|---|
| v | ? | |
| lo | ? | |
| hi | ? |
dist2d(ax: ?, az: ?, bx: ?, bz: ?) → void
| arg | type | description |
|---|---|---|
| ax | ? | |
| az | ? | |
| bx | ? | |
| bz | ? |
dist3(a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? |
mulQuat(a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? |
quatYawPitch(yaw: ?, pitch: ?) → void
| arg | type | description |
|---|---|---|
| yaw | ? | |
| pitch | ? |
lookQuat(dir: ?) → void
Quaternion that points local -Z along dir.
| arg | type | description |
|---|---|---|
| dir | ? |
camForward( ) → void
defaultSave( ) → void
Persistence
loadSave( ) → void
persist( ) → void
ensureFx( ) → void
burst(emitter: ?, pos: ?, n: ?) → void
| arg | type | description |
|---|---|---|
| emitter | ? | |
| pos | ? | |
| n | ? |
shake(amount: ?) → void
| arg | type | description |
|---|---|---|
| amount | ? |
beamMatName( ) → void
setBeamVisible(on: ?, from: ?, to: ?) → void
| arg | type | description |
|---|---|---|
| on | ? | |
| from | ? | |
| to | ? |
pushTicker(text: ?) → void
Score / combo / threat
| arg | type | description |
|---|---|---|
| text | ? |
setSubtitle(text: ?, secs: ?) → void
| arg | type | description |
|---|---|---|
| text | ? | |
| secs | ? |
addScore(base: ?, label: ?) → void
| arg | type | description |
|---|---|---|
| base | ? | |
| label | ? |
initLandmarks( ) → void
Landmarks
onLandmarkDamage(lmId: ?, destroyed: ?) → void
| arg | type | description |
|---|---|---|
| lmId | ? | |
| destroyed | ? |
rememberDebris(list: ?) → void
| arg | type | description |
|---|---|---|
| list | ? |
damageBuildingRoot(rootId: ?, dmg: ?, hitPos: ?) → void
| arg | type | description |
|---|---|---|
| rootId | ? | |
| dmg | ? | |
| hitPos | ? |
eachTargetNear(center: ?, r: ?, fn: ?) → void
Visit every live registry root (buildings + vehicles) within `r` (2D) of `center`. Vehicles use their live entity position; buildings their registered footprint position plus a pad for their bulk.
| arg | type | description |
|---|---|---|
| center | ? | |
| r | ? | |
| fn | ? |
eachDebrisNear(center: ?, r: ?, fn: ?) → void
Live debris entities within r of center.
| arg | type | description |
|---|---|---|
| center | ? | |
| r | ? | |
| fn | ? |
hitBuildings(center: ?, r: ?, dmg: ?) → void
damage every registered building/vehicle near the point
| arg | type | description |
|---|---|---|
| center | ? | |
| r | ? | |
| dmg | ? |
killUnit(u: ?) → void
| arg | type | description |
|---|---|---|
| u | ? |
hitUnits(center: ?, r: ?, dmg: ?) → void
| arg | type | description |
|---|---|---|
| center | ? | |
| r | ? | |
| dmg | ? |
damageGodzilla(dmg: ?) → void
| arg | type | description |
|---|---|---|
| dmg | ? |
groundSpawnPoint( ) → void
Military
spawnUnit(kind: ?) → void
| arg | type | description |
|---|---|---|
| kind | ? |
spawnTick( ) → void
fireProjectile(u: ?, target: ?) → void
| arg | type | description |
|---|---|---|
| u | ? | |
| target | ? |
tickUnit(u: ?, dt: ?) → void
| arg | type | description |
|---|---|---|
| u | ? | |
| dt | ? |
tickArtillery(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
tickProjectiles(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
frontPoint(dist: ?) → void
Abilities
| arg | type | description |
|---|---|---|
| dist | ? |
dmgMult( ) → void
doClaw( ) → void
doStomp( ) → void
doTail( ) → void
doRoar( ) → void
tryGrab( ) → void
tickThrown(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
tickBreath(dt: ?, wantFire: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? | |
| wantFire | ? |
tickMovement(dt: ?) → void
Godzilla movement + animation
| arg | type | description |
|---|---|---|
| dt | ? |
rot(part: ?, q: ?) → void
| arg | type | description |
|---|---|---|
| part | ? | |
| q | ? |
camEntity( ) → void
Camera
tickCamera(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
unregister(name: ?) → void
Screens
| arg | type | description |
|---|---|---|
| name | ? |
show(name: ?, tree: ?, layer: ?) → void
| arg | type | description |
|---|---|---|
| name | ? | |
| tree | ? | |
| layer | ? |
bestFor(diff: ?) → void
| arg | type | description |
|---|---|---|
| diff | ? |
bestList( ) → void
galleryCtx( ) → void
screenCtx( ) → void
refreshStateScreens( ) → void
setState(s: ?) → void
| arg | type | description |
|---|---|---|
| s | ? |
hudCtx( ) → void
clearRunEntities( ) → void
Run lifecycle
startRun(custom: ?) → void
City.clear() despawns deferred (end of frame), so a same-frame build() adopts the dying CITY and keeps its stale registry. startRun therefore only clears and arms `state = "starting"`; update() builds on the first frame the old CITY is really gone, then finishes via beginRun().
| arg | type | description |
|---|---|---|
| custom | ? |
beginRun(custom: ?) → void
| arg | type | description |
|---|---|---|
| custom | ? |
rankFor(sc: ?) → void
| arg | type | description |
|---|---|---|
| sc | ? |
endRun(survived: ?) → void
| arg | type | description |
|---|---|---|
| survived | ? |
awake( ) → void
Lifecycle
onDestroy( ) → void
update(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
fixedUpdate(dt: ?) → void
downed: fall over, then results
| arg | type | description |
|---|---|---|
| dt | ? |
onCallback(id: ?, data: ?) → void
UI callbacks
| arg | type | description |
|---|---|---|
| id | ? | |
| data | ? |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.