Phaser AE

Creature zoo

Pro packv3.0.0-03DArcade

Wildlife and monsters for a 3D world over a heightfield: flocks, flyers, worms, serpents, walkers and sea monsters. Every kind is a record of data, the zoo moves them and decides what they go for, and your game carries out every attack.

This is a Pro pack. Upgrade to Phaser Pro to use it in your games.See Phaser Pro →

Released October 19, 2026

Creature zoo: a screenshot of its demo
A note about these graphics

Expansion packs don't come with graphics. This screenshot is one way of drawing what the pack does, made for its demo: none of the sprites, tiles or backgrounds in it are in the pack.

That's by design. A pack is a game's logic, mechanics and effects, and it works with whatever art you give it. Some packs draw effects, backdrops or 3D scenes of their own, but none carries a game's sprites.

So the look is yours. Make the art on phaser.io, bring your own, or let your agent draw it in code: the same pack can look like anything.

The pack

creatureZoo

function creatureZoo(): Pack<{ creatureZoo: typeof api }>

Install the creature-zoo API (game.creatureZoo).

Classes

Zoo

class Zoo

A herd of creatures on a ground, kept in list (plain data the game saves).

  • constructor( /** The kinds, by id. */ readonly kinds: Readonly<Record<string, CreatureKind>>, /** The game. */ readonly host: ZooHost, /** The creatures (the game's own array: it is saved with the game's state). */ public list: Creature[], )
  • sizeOf(k: Creature): number — A creature's current size (eaters grow 40% a stage).
  • attackOf(k: Creature, kind: CreatureKind): CreatureAttack — Its attack now: a grown stage's, or the base one.
  • spawn(kind: CreatureKind, x: number, z: number, herd: number): Creature — One creature at (x, z), in herd herd.
  • spawnGroup(kind: CreatureKind, avoid: { x: number; z: number }): void — A herd of kind.group creatures somewhere it can live, well away from avoid.
  • step(dt: number): void — One step: choose targets, move, trail segments, eat and grow, lay eggs, attack.

Types

Creature

interface Creature

A creature in play.

  • id: number — Unique number among all entities.
  • kind: string — Id of its CreatureKind, the key in the zoo's kinds.
  • x: number — World x.
  • y: number — World y, up.
  • z: number — World z.
  • vx: number — Velocity along x in world units per second.
  • vy: number — Velocity along y (up) in world units per second.
  • vz: number — Velocity along z in world units per second.
  • yaw: number — Heading in radians, with the carpet's convention: 0 looks along +z and increasing turns right.
  • hp: number — Hit points left; it dies at 0 and releases its mana.
  • mana: number — Mana it holds (released on death).
  • stage: number — Growth stage (0 = the base).
  • herd: number — Herd/flock id.
  • angry: boolean — Has turned hostile (non-aggressive kinds after being hit).
  • target: string — What it is after: the host's reference for the target (mana-conquest: "w:3", "c:2", "b:5", "k:9"), or "".
  • cool: number — Seconds until its next attack.
  • away: number — Seconds left away (teleported), or 0.
  • rise: number — A worm's or kraken's rise 0..1.
  • trail: Array<{ x: number; y: number; z: number }> — Trail of earlier positions (segments follow it).
  • owner: number — The team it fights for (mana-conquest: the wizard of an undead army), or -1 for wild.
  • age: number — Seconds it has lived.
  • homeX: number — World x of the spot it wanders around; a flock's anchor drifts.
  • homeZ: number — World z of the spot it wanders around; a flock's anchor drifts.
  • alive: boolean — False once dead.
  • lay: number — Laying timer (grown crabs).

CreatureAttack

interface CreatureAttack

A creature's attack.

  • kind: "melee" | (string & {}) — melee (claws or stings at touching range: the creature closes in) or a name the host carries out as it likes (mana-conquest's: fireball, rapid, boulder, arrow, lightning, meteor); a ranged attack stands off.
  • damage: number — Damage of each hit to what it strikes.
  • range: number — Reach (world units).
  • every: number — Seconds between attacks.

CreatureKind

interface CreatureKind

A kind of creature.

  • id: string — Unique kind name: the key in the zoo's kinds, and what a creature's kind and the host's own lists refer to.
  • name: string — Display name.
  • hp: number — Hit points at full health.
  • mana: number — Mana released when it dies (split into orbs).
  • size: number — Body size (world units across).
  • speed: number — Cruising speed (world units/s).
  • motion: CreatureMotion — How it moves and fights: flocks, flyers, worms, serpents, walkers or sea creatures.
  • altitude: number — Flying height over the ground (flyers).
  • attack: CreatureAttack — Its base attack; a grows stage replaces it.
  • sight: number — Notices targets within this distance.
  • aggressive: boolean — False: harmless until something hurts it (the griffin), then its whole herd turns.
  • targets: string[] — What it goes for: the classes of target the host offers (mana-conquest: wizard, castle, balloon, creature).
  • humanOnly?: boolean — The host's own flag: of the wizards, it goes only for the human player (Magic Carpet's bees).
  • group: [number, number] — How many come together.
  • regen?: number — Health regained per second.
  • eatsMana?: boolean — Eats loose mana orbs it reaches (the mana is held and released on death).
  • grows?: { per: number; stages: CreatureAttack[]; layEvery?: number } — Grows as it eats: each stage needs this much mana; stage attacks replace the base attack.
  • stealsMana?: number — The host's own rule: steals this much personal mana from a wizard it hits.
  • teleportsAt?: number — The host's own rule: teleports away when hurt below this fraction of its health and comes back restored.
  • converts?: string — The host's own rule: a victim it kills rises as one of this kind (skeletons).
  • seesInvisible?: boolean — The host's own rule: sees invisible wizards.
  • ignoresRebound?: boolean — The host's own rule: its fireballs cannot be rebounded.
  • segments?: number — Segments of a worm or serpent.

CreatureMotion

type CreatureMotion = /** Flies in a loose flock that wanders and swoops on targets (vultures, bees, griffins). */ | "flock" /** Flies alone, circling and diving (genie, wyvern). */ | "flyer" /** A segmented body that swims through the land, rearing up to strike (worms). */ | "worm" /** A segmented body that flies (MC1's dragon). */ | "serpent" /** Walks the land and will not cross water (apes, trolls, skeletons, crabs, emu riders). */ | "walker" /** Lives under the sea and rises to strike (kraken). */ | "sea"

How a creature moves.

ZooFood

interface ZooFood

Food an eater can reach (mana orbs).

  • id: number — The host's id.
  • x: number — World x.
  • y: number — World y.
  • z: number — World z.
  • amount: number — What eating it is worth.
  • alive: boolean — Still there.

ZooGround

interface ZooGround

What the zoo needs of the ground: a wrapping height field over a sea (a torus-land Land answers all of it).

  • readonly cell: number — World units per cell.
  • readonly size: number — World units across.
  • readonly sea: number — The sea's level.
  • groundAt(x: number, z: number): number — The height to stay above: land, or the sea over it.
  • heightAt(x: number, z: number): number — The land's own height (the sea bed under water).
  • isWater(x: number, z: number): boolean — Under the sea.
  • wrap(v: number): number — Fold a coordinate onto the world.
  • delta(a: number, b: number): number — Shortest b - a across the wrap.
  • distance(ax: number, az: number, bx: number, bz: number): number — Distance across the wrap.

ZooHost

interface ZooHost

What a zoo asks of its game.

  • readonly ground: ZooGround — The ground.
  • rand(): number — The game's seeded random numbers in [0, 1).
  • id(): number — A fresh entity id.
  • targets(k: Creature, kind: CreatureKind): Iterable<ZooTarget> — Every target this creature could go for (filtered by kind.targets and the game's own rules).
  • locate(ref: string): { x: number; y: number; z: number } | null — Where a target is now, or null when it is gone.
  • keep?(k: Creature, ref: string): boolean — Keep chasing this target even though another is nearer (mana-conquest: a grudge against a wizard). Default no.
  • attack(k: Creature, kind: CreatureKind, atk: CreatureAttack, at: { x: number; y: number; z: number }, to: { x: number; y: number; z: number }): void — Carry out an attack from at at the target at to: the game owns damage and projectiles.
  • food?(): Iterable<ZooFood> — Food on the ground, for eaters.
  • eat?(k: Creature, food: ZooFood): void — An eater reached this food: the game removes it (the zoo adds its amount and grows the creature).
  • laid?(young: Creature): void — A grown creature laid an egg that hatched here.

ZooTarget

interface ZooTarget

A target the host offers a creature.

  • ref: string — The host's reference for it (kept in Creature.target).
  • x: number — World x.
  • y: number — World y.
  • z: number — World z.
  • team: number — Its team: a creature never goes for its own.