@energy8platform/game-engine 0.27.2 → 0.29.0
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/README.md +49 -69
- package/dist/host.cjs.js +2 -1
- package/dist/host.cjs.js.map +1 -1
- package/dist/host.d.ts +7 -0
- package/dist/host.esm.js +2 -1
- package/dist/host.esm.js.map +1 -1
- package/dist/vite.cjs.js +7 -6
- package/dist/vite.cjs.js.map +1 -1
- package/dist/vite.d.ts +5 -1
- package/dist/vite.esm.js +7 -6
- package/dist/vite.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/host/overlayController.ts +5 -1
- package/src/host/sceneController.ts +4 -0
- package/src/index.ts +2 -2
- package/src/vite/index.ts +15 -6
package/src/index.ts
CHANGED
|
@@ -73,9 +73,9 @@ export type { DevBridgeConfig, ReplayConfig, ReplayLaunch } from '@energy8platfo
|
|
|
73
73
|
export { FPSOverlay } from './debug/FPSOverlay';
|
|
74
74
|
|
|
75
75
|
// ─── Lua ────────────────────────────────────────────────
|
|
76
|
-
//
|
|
76
|
+
// (математика — SpinML/e8; fengari удалён из platform-core)
|
|
77
77
|
// import { LuaEngine } from '@energy8platform/game-engine/lua'
|
|
78
|
-
//
|
|
78
|
+
// (математика — SpinML/e8; fengari удалён из platform-core)
|
|
79
79
|
export type {
|
|
80
80
|
GameDefinition,
|
|
81
81
|
ActionDefinition,
|
package/src/vite/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { UserConfig, Plugin } from 'vite';
|
|
2
|
-
import { devBridgePlugin,
|
|
2
|
+
import { devBridgePlugin, spinPlugin } from '@energy8platform/platform-core/vite';
|
|
3
3
|
|
|
4
4
|
// Re-export so users importing from `@energy8platform/game-engine/vite`
|
|
5
5
|
// can still grab the plugins directly without a separate platform-core import.
|
|
6
|
-
export { devBridgePlugin,
|
|
6
|
+
export { devBridgePlugin, spinPlugin } from '@energy8platform/platform-core/vite';
|
|
7
7
|
|
|
8
8
|
// ─── Types ───────────────────────────────────────────────
|
|
9
9
|
|
|
@@ -17,6 +17,12 @@ export interface GameConfig {
|
|
|
17
17
|
/** Path to DevBridge config file (default: './dev.config.ts') */
|
|
18
18
|
devBridgeConfig?: string;
|
|
19
19
|
|
|
20
|
+
/** Path to the game's .spin math (default: './src/game/script.spin'). */
|
|
21
|
+
spinScript?: string;
|
|
22
|
+
|
|
23
|
+
/** Game id for the spin dev server (default: first loaded game). */
|
|
24
|
+
gameId?: string;
|
|
25
|
+
|
|
20
26
|
/** Additional Vite config to merge */
|
|
21
27
|
vite?: UserConfig;
|
|
22
28
|
}
|
|
@@ -53,7 +59,13 @@ export function defineGameConfig(config: GameConfig = {}): UserConfig {
|
|
|
53
59
|
if (config.devBridge) {
|
|
54
60
|
const configPath = config.devBridgeConfig ?? './dev.config';
|
|
55
61
|
plugins.push(devBridgePlugin(configPath));
|
|
56
|
-
|
|
62
|
+
// e8-server ведёт раунды и hot-reload .spin (математика — SpinML)
|
|
63
|
+
plugins.push(
|
|
64
|
+
spinPlugin({
|
|
65
|
+
spinPath: config.spinScript ?? './src/game/script.spin',
|
|
66
|
+
gameId: config.gameId,
|
|
67
|
+
}),
|
|
68
|
+
);
|
|
57
69
|
}
|
|
58
70
|
|
|
59
71
|
const userVite = config.vite ?? {};
|
|
@@ -97,9 +109,6 @@ export function defineGameConfig(config: GameConfig = {}): UserConfig {
|
|
|
97
109
|
include: [
|
|
98
110
|
'pixi.js',
|
|
99
111
|
],
|
|
100
|
-
exclude: [
|
|
101
|
-
'fengari',
|
|
102
|
-
],
|
|
103
112
|
esbuildOptions: {
|
|
104
113
|
target: 'esnext',
|
|
105
114
|
},
|