@combos-fun/engine 0.1.15 → 0.1.17
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/agent-skill.md +16 -33
- package/dist/engine.cjs.js +1 -1
- package/dist/engine.cjs.js.map +1 -1
- package/dist/engine.cjs.prod.js +1 -1
- package/dist/engine.d.ts +1 -1
- package/dist/engine.esm.js +1 -1
- package/dist/engine.esm.js.map +1 -1
- package/package.json +4 -6
- package/references/public-api.md +0 -95
package/agent-skill.md
CHANGED
|
@@ -1,35 +1,18 @@
|
|
|
1
1
|
# `@combos-fun/engine` — Agent short card
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
2. Put single-entity behavior in Component hooks and cross-entity behavior in Systems; clean up listeners in `onDestroy`.
|
|
20
|
-
3. Bootstrap only creates and wires resources, Systems, GameObjects, and Components.
|
|
21
|
-
4. Use `static componentName` for custom Components and observers rather than ad-hoc scene scans.
|
|
22
|
-
5. Game code uses renderer plugins or registered `Renderer` / `Renderer3D` subclasses, not raw Pixi, Three, or DOM. Host-owning plugins are exceptions. Host `postMessage` types: `combos-game:*` only in this package; plugins use `combos-development-tool:*`.
|
|
23
|
-
6. Configure through constructor params; trigger runtime actions from lifecycle/event Components.
|
|
24
|
-
|
|
25
|
-
## Common pitfalls
|
|
26
|
-
|
|
27
|
-
- Prefer `game.getSystem(SystemClass)`. String lookup matches `static systemName`, not the class name.
|
|
28
|
-
- A blank canvas usually means the base renderer is missing or the game is not started; missing content usually means its renderer subsystem is absent.
|
|
29
|
-
- Register resources with `resource.addResource`; `preload` only removes first-use delay.
|
|
30
|
-
- `@Field` details belong to `@combos-fun/inspector-decorator`; engine `IDEProp` is legacy.
|
|
31
|
-
|
|
32
|
-
## See also
|
|
33
|
-
|
|
34
|
-
- [`references/public-api.md`](references/public-api.md)
|
|
35
|
-
- [`plugin-authoring.md`](plugin-authoring.md)
|
|
3
|
+
ECS microkernel. New plugins: `plugin-authoring.md`.
|
|
4
|
+
|
|
5
|
+
- `Game`, `Scene`, `GameObject`, `Component`, `System`, `resource`, `decorators`. Hierarchy: `addChild` / `parent` / `children`. 2D pose: `Transform2D`. 3D pose: `Transform3D`.
|
|
6
|
+
- `await game.addSystem(new XxxSystem(...))`. `Game({ systems })` awaits each `init`. `addSystem(XxxSystem, [params])` passes the tuple as one argument.
|
|
7
|
+
- `@decorators.componentObserver({ Name: ['prop'] })`, then `componentObserver.clear()` in `update()`.
|
|
8
|
+
- Order: `Component.update` → `Component.lateUpdate` → `System.update` → `System.lateUpdate`. `start()` runs on the first tick.
|
|
9
|
+
- Per-entity state on Components, so destroying a GameObject removes it. Cross-entity work in Systems. Remove listeners in `onDestroy`.
|
|
10
|
+
- Bootstrap only wires resources, Systems, GameObjects, and Components. Configure in the constructor; act from lifecycle or events.
|
|
11
|
+
- Custom Components set `static componentName`. Do not scan the scene for them.
|
|
12
|
+
- Use renderer plugins or a registered `Renderer` / `Renderer3D`. Host-owned plugins may touch raw Pixi, Three, or DOM. Host messages: `combos-game:*` only here; plugins use `combos-development-tool:*`.
|
|
13
|
+
- `game.getSystem(SystemClass)`. String form is `static systemName`, not the class name.
|
|
14
|
+
- Scene: `game.scene`.
|
|
15
|
+
- Component `game` is a getter (`gameObject?.scene?.game`), after the GameObject is in the scene. System `game` is set in `addSystem`.
|
|
16
|
+
- `componentObserver.clear()` events may omit `gameObject`.
|
|
17
|
+
- `resource.addResource`. Each `src` slot is a url string or `{ type, url }`. `preload` only removes first-use delay.
|
|
18
|
+
- Inspector fields: `@Field` from `@combos-fun/inspector-decorator`. Engine `IDEProp` is legacy.
|
package/dist/engine.cjs.js
CHANGED