@moku-labs/game 0.15.72 → 0.15.73

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-CcqRw6N0.mjs";
1
+ import { Ft as audioPlugin, H as platformPlugin, i as screen, m as flattenFeatures, t as createApp, wt as effectsPlugin } from "./src-DDgQ9IPm.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 flowPlugin, 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 worldPlugin, 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 DEMAND_REASONS, _ as defineBundles, _t as Tappable, a as cubicBezier, an as type, at as use, b as types_exports$17, bt as Traced, c as hint, cn as lifecyclePlugin, ct as Draggable, d as defineScene, dt as Hovered, 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 to, it as tween, j as types_exports$6, jt as Noise, k as types_exports$8, kt as Displacement, l as schedule, ln as timePlugin, lt as DropTarget, m as flattenFeatures, mt as Pressable, n as createPlugin, nn as exit, nt as stagger, o as defineEffect, on as modelPlugin, ot as wait, p as defineFeature, pt as PointerOver, q as haptic, qt as PERF_GAP_BUCKETS, r as defineGame, rn as slot, rt as stopSfx, s as guide, sn as SaveUnreadableError, st as inputPlugin, t as createApp, tn as contribution, tt as spawned, u as projection, un as clockPlugin, 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-CcqRw6N0.mjs";
1
+ import { $ as sfx, $t as flowPlugin, 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 worldPlugin, 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 DEMAND_REASONS, _ as defineBundles, _t as Tappable, a as cubicBezier, an as type, at as use, b as types_exports$17, bt as Traced, c as hint, cn as lifecyclePlugin, ct as Draggable, d as defineScene, dt as Hovered, 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 to, it as tween, j as types_exports$6, jt as Noise, k as types_exports$8, kt as Displacement, l as schedule, ln as timePlugin, lt as DropTarget, m as flattenFeatures, mt as Pressable, n as createPlugin, nn as exit, nt as stagger, o as defineEffect, on as modelPlugin, ot as wait, p as defineFeature, pt as PointerOver, q as haptic, qt as PERF_GAP_BUCKETS, r as defineGame, rn as slot, rt as stopSfx, s as guide, sn as SaveUnreadableError, st as inputPlugin, t as createApp, tn as contribution, tt as spawned, u as projection, un as clockPlugin, 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-DDgQ9IPm.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, 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 };
@@ -17527,7 +17527,11 @@ function renderStage1(kctx, pixi, matrices, record) {
17527
17527
  record.s1 = s1;
17528
17528
  matrices.m1.set(key[KEY.a] ?? 1, key[KEY.b] ?? 0, key[KEY.c] ?? 0, key[KEY.d] ?? 1, (key[KEY.tx] ?? 0) - (key[KEY.X0] ?? 0), (key[KEY.ty] ?? 0) - (key[KEY.Y0] ?? 0));
17529
17529
  const group = top.isRenderGroup;
17530
- if (!kctx.host.renderTo(top, s1, matrices.m1, true)) return false;
17530
+ const alpha = top.alpha;
17531
+ if (alpha !== 1) top.alpha = 1;
17532
+ const rendered = kctx.host.renderTo(top, s1, matrices.m1, true);
17533
+ if (alpha !== 1) top.alpha = alpha;
17534
+ if (!rendered) return false;
17531
17535
  if (!group && !record.wasGroup) kctx.state.madeGroups.add(top);
17532
17536
  record.s1Version += 1;
17533
17537
  kctx.state.takesOpen += 1;
@@ -19224,7 +19228,7 @@ function placeQuad(sync, pixi, matrices, record, view) {
19224
19228
  const { top, key } = record;
19225
19229
  const parent = top.parent;
19226
19230
  const output = (record.direct ? record.s1 : record.s3) ?? pixi.Texture.EMPTY;
19227
- const alpha = record.direct ? NOW.alpha : 1;
19231
+ const alpha = (record.direct ? NOW.alpha : 1) * top.alpha;
19228
19232
  if (record.quad === void 0 || record.quad.destroyed) {
19229
19233
  record.quad = new pixi.Sprite(output);
19230
19234
  record.quad.label = `kept:${labelOf$3(top)}`;
@@ -19749,14 +19753,15 @@ function offGrid(kctx, record) {
19749
19753
  return world.a !== key[KEY.a] || world.b !== key[KEY.b] || world.c !== key[KEY.c] || world.d !== key[KEY.d] || !onGrid(world.tx - (key[KEY.tx] ?? 0), rs, r) || !onGrid(world.ty - (key[KEY.ty] ?? 0), rs, r);
19750
19754
  }
19751
19755
  /**
19752
- * Tells whether a kept record hangs under a translucent ancestor (F113): its quad draws `A·F(x)` where live draws
19753
- * `F(A·x)`, which differ by design for a filter that is not alpha-linear, not by a stale picture.
19756
+ * Tells whether a kept record is translucent, by its top's own alpha (F120) or an ancestor's (F113): its quad draws
19757
+ * `A·F(x)` where live draws `F(A·x)`, which differ by design for a filter that is not alpha-linear, not by a stale
19758
+ * picture.
19754
19759
  *
19755
19760
  * @param record - The record, kept.
19756
- * @returns True when an ancestor's alpha is under 1.
19761
+ * @returns True when the top's alpha or an ancestor's is under 1.
19757
19762
  */
19758
- function fadedAbove(record) {
19759
- for (let node = record.top.parent; node !== null; node = node.parent) if (node.alpha < 1) return true;
19763
+ function faded(record) {
19764
+ for (let node = record.top; node !== null; node = node.parent) if (node.alpha < 1) return true;
19760
19765
  return false;
19761
19766
  }
19762
19767
  /**
@@ -19848,8 +19853,8 @@ function logStale(kctx, pixels, records, ranges) {
19848
19853
  }
19849
19854
  /**
19850
19855
  * The pixel leg after a drawn frame: the picture as drawn against the same frame with every picture live. Frames in
19851
- * which a picture moves off its grid or hangs under a translucent ancestor (F113) are skipped and counted; at rest
19852
- * under opaque ancestors every picture is compared.
19856
+ * which a picture moves off its grid, is translucent itself (F120) or hangs under a translucent ancestor (F113) are
19857
+ * skipped and counted; at rest, opaque, under opaque ancestors every picture is compared.
19853
19858
  *
19854
19859
  * @param kctx - The kept context.
19855
19860
  * @param bypass - Draws every kept record live (true) or as its picture again (false).
@@ -19860,7 +19865,7 @@ function verifyPictures(kctx, bypass, recover) {
19860
19865
  const records = shownRecords(kctx);
19861
19866
  const ranges = [...state.ranges.values()].filter((range) => range.sprite !== void 0);
19862
19867
  if (records.length === 0 && ranges.length === 0) return;
19863
- if (records.some((record) => offGrid(kctx, record) || fadedAbove(record))) {
19868
+ if (records.some((record) => offGrid(kctx, record) || faded(record))) {
19864
19869
  state.verifySkipped += 1;
19865
19870
  return;
19866
19871
  }
@@ -30184,7 +30189,9 @@ function ownsAlpha(view) {
30184
30189
  * Writes the alpha of a built-in visual. It fades the entity's whole subtree: on a view with a
30185
30190
  * wrapper it goes on the wrapper, over the visual and the children, and the visual inside stays
30186
30191
  * at 1, so the alpha is applied once. A view without a wrapper keeps it on its object. Only a
30187
- * value that differs from what Pixi holds is written, and the entity is marked before. A view
30192
+ * value that differs from what Pixi holds is written, and the entity is marked before, as a move
30193
+ * of its top (F120): a kept picture of the view is taken without its top's alpha, and its quad
30194
+ * draws it at that alpha, as a move draws it at another place. A view
30188
30195
  * drawn at alpha 0, its HUD factor counted, is not drawn at all (spec 26 B9): it leaves Pixi's
30189
30196
  * build, its bounds and the passes of its filters, with its subtree.
30190
30197
  *
@@ -30198,7 +30205,7 @@ function applyAlpha(sctx, entity, view, look) {
30198
30205
  const target = view.wrapper ?? view.object;
30199
30206
  const drawn = look.alpha * view.hud;
30200
30207
  if (target.alpha !== drawn) {
30201
- markView(sctx, entity);
30208
+ markMoved(sctx, entity);
30202
30209
  target.alpha = drawn;
30203
30210
  }
30204
30211
  if (view.wrapper !== void 0 && view.object.alpha !== 1) {
package/dist/testing.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { an as type, en as refuseStart, m as flattenFeatures, nn as exit, t as createApp } from "./src-CcqRw6N0.mjs";
1
+ import { an as type, en as refuseStart, m as flattenFeatures, nn as exit, t as createApp } from "./src-DDgQ9IPm.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.72",
3
+ "version": "0.15.73",
4
4
  "description": "2D puzzle game engine on TypeScript and PixiJS, built on @moku-labs/core.",
5
5
  "type": "module",
6
6
  "sideEffects": [