@moku-labs/game 0.15.82 → 0.15.83

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { Ft as audioPlugin, H as platformPlugin, i as screen, m as flattenFeatures, t as createApp, wt as effectsPlugin } from "./src-DX2UW8sT.mjs";
1
+ import { Ft as audioPlugin, H as platformPlugin, i as screen, m as flattenFeatures, t as createApp, wt as effectsPlugin } from "./src-Dcft8otV.mjs";
2
2
  import { t as memory } from "./memory-CWlqhS7l.mjs";
3
3
  import { n as fakeClock, r as isFakeClock } from "./fake-hnJcJeYf.mjs";
4
4
  //#region src/app/define.ts
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as sfx, $t as worldPlugin, A as types_exports$7, At as Glow, B as defineMotion, Bt as Animation, C as types_exports$14, Ct as messageDuration, D as types_exports$10, Dt as Blur, E as types_exports$11, Et as Alpha, F as types_exports$2, Ft as audioPlugin, G as external, Gt as MONITOR_SECTIONS, H as platformPlugin, Ht as rendererPlugin, I as types_exports$1, It as scenesPlugin, J as mark, Jt as PERF_LOG_VERSION, K as frames, Kt as PERF_CAUSES, L as types_exports, Lt as assetsPlugin, M as types_exports$5, Mt as Outline, N as types_exports$4, Nt as defineFilter, O as types_exports$9, Ot as ColorMatrix, P as types_exports$3, Pt as debugPlugin, Q as set, Qt as DEMAND_REASONS, R as uiPlugin, Rt as animPlugin, S as types_exports$15, St as messageArgument, T as types_exports$12, Tt as Emitter, U as HAPTIC_KINDS, Ut as PASS_KINDS, V as textPlugin, Vt as Frames, W as defineAnimation, Wt as frameAt, X as play, Xt as SHADER_WHATS, Y as parallel, Yt as PROBLEM_RULES, Z as sequence, Zt as CANVAS_RESTARTS, _ as defineBundles, _t as Tappable, a as cubicBezier, an as to, at as use, b as types_exports$17, bt as Traced, c as hint, cn as SaveUnreadableError, ct as Draggable, d as defineScene, dn as clockPlugin, dt as Hovered, en as flowPlugin, et as spawn, f as tr, ft as Pointer, g as music, gt as Swipeable, h as defineEmitter, ht as Pressed, i as screen, in as slot, it as tween, j as types_exports$6, jt as Noise, k as types_exports$8, kt as Displacement, l as schedule, ln as lifecyclePlugin, lt as DropTarget, m as flattenFeatures, mt as Pressable, n as createPlugin, nn as contribution, nt as stagger, o as defineEffect, on as type, ot as wait, p as defineFeature, pt as PointerOver, q as haptic, qt as PERF_GAP_BUCKETS, r as defineGame, rn as exit, rt as stopSfx, s as guide, sn as modelPlugin, st as inputPlugin, t as createApp, tt as spawned, u as projection, un as timePlugin, ut as Held, v as load, vt as Touchable, w as types_exports$13, wt as effectsPlugin, x as types_exports$16, xt as i18nPlugin, y as ready, yt as Traceable, z as resolve, zt as AnimPlayer } from "./src-DX2UW8sT.mjs";
1
+ import { $ as sfx, $t as worldPlugin, A as types_exports$7, At as Glow, B as defineMotion, Bt as Animation, C as types_exports$14, Ct as messageDuration, D as types_exports$10, Dt as Blur, E as types_exports$11, Et as Alpha, F as types_exports$2, Ft as audioPlugin, G as external, Gt as MONITOR_SECTIONS, H as platformPlugin, Ht as rendererPlugin, I as types_exports$1, It as scenesPlugin, J as mark, Jt as PERF_LOG_VERSION, K as frames, Kt as PERF_CAUSES, L as types_exports, Lt as assetsPlugin, M as types_exports$5, Mt as Outline, N as types_exports$4, Nt as defineFilter, O as types_exports$9, Ot as ColorMatrix, P as types_exports$3, Pt as debugPlugin, Q as set, Qt as DEMAND_REASONS, R as uiPlugin, Rt as animPlugin, S as types_exports$15, St as messageArgument, T as types_exports$12, Tt as Emitter, U as HAPTIC_KINDS, Ut as PASS_KINDS, V as textPlugin, Vt as Frames, W as defineAnimation, Wt as frameAt, X as play, Xt as SHADER_WHATS, Y as parallel, Yt as PROBLEM_RULES, Z as sequence, Zt as CANVAS_RESTARTS, _ as defineBundles, _t as Tappable, a as cubicBezier, an as to, at as use, b as types_exports$17, bt as Traced, c as hint, cn as SaveUnreadableError, ct as Draggable, d as defineScene, dn as clockPlugin, dt as Hovered, en as flowPlugin, et as spawn, f as tr, ft as Pointer, g as music, gt as Swipeable, h as defineEmitter, ht as Pressed, i as screen, in as slot, it as tween, j as types_exports$6, jt as Noise, k as types_exports$8, kt as Displacement, l as schedule, ln as lifecyclePlugin, lt as DropTarget, m as flattenFeatures, mt as Pressable, n as createPlugin, nn as contribution, nt as stagger, o as defineEffect, on as type, ot as wait, p as defineFeature, pt as PointerOver, q as haptic, qt as PERF_GAP_BUCKETS, r as defineGame, rn as exit, rt as stopSfx, s as guide, sn as modelPlugin, st as inputPlugin, t as createApp, tt as spawned, u as projection, un as timePlugin, ut as Held, v as load, vt as Touchable, w as types_exports$13, wt as effectsPlugin, x as types_exports$16, xt as i18nPlugin, y as ready, yt as Traceable, z as resolve, zt as AnimPlayer } from "./src-Dcft8otV.mjs";
2
2
  import { $ as Layer, B as Display, C as defineStyle, E as bind, G as Parent, H as NineSlice, J as Transform, K as Shape, O as defineTextStyles, Q as Exiting, S as defineTokens, T as Text, U as Overlay, V as HudPart, Z as sprite, _ as ScrollState, at as resource, b as popup, ct as tag, d as Box, et as Now, h as LocalWrite, it as mut, k as label, nt as Tree, ot as system, p as DebugTrigger, q as Sprite, rt as component, tt as Order, w as Countdown } from "./visual-B7TxMv1J.mjs";
3
3
  import { t as defineComponent } from "./component-DGg5DqKK.mjs";
4
4
  export { Alpha, types_exports as Anim, AnimPlayer, Animation, types_exports$1 as Assets, types_exports$2 as Audio, Blur, Box, CANVAS_RESTARTS, types_exports$3 as Clock, ColorMatrix, Countdown, DEMAND_REASONS, types_exports$4 as Debug, DebugTrigger, Displacement, Display, Draggable, DropTarget, types_exports$5 as Effects, Emitter, Exiting, types_exports$6 as Flow, Frames, Glow, HAPTIC_KINDS, Held, Hovered, HudPart, types_exports$7 as I18n, types_exports$8 as Input, Layer, types_exports$9 as Lifecycle, LocalWrite, MONITOR_SECTIONS, types_exports$10 as Model, NineSlice, Noise, Now, Order, Outline, Overlay, PASS_KINDS, PERF_CAUSES, PERF_GAP_BUCKETS, PERF_LOG_VERSION, PROBLEM_RULES, Parent, types_exports$11 as Platform, Pointer, PointerOver, Pressable, Pressed, types_exports$12 as Renderer, SHADER_WHATS, SaveUnreadableError, types_exports$13 as Scenes, ScrollState, Shape, Sprite, Swipeable, Tappable, Text, types_exports$14 as TextTypes, types_exports$15 as Time, Touchable, Traceable, Traced, Transform, Tree, types_exports$16 as Ui, types_exports$17 as World, animPlugin, assetsPlugin, audioPlugin, bind, clockPlugin, component, contribution, createApp, createPlugin, cubicBezier, debugPlugin, defineAnimation, defineBundles, defineComponent, defineEffect, defineEmitter, defineFeature, defineFilter, defineGame, defineMotion, defineScene, defineStyle, defineTextStyles, defineTokens, effectsPlugin, exit, external, flattenFeatures, flowPlugin, frameAt, frames, guide, haptic, hint, i18nPlugin, inputPlugin, label, lifecyclePlugin, load, mark, messageArgument, messageDuration, modelPlugin, music, mut, parallel, platformPlugin, play, popup, projection, ready, rendererPlugin, resolve, resource, scenesPlugin, schedule, screen, sequence, set, sfx, slot, spawn, spawned, sprite, stagger, stopSfx, system, tag, textPlugin, timePlugin, to, tr, tween, type, uiPlugin, use, wait, worldPlugin };
@@ -17191,7 +17191,10 @@ function createHostApi(ctx, deps) {
17191
17191
  if (!state.ready || app === void 0) return void 0;
17192
17192
  return extractStage(ctx, app, hidden);
17193
17193
  },
17194
- resolution: () => state.app?.renderer.resolution ?? 1,
17194
+ resolution: () => {
17195
+ const app = state.app;
17196
+ return app === void 0 ? 1 : app.renderer.resolution;
17197
+ },
17195
17198
  textures: () => {
17196
17199
  const app = state.app;
17197
17200
  if (!state.ready || app === void 0) return {
@@ -18758,26 +18761,15 @@ const BEFORE = {
18758
18761
  shown: false
18759
18762
  };
18760
18763
  /**
18761
- * The resolution one filter draws at: its own, or the target's for `"inherit"` (Pixi's own rule).
18762
- *
18763
- * @param filter - The filter.
18764
- * @param resolution - The target's resolution.
18765
- * @returns Texels per CSS px.
18766
- */
18767
- function resolutionOf$1(filter, resolution) {
18768
- const own = filter.resolution;
18769
- return own === "inherit" ? resolution : own;
18770
- }
18771
- /**
18772
18764
  * Reads what the enabled filters of a stack draw with: how many, the smallest resolution, the padding sum Pixi
18773
- * pads by (whole pixels), and the alpha they multiply by while every one is an `AlphaFilter`.
18765
+ * pads by (whole pixels), and the alpha they multiply by while every one is an `AlphaFilter`. A filter on `"inherit"`
18766
+ * draws at the renderer resolution (Pixi's own rule), the one `markAlphaDue` wrote to `NOW`.
18774
18767
  *
18775
18768
  * @param slots - The record's slots.
18776
- * @param resolution - The renderer resolution.
18777
18769
  * @param alphaFilter - Pixi's `AlphaFilter` class.
18778
18770
  * @param into - Where the numbers go.
18779
18771
  */
18780
- function readStack(slots, resolution, alphaFilter, into) {
18772
+ function readStack(slots, alphaFilter, into) {
18781
18773
  let enabled = 0;
18782
18774
  let rs = Number.POSITIVE_INFINITY;
18783
18775
  let padding = 0;
@@ -18788,12 +18780,13 @@ function readStack(slots, resolution, alphaFilter, into) {
18788
18780
  if (filter === void 0 || !filter.enabled) continue;
18789
18781
  enabled += 1;
18790
18782
  passes += slots[index]?.passes ?? 0;
18791
- rs = Math.min(rs, resolutionOf$1(filter, resolution));
18783
+ const own = filter.resolution;
18784
+ rs = own === "inherit" ? Math.min(rs, NOW.r) : Math.min(rs, own);
18792
18785
  padding += filter.padding;
18793
18786
  alpha *= filter instanceof alphaFilter ? filter.alpha : NaN;
18794
18787
  }
18795
18788
  into.enabled = enabled;
18796
- into.rs = enabled === 0 ? resolution : rs;
18789
+ into.rs = enabled === 0 ? NOW.r : rs;
18797
18790
  into.P = Math.trunc(padding);
18798
18791
  into.alpha = alpha;
18799
18792
  into.passes = passes;
@@ -18803,22 +18796,11 @@ function readStack(slots, resolution, alphaFilter, into) {
18803
18796
  * padding, at the renderer resolution. The quad then draws the picture itself at that alpha, as Pixi's alpha pass
18804
18797
  * draws its input: no stage 3, no pass when the alpha changes.
18805
18798
  *
18806
- * @param now - This frame's numbers.
18807
- * @returns True when it does.
18808
- */
18809
- function drawsDirect(now) {
18810
- return drawsDirectAt(now, now.r);
18811
- }
18812
- /**
18813
- * Tells whether a stack draws direct at a renderer resolution (F54): every enabled filter an `AlphaFilter`, no
18814
- * padding, at that resolution.
18815
- *
18816
18799
  * @param stack - The stack's numbers.
18817
- * @param resolution - The renderer resolution.
18818
18800
  * @returns True when it does.
18819
18801
  */
18820
- function drawsDirectAt(stack, resolution) {
18821
- return !Number.isNaN(stack.alpha) && stack.P === 0 && stack.rs === resolution;
18802
+ function drawsDirect(stack) {
18803
+ return !Number.isNaN(stack.alpha) && stack.P === 0 && stack.rs === NOW.r;
18822
18804
  }
18823
18805
  /**
18824
18806
  * Tells whether a take the budget refused still does not fit (P6.3); the pool's bytes are the take's to have (F119).
@@ -20205,22 +20187,23 @@ function stepCalm(kctx, record) {
20205
20187
  * Marks, before the step, the live records drawn direct that may be taken in this flush (F114): eligible, nothing
20206
20188
  * changed under them. An alpha take costs one pass and its live draw two, so while one is due no other first take
20207
20189
  * happens in this frame. A record due once that did not end its step kept is not due again until a change under it.
20208
- * The others drawn live are counted: a first take among a crowd of them is not spread (F119).
20190
+ * The others drawn live are counted: a first take among a crowd of them is not spread (F119). The resolution of the
20191
+ * flush is read here, once, for every record it steps.
20209
20192
  *
20210
20193
  * @param kctx - The kept context.
20211
20194
  * @param pixi - The module that draws.
20212
20195
  */
20213
20196
  function markAlphaDue(kctx, pixi) {
20214
20197
  const { state } = kctx;
20215
- const resolution = kctx.host.resolution();
20198
+ NOW.r = kctx.host.resolution();
20216
20199
  state.alphaDue = false;
20217
20200
  state.liveWaiting = 0;
20218
20201
  for (let index = 0; index < state.records.length; index += 1) {
20219
20202
  const record = state.records[index];
20220
20203
  const view = record === void 0 ? void 0 : kctx.ctx.state.sync.views.get(record.entity);
20221
20204
  if (record === void 0 || view === void 0 || !mayBeDue(kctx, record)) continue;
20222
- readStack(record.slots, resolution, pixi.AlphaFilter, DUE);
20223
- const direct = drawsDirectAt(DUE, resolution);
20205
+ readStack(record.slots, pixi.AlphaFilter, DUE);
20206
+ const direct = drawsDirect(DUE);
20224
20207
  record.alphaDue = direct && eligible(kctx, record, view, DUE) === 0;
20225
20208
  state.alphaDue ||= record.alphaDue;
20226
20209
  if (!direct && drawnLive(kctx, record)) state.liveWaiting += 1;
@@ -20257,8 +20240,7 @@ function stepRecord(kctx, pixi, matrices, record, view) {
20257
20240
  record.displays = void 0;
20258
20241
  record.idleSeen = false;
20259
20242
  }
20260
- NOW.r = kctx.host.resolution();
20261
- readStack(record.slots, NOW.r, pixi.AlphaFilter, NOW);
20243
+ readStack(record.slots, pixi.AlphaFilter, NOW);
20262
20244
  const why = eligible(kctx, record, view, NOW);
20263
20245
  if (why === 0) stepEligible(kctx, pixi, matrices, record, view);
20264
20246
  else stepIneligible(kctx, record, view, why);
@@ -20338,7 +20320,7 @@ function takenAfterInner(pixi, above) {
20338
20320
  const { key } = above;
20339
20321
  const drawn = drawnResolution(key, above.direct);
20340
20322
  if (above.mode !== "kept" || drawn >= NOW.r || key[KEY.rs] !== drawn) return false;
20341
- readStack(above.slots, NOW.r, pixi.AlphaFilter, DUE);
20323
+ readStack(above.slots, pixi.AlphaFilter, DUE);
20342
20324
  return above.direct || DUE.rs === NOW.r;
20343
20325
  }
20344
20326
  /**
package/dist/testing.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { m as flattenFeatures, on as type, rn as exit, t as createApp, tn as refuseStart } from "./src-DX2UW8sT.mjs";
1
+ import { m as flattenFeatures, on as type, rn as exit, t as createApp, tn as refuseStart } from "./src-Dcft8otV.mjs";
2
2
  import { n as saveOf, t as memory } from "./memory-CWlqhS7l.mjs";
3
3
  import { n as fakeClock } from "./fake-hnJcJeYf.mjs";
4
4
  import { i as stepFrames, r as runRepro, t as createHeadless } from "./headless-CCiUwvlp.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moku-labs/game",
3
- "version": "0.15.82",
3
+ "version": "0.15.83",
4
4
  "description": "2D puzzle game engine on TypeScript and PixiJS, built on @moku-labs/core.",
5
5
  "type": "module",
6
6
  "sideEffects": [