Skip to content

Pixel Engine 0.42.0

Choose a tag to compare

@github-actions github-actions released this 17 Oct 05:45
94fbae9

Pixel Engine 0.42.0 as the engine kit: pixel-engine.zip below holds the engine as one ES module, its guides, a starter game and check.mjs. Unzip it, then read README.md and GUIDE.md.

The newest release is always https://github.com/michaelcrosato/riftlight/releases/latest/download/pixel-engine.zip; this one stays at https://github.com/michaelcrosato/riftlight/releases/download/engine-v0.42.0/pixel-engine.zip.

What changed in 0.42.0

  • Engine.headless(game, options): games without a page (docs/engine/headless.md). The same
    boot, game code and frames as Engine.start, in Node: no GPU, DOM or listeners, manual time from
    the start (step(), input.setKey / send, replay()), errors in engine.errors. Options add
    viewport (default 960×540 at DPR 1) and assets.
  • engine.renderer is a View: what gameplay reads from a view (art resolution, framing,
    viewport, look, mode, filters, screen, capture()), the page's PixelRenderer or a
    HeadlessView. Direct GPU work goes through engine.gpu (the PixelRenderer, null
    headless): engine.renderer.renderer becomes engine.gpu.renderer. BackendName gains
    'headless'.
  • The GPU helpers take the view: swarm.update(engine.renderer, dt) (was
    engine.renderer.renderer), mirror.attach(engine.renderer, scene) and
    view.attach(engine.renderer, scene) as before; headless they do nothing.
  • New exports: HeadlessOptions, View, HeadlessView (setViewport), HeadlessViewOptions,
    HEADLESS_VIEWPORT, frameView, Viewport, setAssetReader, AssetReader.
  • Assets without fetch: setAssetReader(read) reads models and packs through
    (path) => Promise<ArrayBuffer> for the whole process (AssetReader); nodeAssets() in
    src/engine/node.ts reads public/ in Node. A model load that fails is tried again on the
    next call instead of failing from the cache.
  • Recording.view: the viewport a recording was made on. A headless replay frames for it; a
    page warns when its own differs (pointer aim and the HUD follow it). frameView and Viewport
    are the framing both views share.
  • The HUD's width / height follow the view from the first frame, before anything is drawn.