The pack
girderClimb
function girderClimb(): Pack<{ girderClimb: typeof api }>
Install the girder-climb preset API (game.girderClimb) over platform-rounds.
Helpers
dkBarrelKind
function dkBarrelKind(o: { steer?: number; wild?: number; aim?: "random" | "target" | "proportional"; wildSpeed?: [number, number]; tags?: string[] } = {}): EnemyKind
A barrel: rolls 1 px per frame, goes down ladders at 1 px per frame, drops off girder ends and reverses.
dkBehaviours
function dkBehaviours(): Record<string, EnemyBehaviour>
The preset's custom enemy behaviours (springs and Kong's pacing).
dkBonusSeconds
function dkBonusSeconds(level: number): number
Seconds per bonus tick on the 50 m, 75 m and 100 m stages: (220 - 2 x start/100) frames ($62B3).
dkBonusStart
function dkBonusStart(level: number): number
Bonus timer start: min(80, (level x 10 + 40) mod 256) hundreds ($0F7A). Level 22 overflows to 400: the kill screen.
dkConveyorsStage
function dkConveyorsStage(ctx: StageContext, o: DonkeyKongOptions = {}): StageDef
50 m: the pie factory: conveyors that switch direction, retracting ladders, pies and firefoxes from the centre drum.
dkElevatorsStage
function dkElevatorsStage(ctx: StageContext, o: DonkeyKongOptions = {}): StageDef
75 m: two elevator shafts, springs bouncing from Kong and dropping down the right side, two fireballs.
dkFireKind
function dkFireKind(d: number): EnemyKind
A fireball or firefox: wanders girders, takes ladders a quarter of the time, climbs at a third of its descent speed.
dkGirdersStage
function dkGirdersStage(ctx: StageContext, o: DonkeyKongOptions = {}): StageDef
25 m: slanted girders, barrels, the oil drum and its fires.
dkInternalDifficulty
function dkInternalDifficulty(level: number, seconds: number): number
Internal difficulty 1..5: the level, plus one for every 2048 frames on the current attempt ($037F).
dkItemScore
function dkItemScore(level: number): number
Points for Pauline's items: 300, 500, then 800 from level 3 ($1DE7).
dkJumpman
function dkJumpman(o: { fatalFall?: number; houseRules?: DonkeyKongOptions["houseRules"] } = {}): WalkerProfile
Jumpman for the preset: walk 2/3 px per frame, climb up 2 px per 5 frames and down 2 per 4, a fixed 13 px jump arc moving 1/2 px per frame, death 15 px below take-off.
dkKongKind
function dkKongKind(min: number, max: number): EnemyKind
Kong pacing his girder (50 m, 100 m): picks a point in [min, max] and walks to it. Lethal to touch.
dkLines
function dkLines(table: readonly DkTableEntry[]): { girders: GirderLine[]; ladders: LadderLine[]; scenery: LadderLine[]; solids: Rect[] }
Lines from a ROM table in world units. Ladders that rise above y = 48 are Kong's (scenery, not climbable).
dkPieKind
function dkPieKind(): EnemyKind
A cement pie: no will of its own, carried by the belts.
dkRivetsStage
function dkRivetsStage(ctx: StageContext, o: DonkeyKongOptions = {}): StageDef
100 m: remove all eight rivets; firefoxes appear on the side away from Mario; Kong paces his girder.
dkSpringKind
function dkSpringKind(dropX: number): EnemyKind
A spring: a scripted 20 px hop every 25 frames moving 2 px per frame, then a straight 3 px-per-frame drop ($2E04).
donkeyKongPreset
function donkeyKongPreset(o: DonkeyKongOptions = {}): RoundsDef
Donkey Kong (1981) as a createRounds definition. US stage order by default, three lives, an extra life at
7000, the bonus timer, hammers, items, the internal difficulty and every table from the ROM. Pass a difficulty
(Easy / Normal / Arcade) to scale enemy speed, spawn intervals, caps, timers and steering.
Constants
DK_ORDERS
const DK_ORDERS: Readonly<Record<"us" | "japan", readonly (readonly string[])[]>>
The stage orders.
DK_TABLES
const DK_TABLES: Readonly<Record<"girders" | "conveyors" | "elevators" | "rivets", readonly DkTableEntry[]>>
The four stage layouts as stored in the ROM (tables at $3AE4, $3B5D, $3BE5, $3C8B).
Types
DkTableEntry
type DkTableEntry = readonly [number, number, number, number, number]
One entry of the ROM layout tables: [type, x1, y1, x2, y2]. Types: 0 ladder, 1 broken ladder, 2 girder, 3 conveyor, 5 rivet girder, 6 solid patch.
DonkeyKongOptions
interface DonkeyKongOptions
Options for the Donkey Kong preset. Every default is the US arcade's; the difficulty scales the tables.
order?: "us" | "japan" | string[][]— Stage order: 'us' (25-100, 25-75-100, 25-50-75-100, 25-50-25-75-100, then 25-50-25-75-25-100), 'japan' (25-50-75-100), or your own lists of '25m' | '50m' | '75m' | '100m'.lives?: number— Lives at the start (DIP: 3, 4, 5, 6). Default 3.extraLife?: number | null— Extra life score (DIP: 7000, 10000, 15000, 20000), or null for none. One only. Default 7000.difficulty?: DifficultyScale— Difficulty scale. Default Arcade.seed?: number— Seed.howHigh?: boolean— Show 'How high can you get?' before every attempt. Default true.intro?: boolean— Play the intro (Kong climbs with Pauline and bends the girders). Default true.hammerSeconds?: number— Hammer seconds (512 frames).smashPause?: number— Seconds the action freezes for each smash (78 frames).maxFires?: number— Most fires on 25 m (5).maxBarrels?: number— Most barrels on screen (10).throwEvery?: number— Mean seconds between Kong's throws (about 87 frames).wildChance?: number— Chance a thrown barrel is wild (1 in 16).blueEvery?: number— Every n-th barrel is blue (8).bonus?: (level: number) => number— Bonus timer start per level. DefaultdkBonusStart.liftSpeed?: number— Elevator and belt speed, units per second (30).fatalFall?: number— Fall height that kills Jumpman, measured from take-off (15).rivetScore?: number— Rivet points (100).houseRules?: { ladderJump?: boolean; airGrab?: boolean; pullUp?: boolean; hammerJump?: boolean }— House rules (all off in the arcade, which forbids each one: $1AD1-$1AFE).ladderJump: jump off ladders.airGrab: press up or down in the air to catch a ladder.pullUp: climb broken ladders up to the girder above (still never down one).hammerJump: jump while holding the hammer (it still cannot climb).


