Repository navigation
Pixel Engine 0.42.0
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 asEngine.start, in Node: no GPU, DOM or listeners, manual time from
the start (step(),input.setKey/send,replay()), errors inengine.errors. Options add
viewport(default 960×540 at DPR 1) andassets.engine.rendereris aView: what gameplay reads from a view (art resolution, framing,
viewport, look, mode, filters,screen,capture()), the page'sPixelRendereror a
HeadlessView. Direct GPU work goes throughengine.gpu(thePixelRenderer, null
headless):engine.renderer.rendererbecomesengine.gpu.renderer.BackendNamegains
'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.tsreadspublic/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).frameViewandViewport
are the framing both views share.- The HUD's
width/heightfollow the view from the first frame, before anything is drawn.