API reference
Generated by
npm run docs:api. Do not edit by hand. Version 0.1.0-alpha.3 · API_VERSION 2 · 47 packs.
Core
Import from risejs-core:
import { createApp, World, Entity, Input } from 'risejs-core';
import 'risejs-core/style.css';
| Module | Exports |
|---|---|
app.js |
createApp |
version.js |
VERSION, API_VERSION, deprecate, apiInfo |
config.js |
DEFAULTS, deepMerge, resolveConfig |
events.js |
Emitter |
input.js |
Input |
world.js |
World, Entity |
player/player.js |
Player |
player/character.js |
Character |
camera/rig.js |
CameraRig |
state.js |
GameState |
i18n.js |
I18n |
rng.js |
Rng, mulberry32, hashSeed |
projection.js |
projectToScreen |
env.js |
hasWebGL2, isSecureContext, isTouchDevice, prefersReducedMotion, envInfo |
reactive.js |
reactive, effect, computed, flush, batch |
spatial.js |
SpatialHash |
plugin.js |
definePlugin |
plugins/audio.js |
audioPlugin |
plugins/save.js |
savePlugin |
config.js |
PRESETS, applyPresets, validateConfig |
save.js |
SaveSlot |
anticheat.js |
IntegrityGuard |
audio.js |
AudioBus |
ui/hud.js |
createHud |
prefabs.js |
box, cylinder, decor, material |
world/surface.js |
SurfaceMap, SURFACE |
render/renderer.js |
createRenderer, bindResize |
render/world-light.js |
createSky, createLights, PALETTE |
net/zone.js |
zoneKey, zoneCoords, zoneId, neighborKeys, inInterest, filterByInterest |
Packs
Each pack is its own entry: risejs-core/packs/<name>.
| Pack | Exports | Summary |
|---|---|---|
a11y |
a11yPlugin |
Accessibility pack: colorblind filter, UI scale, reduce motion, high contrast. |
assets |
ByteCache, assetsPlugin, classify, normalizeList, progressOf |
Assets pack: preloads textures, audio, JSON and glTF with progress reporting and a URL cache. |
atlas |
composePages, packAtlas, validatePages |
Deterministic shelf atlas packer. Input is sizes and RGBA data only; there is no PNG dependency. |
audio3d |
audio3dPlugin |
Audio 3D pack: positional audio, kept out of the core. |
bakes |
BakeQueue, bakesPlugin |
Bakes pack: spreads incremental generation work over a millisecond budget per frame. |
bench |
benchPlugin, buildReport, formatReport, summarizeFrames |
Bench pack: measures real frame rate on the player's GPU. |
camera2d |
Camera2D |
2D camera helper: zoom, decaying shake and pixel-perfect snapping. |
chat |
chatPlugin |
Chat pack: zone, all and direct-message channels with rate limiting, a log and an input box. |
combat |
Health, combatPlugin, hostile, inMeleeArc, pickTarget |
Combat pack: health, melee attacks, i-frames, overhead health bars and death. |
console |
consolePlugin |
Console pack: an in-game developer console. Install it only in development builds. |
contracts |
DIAGNOSTIC_CODE, diagnostic, fail, fnv1a, formatDiagnostic, hashValue, isOk, mergeDiagnostics … |
Contracts pack: coded diagnostics and deterministic hashing. |
debug |
debugPlugin |
Debug pack: collider wireframes, scene statistics and a navmesh grid overlay. |
dialogue |
createDialogue, dialoguePlugin |
Dialogue pack: branching dialogue, independent of the quest pack. |
editor |
editorPlugin |
Editor pack: place and delete objects on a grid, with JSON save and load. |
editor2d |
editor2dPlugin |
2D editor pack: paint tiles with the mouse, with level JSON save and load. |
fmv |
fmvPlugin |
FMV pack: video scenes with subtitles, choices and quick-time events. |
gltf |
anchorsOf, applyManifestColliders, attachAnimations, budgetCheck, collidersFromGltf, collidersOf, findByRole, glbInfo … |
glTF pack: loads external models, bakes colliders and registers prefabs. |
grid |
GridMover, gridPlugin |
Grid pack: cell-by-cell movement for tactics and turn-based games. |
inventory |
InteractionSystem, Inventory, inventoryPlugin |
Inventory and interaction pack (opt-in). |
lobby |
formatRooms, lobbyPlugin, pickRoom |
Lobby pack: room list and quick match. |
loot |
CRATE_LOOT, LootTable, lootPlugin |
Loot pack: loot tables plus drops on the map, picked up with E. |
menu |
ACTIONS, LABELS, createMenu |
Pause menu and settings screen, built without a UI library. Controlled with the mouse or the keyboard (↑↓ Enter Esc). |
music |
MOODS, chordFreqs, crossfade, duckGain, moodOf, musicPlugin |
Music pack: synthesized background music (no files needed) with fade and duck, or playback of a buffer. |
nameplate |
nameplatePlugin, projectToScreen |
Nameplate pack: a name and speech bubble above a character (DOM overlay). |
navmesh |
NavGrid |
Grid navmesh: 8-direction A* on a grid that avoids blocked cells. Pure, no three.js, testable in Node. |
net |
NetClient, netPlugin |
Networking pack: server-authoritative movement with client prediction and reconciliation. |
npc |
Npc, NpcAgent, npcPlugin |
NPC plugin: installs app.spawnNpc (patrolling NPCs). The core does not own this gameplay behavior. |
persistence |
RemoteSave, persistencePlugin |
Persistence pack: saves over HTTP (D1) instead of localStorage. |
prefabs |
LodGroup, PrefabRegistry, buildInstanced, classifyTransform, composeAnchor, determinant3, flipIndices, groupInstances … |
Prefab registry: maps an id to a builder, used by the level format. |
quest |
QuestLog, questPlugin |
Quest pack (opt-in). Dialogue lives in the dialogue pack, which is still installed automatically to keep the older API working. |
replay |
Playback, Recorder, replayPlugin |
Replay pack: records input per tick, plays it back, exports/imports JSON. |
sideview |
SideController, sidePlugin |
Sideview pack: 2.5D platformer with sideways movement, jumping, gravity and a side camera. |
sprite2d |
SortedSprites, SpriteAnimator, SpriteBatch, atlasUV, clipTimeline, parallaxOffset, parseSheet, sprite2dPlugin … |
Sprite2D pack: 2D rendering with instanced quads (1 draw call per texture). |
stats |
Progression, Stats, StatusEffects, statsPlugin, xpForLevel |
Stats pack: attributes, XP and status effects. |
surface |
WEAR_FRAGMENT_BODY, WEAR_FRAGMENT_HEADER, WEAR_VERTEX_BODY, WEAR_VERTEX_HEADER, applySurfaceWear, attachSurfaceWear, edgeWeights |
Surface wear: computes _edge from geometry and patches materials to read _edge/_cavity. |
telemetry |
telemetryPlugin |
Telemetry pack: collects lightweight events and sends batches when full, on an interval, or when the tab is hidden. |
terrain |
Terrain, chunkRanges, chunkStats, decodeHeightmap, encodeHeightmap, heightfieldFrom, lodIndexForDistance, terrainLod |
Terrain mesh built from a heightfield: a grid colored by height and slope. |
tilemap |
Tilemap, autotileMask, autotileVariant |
Tilemap pack: one SpriteBatch per chunk, collision merged along rows, and autotiling. |
touch |
touchPlugin |
Touch pack: virtual joystick for phones and tablets. |
triggers |
Triggers |
Trigger zones: emit enter/exit once when the player's box goes in or out. |
tween |
EASING, Tweens, lerp, tweenPlugin |
Lightweight tweens and easing, no dependencies. |
vfx |
FloatText, HitFlash, Particles, Pool, burst, resetParticle, stepParticle, vfxPlugin |
VFX pack: particles, damage numbers, hit flash. |
vn |
EXPRESSIONS, Typewriter, normalizeNode, paginate, vnPlugin |
VN pack: visual novel with typewriter text, backlog, auto, skip, portraits and choices. |
weather |
dayCycle, weatherPlugin |
Weather pack: instanced rain/snow plus a day–night cycle (lerps sun/fog/ambient). |
xr |
xrPlugin |
XR pack: WebXR for VR and AR (AR-first). |
Common subpaths
| Subpath | Target |
|---|---|
./dist |
./dist-lib/rise.js |
./style.css |
./src/ui.css |
./packs/physics/obb |
./src/rise/packs/physics/obb.js |
./packs/physics/heightfield |
./src/rise/packs/physics/heightfield.js |
./packs/physics/body |
./src/rise/packs/physics/body.js |
./packs/procgen |
./src/rise/packs/procgen/core.js |
./packs/gltf/manifest |
./src/rise/packs/gltf/manifest.js |
./packs/gltf/loader-info |
./src/rise/packs/gltf/loader-info.js |
./packs/sprite2d/sheet |
./src/rise/packs/sprite2d/sheet.js |
./packs/terrain/heightmap |
./src/rise/packs/terrain/heightmap.js |
./packs/assets/cache |
./src/rise/packs/assets/cache.js |
./packs/prefabs/instances |
./src/rise/packs/prefabs/instances.js |
./packs/prefabs/lod-group |
./src/rise/packs/prefabs/lod-group.js |
./packs/contracts/hash |
./src/rise/packs/contracts/hash.js |
./packs/contracts/diagnostics |
./src/rise/packs/contracts/diagnostics.js |
./packs/bakes/core |
./src/rise/packs/bakes/core.js |
API check
npm run api:check # fails if an export is removed without increasing API_VERSION
npm run api:surface -- --write # update the snapshot after adding exports