You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use these helpers to author grid maps as text, then query cells by row/column or
centered world coordinates.
Export
Use It For
parseStringTileMap
Parse a multiline string into padded tile rows, with optional tile normalization.
findStringTileMapCell
Find the first cell containing a tile symbol.
findStringTileMapCells
Find all cells containing a tile symbol.
getStringTileMapTile
Read one tile by column and row.
getStringTileMapCenteredPoint
Convert a column/row into centered x/z coordinates.
getStringTileMapCellFromCenteredPoint
Convert centered x/z coordinates back into a cell.
constmap=parseStringTileMap(`########D######### S ## P o ##################`.trim());constspawn=findStringTileMapCell(map,"S");
The isometric dungeon demo uses this editable legend on top of the generic
string map parser:
Symbol
Meaning
Role
space
Floor
Walkable floor
#
Stone wall
Blocking wall
.
Floor marker
Walkable floor marker
C
Chest
Interactable prop
D
Door
Interactable doorway
P
Pillar
Blocking prop
S
Player spawn
Spawn point
d
Stairs down
Interactable stairs
o
Light source
Light
r
Rubble
Blocking prop
u
Stairs up
Interactable stairs
w
Water
Walkable slow floor
Ragged rows can be padded with an internal empty tile such as _; the dungeon
demo treats that as void space outside the playable floor and hides it from the
editor legend.
🎮 Input Actions
Export
Use It For
getInputCode
Normalize keyboard, mouse, pointer, touch, gamepad, or string input into an input code.
getInputActions
Resolve an input event or input code to semantic actions.
getInputActionState
Convert currently pressed inputs into an action-state object.
getGamepadInputCodes
Read pressed gamepad buttons and active axes.
createInputController
Track keyboard, mouse, touch, pointer, and gamepad inputs through start/stop lifecycle helpers.
createKeyboardInputController
Backwards-compatible alias for createInputController.
constinput=createInputController({fire: ["Space","MouseLeft","TouchPrimary","Gamepad0"],moveLeft: ["ArrowLeft","KeyA","GamepadAxisLeftXNegative"],});input.start();input.updateGamepads();if(input.isPressed("fire")){// Fire a shot.}
👥 Multiplayer Input
Export
Use It For
createLocalMultiplayerController
Track separate action state for multiple local players.
createMultiplayerSession
Describe a local or remote co-op/PvP session without choosing a backend.
createPlayerInputIntent
Create serializable player input messages for remote sync.
getPlayerActionState
Resolve one player's bindings against pressed inputs.
mergePlayerInputIntent
Merge a local or remote player intent into a player-state map.
Remote multiplayer is supported as data contracts rather than a bundled
network stack. Games can send PlayerInputIntent objects through WebSocket,
WebRTC, a hosted relay, or their own backend.
📱 Browser Capabilities
Export
Use It For
canUseScreenWakeLock
Detect whether the browser exposes the Screen Wake Lock API.
ScreenWakeLockController
Acquire, release, and reacquire best-effort screen wake locks around gameplay state.
canUseFullscreen
Detect fullscreen request support on an element.
canLockOrientation
Detect Screen Orientation lock support.
enterImmersiveMode
Request fullscreen and an optional orientation lock from a trusted user gesture.
exitInstalledApp
Attempt to close an installed app window and dispatch a fallback event if blocked.
Achievement helpers are local game-state utilities. Remote leaderboard
validation is handled by the high-score helpers. See
Engine/Achievements/Achievements in Storybook for an interactive
progress and unlock demo.
🏆 Achievement Notifications
Export
Use It For
AchievementNotificationRenderer
Queue and render animated canvas achievement unlock popups.
achievementNotificationEventName
Default event name for event-driven notification enqueueing.
defaultAchievementNotificationLayout
Default popup width, height, icon size, margin, and slide distance.
defaultAchievementNotificationTheme
Default popup colors.
defaultAchievementNotificationTiming
Default slide, hold, and exit durations.
constrenderer=newAchievementNotificationRenderer({
context,getViewport: ()=>({width: canvas.width,height: canvas.height}),});renderer.enqueue({name: "Wave Breaker",description: "Clear three waves.",});renderer.render();
The renderer works directly with canvas contexts. Games own their achievement
definitions, icon assets, and render loop timing.
🏅 High Scores
Backend code can import high-score validation helpers without importing the
whole engine root:
Use these helpers alongside your API routes, score storage, used-receipt
updates, and rate limits. See Engine/Player Data/High Scores in
Storybook for a local leaderboard and validation demo.
🎞️ Sprite Animation
Export
Use It For
getSpriteFrameIndex
Frame timing from elapsed seconds, animation FPS, and frame count.
getSpriteSheetFrame
Convert a frame index into GameArena.renderSprite frame data.
These helpers only calculate 2D geometry. Games own the final rendering style,
color blending, gradients, shadow treatment, and interaction model. Bounce
requests are capped to 0..3 layers for now, and the demo assumes
low-reflectivity materials with steep attenuation. Bounds and occluders can
provide surfaceColor values so bounced layers inherit some of the material
color they hit. See
Engine/Rendering/Ray Traced Apartment in Storybook for a Canvas 2D
lighting demo with draggable furniture, a movable lamp, per-light intensity
controls, one bounce enabled by default, bounce attenuation tuning, a ray-guide
toggle, and monochrome TV-static flicker.
🕹️ 2.5D Projection
Export
Use It For
wrapDepth
Looping depth values through a fixed range.
getLoopedDepth
Repeating starfields, lanes, gates, or scenery by depth.
getDepthProgress
Normalized depth progress for alpha, size, and intensity.
getPerspectiveScale
Scale from depth.
projectPerspectivePoint
Project a 3D point into 2D canvas coordinates.
projectIsometricPoint
Convert a 3D grid point into isometric 2D coordinates.
Screen effects render above the world and below HUD/UI by default. Atmospheric
effects render as world-space weather or air particles before HUD and screen
overlays.
Export
Use It For
ScreenEffectManager
Register, enable, disable, update, and render stackable screen effects by id.
createScreenDropletsEffectDefinition
Camera, visor, or screen rain droplets.
createScreenFireEffectDefinition
Player fire or burn feedback.
createScreenFrostEffectDefinition
Player cold or frost feedback.
createScreenPoisonEffectDefinition
Toxic, sickly player-state feedback.
createScreenLowHealthEffectDefinition
Red pulsing low-health danger feedback.
createScreenShockEffectDefinition
Short electric damage flashes, arcs, and glitch slices.
createScreenSpeedBoostEffectDefinition
Pixel speed lines and fast-motion streaks.
createEnvironmentHeatEffectDefinition
Warm tint, shimmer bands, and heat ripples.
createEnvironmentFrostEffectDefinition
Edge frost, crystal clusters, and breath mist.
createEnvironmentFireEffectDefinition
Edge flames, embers, smoke, and warm flicker.
createEnvironmentUnderwaterEffectDefinition
Blue-green tint, slow wave distortion, bubbles, and debris.
Use positive velocityZ for forward fly-through motion, where stars expand
away from the centre. Use negative velocityZ to make the field recede toward
the centre.
🧊 Cube Clusters
Export
Use It For
createCubeClusterFromPattern
Build voxel-like block models from text patterns.
createPlasmaLinks
Generate links between nearby blocks.
centerCubeCluster
Center block coordinates around their bounds center.
getCubeClusterBounds
Cluster min/max bounds.
getCubeClusterCenter
Cluster center point.
cloneCubeBlock
Copy a cube block.
createExplosionBlocks
Convert blocks into moving explosion debris.
stepExplosionBlocks
Advance explosion position, velocity, gravity, drag, and opacity.