@directivegames/genesys.sdk 3.2.2 → 3.2.5
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 +60 -60
- package/dist/src/asset-pack/eslint.config.js +4 -4
- package/dist/src/core/cli.js +22 -22
- package/dist/src/core/common.js +2 -2
- package/dist/src/core/tools/build-project.js +1 -1
- package/dist/src/core/tools/new-asset-pack.js +1 -1
- package/dist/src/core/tools/new-project.js +1 -1
- package/dist/src/dependencies.js +1 -1
- package/dist/src/electron/backend/tools/const.js +1 -1
- package/dist/src/electron/backend/tools/open-project.js +1 -1
- package/dist/src/templates/eslint.config.js +4 -4
- package/dist/src/templates/scripts/genesys/calc-bounding-box.js +2 -2
- package/dist/src/templates/scripts/genesys/dev/dump-default-scene.js +1 -1
- package/dist/src/templates/scripts/genesys/dev/generate-manifest.js +1 -1
- package/dist/src/templates/scripts/genesys/dev/launcher.js +1 -1
- package/dist/src/templates/scripts/genesys/dev/storage-provider.js +4 -4
- package/dist/src/templates/scripts/genesys/genesys-mcp.js +26 -26
- package/dist/src/templates/scripts/genesys/mcp/doc-tools.js +2 -2
- package/dist/src/templates/scripts/genesys/mcp/editor-functions.js +5 -5
- package/dist/src/templates/scripts/genesys/mcp/search-actors.js +1 -1
- package/dist/src/templates/scripts/genesys/mcp/search-assets.js +1 -1
- package/dist/src/templates/scripts/genesys/mcp/utils.js +1 -1
- package/dist/src/templates/scripts/genesys/misc.js +1 -1
- package/dist/src/templates/scripts/genesys/mock.js +1 -1
- package/dist/src/templates/scripts/genesys/place-actors.js +1 -1
- package/dist/src/templates/scripts/genesys/post-install.js +1 -1
- package/dist/src/templates/scripts/genesys/storageProvider.js +2 -2
- package/dist/src/templates/src/index.js +1 -1
- package/dist/src/templates/src/templates/firstPerson/src/game.js +1 -1
- package/dist/src/templates/src/templates/firstPerson/src/player.js +1 -1
- package/dist/src/templates/src/templates/fps/src/game.js +1 -1
- package/dist/src/templates/src/templates/fps/src/player.js +1 -1
- package/dist/src/templates/src/templates/fps/src/weapon.js +1 -1
- package/dist/src/templates/src/templates/freeCamera/src/game.js +1 -1
- package/dist/src/templates/src/templates/freeCamera/src/player.js +1 -1
- package/dist/src/templates/src/templates/sideScroller/src/game.js +1 -1
- package/dist/src/templates/src/templates/sideScroller/src/level-generator.js +1 -1
- package/dist/src/templates/src/templates/sideScroller/src/player.js +1 -1
- package/dist/src/templates/src/templates/thirdPerson/src/game.js +1 -1
- package/dist/src/templates/src/templates/thirdPerson/src/player.js +1 -1
- package/dist/src/templates/src/templates/vehicle/src/base-vehicle.js +1 -1
- package/dist/src/templates/src/templates/vehicle/src/game.js +1 -1
- package/dist/src/templates/src/templates/vehicle/src/mesh-vehicle.js +1 -1
- package/dist/src/templates/src/templates/vehicle/src/player.js +1 -1
- package/dist/src/templates/src/templates/vehicle/src/primitive-vehicle.js +1 -1
- package/dist/src/templates/src/templates/vehicle/src/ui-hints.js +31 -31
- package/dist/src/templates/src/templates/vr-game/src/game.js +1 -1
- package/dist/src/templates/src/templates/vr-game/src/sample-vr-actor.js +1 -1
- package/package.json +176 -176
- package/scripts/post-install.ts +143 -143
- package/src/asset-pack/.gitattributes +88 -88
- package/src/asset-pack/eslint.config.js +45 -45
- package/src/asset-pack/gitignore +11 -11
- package/src/asset-pack/scripts/postinstall.ts +81 -81
- package/src/asset-pack/tsconfig.json +33 -33
- package/src/templates/.cursor/mcp.json +20 -20
- package/src/templates/.cursorignore +2 -2
- package/src/templates/.gitattributes +88 -88
- package/src/templates/.vscode/settings.json +6 -6
- package/src/templates/AGENTS.md +86 -86
- package/src/templates/README.md +24 -24
- package/src/templates/eslint.config.js +45 -45
- package/src/templates/gitignore +11 -11
- package/src/templates/index.html +34 -34
- package/src/templates/pnpm-lock.yaml +3676 -3676
- package/src/templates/scripts/genesys/build-project.ts +51 -51
- package/src/templates/scripts/genesys/calc-bounding-box.ts +272 -272
- package/src/templates/scripts/genesys/common.ts +46 -46
- package/src/templates/scripts/genesys/const.ts +9 -9
- package/src/templates/scripts/genesys/dev/dump-default-scene.ts +11 -11
- package/src/templates/scripts/genesys/dev/generate-manifest.ts +146 -146
- package/src/templates/scripts/genesys/dev/launcher.ts +46 -46
- package/src/templates/scripts/genesys/dev/storage-provider.ts +229 -229
- package/src/templates/scripts/genesys/dev/update-template-scenes.ts +84 -84
- package/src/templates/scripts/genesys/doc-server.ts +16 -16
- package/src/templates/scripts/genesys/genesys-mcp.ts +526 -526
- package/src/templates/scripts/genesys/mcp/doc-tools.ts +86 -86
- package/src/templates/scripts/genesys/mcp/editor-functions.ts +151 -151
- package/src/templates/scripts/genesys/mcp/editor-tools.ts +73 -73
- package/src/templates/scripts/genesys/mcp/get-scene-state.ts +35 -35
- package/src/templates/scripts/genesys/mcp/run-subprocess.ts +30 -30
- package/src/templates/scripts/genesys/mcp/search-actors.ts +858 -858
- package/src/templates/scripts/genesys/mcp/search-assets.ts +380 -380
- package/src/templates/scripts/genesys/mcp/utils.ts +281 -281
- package/src/templates/scripts/genesys/misc.ts +42 -42
- package/src/templates/scripts/genesys/mock.ts +6 -6
- package/src/templates/scripts/genesys/place-actors.ts +179 -179
- package/src/templates/scripts/genesys/post-install.ts +30 -30
- package/src/templates/scripts/genesys/prefab.schema.json +84 -84
- package/src/templates/scripts/genesys/remove-engine-comments.ts +134 -134
- package/src/templates/scripts/genesys/run-mcp-inspector.bat +4 -4
- package/src/templates/scripts/genesys/storageProvider.ts +182 -182
- package/src/templates/scripts/genesys/validate-prefabs.ts +138 -138
- package/src/templates/src/index.ts +22 -22
- package/src/templates/src/templates/firstPerson/assets/default.genesys-scene +165 -165
- package/src/templates/src/templates/firstPerson/src/game.ts +39 -39
- package/src/templates/src/templates/firstPerson/src/player.ts +63 -63
- package/src/templates/src/templates/fps/assets/default.genesys-scene +9459 -9459
- package/src/templates/src/templates/fps/src/game.ts +39 -39
- package/src/templates/src/templates/fps/src/player.ts +69 -69
- package/src/templates/src/templates/fps/src/weapon.ts +54 -54
- package/src/templates/src/templates/freeCamera/assets/default.genesys-scene +165 -165
- package/src/templates/src/templates/freeCamera/src/game.ts +39 -39
- package/src/templates/src/templates/freeCamera/src/player.ts +45 -45
- package/src/templates/src/templates/sideScroller/assets/default.genesys-scene +121 -121
- package/src/templates/src/templates/sideScroller/src/const.ts +45 -45
- package/src/templates/src/templates/sideScroller/src/game.ts +122 -122
- package/src/templates/src/templates/sideScroller/src/level-generator.ts +361 -361
- package/src/templates/src/templates/sideScroller/src/player.ts +125 -125
- package/src/templates/src/templates/thirdPerson/assets/default.genesys-scene +165 -165
- package/src/templates/src/templates/thirdPerson/src/game.ts +39 -39
- package/src/templates/src/templates/thirdPerson/src/player.ts +61 -61
- package/src/templates/src/templates/vehicle/assets/default.genesys-scene +225 -225
- package/src/templates/src/templates/vehicle/src/base-vehicle.ts +145 -145
- package/src/templates/src/templates/vehicle/src/game.ts +43 -43
- package/src/templates/src/templates/vehicle/src/mesh-vehicle.ts +191 -191
- package/src/templates/src/templates/vehicle/src/player.ts +109 -109
- package/src/templates/src/templates/vehicle/src/primitive-vehicle.ts +266 -266
- package/src/templates/src/templates/vehicle/src/ui-hints.ts +101 -101
- package/src/templates/src/templates/vr-game/assets/default.genesys-scene +246 -246
- package/src/templates/src/templates/vr-game/src/auto-imports.ts +1 -1
- package/src/templates/src/templates/vr-game/src/game.ts +66 -66
- package/src/templates/src/templates/vr-game/src/sample-vr-actor.ts +26 -26
- package/src/templates/tsconfig.json +34 -34
- package/src/templates/vite.config.ts +52 -52
|
@@ -1,101 +1,101 @@
|
|
|
1
|
-
import * as ENGINE from 'genesys.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Dismissable UI component that displays control hints when the game starts
|
|
5
|
-
*/
|
|
6
|
-
@ENGINE.GameClass()
|
|
7
|
-
export class UIHints extends ENGINE.Actor {
|
|
8
|
-
private uiElement: ENGINE.UIElement | null = null;
|
|
9
|
-
|
|
10
|
-
constructor(options: ENGINE.ActorOptions = {}) {
|
|
11
|
-
super(options);
|
|
12
|
-
this.setTransient(true); // Don't save this UI element to the level
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
protected override async doBeginPlay(): Promise<void> {
|
|
16
|
-
await super.doBeginPlay();
|
|
17
|
-
this.createHUD();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
protected override doEndPlay(): void {
|
|
21
|
-
this.removeHUD();
|
|
22
|
-
super.doEndPlay();
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
private createHUD(): void {
|
|
26
|
-
const uiManager = this.world!.uiManager;
|
|
27
|
-
|
|
28
|
-
// Create the UI element using the engine's UI system
|
|
29
|
-
this.uiElement = uiManager.createElement('game-hints', {
|
|
30
|
-
style: {
|
|
31
|
-
position: 'absolute',
|
|
32
|
-
top: '50px',
|
|
33
|
-
right: '50px',
|
|
34
|
-
background: 'rgba(0, 0, 0, 0.9)',
|
|
35
|
-
color: 'white',
|
|
36
|
-
padding: '25px',
|
|
37
|
-
borderRadius: '12px',
|
|
38
|
-
fontFamily: 'Arial, sans-serif',
|
|
39
|
-
fontSize: '16px',
|
|
40
|
-
lineHeight: '1.5',
|
|
41
|
-
maxWidth: '400px',
|
|
42
|
-
border: '2px solid rgba(76, 175, 80, 0.6)',
|
|
43
|
-
boxShadow: '0 8px 32px rgba(0, 0, 0, 0.8)',
|
|
44
|
-
zIndex: '1001'
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
// Set the HTML content
|
|
49
|
-
this.uiElement.setHTML(`
|
|
50
|
-
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
|
|
51
|
-
<div style="font-weight: bold; color: #4CAF50; font-size: 18px;">
|
|
52
|
-
🎮 Vehicle Game Controls
|
|
53
|
-
</div>
|
|
54
|
-
<button id="closeHints" style="
|
|
55
|
-
background: #f44336;
|
|
56
|
-
color: white;
|
|
57
|
-
border: none;
|
|
58
|
-
border-radius: 50%;
|
|
59
|
-
width: 30px;
|
|
60
|
-
height: 30px;
|
|
61
|
-
cursor: pointer;
|
|
62
|
-
font-size: 16px;
|
|
63
|
-
font-weight: bold;
|
|
64
|
-
">×</button>
|
|
65
|
-
</div>
|
|
66
|
-
<div style="margin-bottom: 12px;">
|
|
67
|
-
<span style="color: #FFA726; font-weight: bold;">Movement:</span>
|
|
68
|
-
<br>• WASD or Arrow Keys - Move/Drive
|
|
69
|
-
<br>• Mouse - Camera control
|
|
70
|
-
</div>
|
|
71
|
-
<div style="margin-bottom: 12px;">
|
|
72
|
-
<span style="color: #FFA726; font-weight: bold;">Vehicle Interaction:</span>
|
|
73
|
-
<br>• E - Enter/Exit vehicle (when nearby)
|
|
74
|
-
<br>• F - Flip vehicle (when inside)
|
|
75
|
-
</div>
|
|
76
|
-
<div style="font-size: 14px; color: #CCCCCC; margin-top: 15px; text-align: center; font-style: italic;">
|
|
77
|
-
💡 Walk near a vehicle and press E to enter
|
|
78
|
-
</div>
|
|
79
|
-
`);
|
|
80
|
-
|
|
81
|
-
// Add close button functionality
|
|
82
|
-
const closeButton = this.uiElement.querySelector('#closeHints') as HTMLButtonElement;
|
|
83
|
-
if (closeButton) {
|
|
84
|
-
closeButton.addEventListener('click', () => {
|
|
85
|
-
this.removeHUD();
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Auto-close after 10 seconds
|
|
90
|
-
setTimeout(() => {
|
|
91
|
-
this.removeHUD();
|
|
92
|
-
}, 10000);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
private removeHUD(): void {
|
|
96
|
-
if (this.uiElement) {
|
|
97
|
-
this.uiElement.remove();
|
|
98
|
-
this.uiElement = null;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
1
|
+
import * as ENGINE from '@directivegames/genesys.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Dismissable UI component that displays control hints when the game starts
|
|
5
|
+
*/
|
|
6
|
+
@ENGINE.GameClass()
|
|
7
|
+
export class UIHints extends ENGINE.Actor {
|
|
8
|
+
private uiElement: ENGINE.UIElement | null = null;
|
|
9
|
+
|
|
10
|
+
constructor(options: ENGINE.ActorOptions = {}) {
|
|
11
|
+
super(options);
|
|
12
|
+
this.setTransient(true); // Don't save this UI element to the level
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
protected override async doBeginPlay(): Promise<void> {
|
|
16
|
+
await super.doBeginPlay();
|
|
17
|
+
this.createHUD();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
protected override doEndPlay(): void {
|
|
21
|
+
this.removeHUD();
|
|
22
|
+
super.doEndPlay();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
private createHUD(): void {
|
|
26
|
+
const uiManager = this.world!.uiManager;
|
|
27
|
+
|
|
28
|
+
// Create the UI element using the engine's UI system
|
|
29
|
+
this.uiElement = uiManager.createElement('game-hints', {
|
|
30
|
+
style: {
|
|
31
|
+
position: 'absolute',
|
|
32
|
+
top: '50px',
|
|
33
|
+
right: '50px',
|
|
34
|
+
background: 'rgba(0, 0, 0, 0.9)',
|
|
35
|
+
color: 'white',
|
|
36
|
+
padding: '25px',
|
|
37
|
+
borderRadius: '12px',
|
|
38
|
+
fontFamily: 'Arial, sans-serif',
|
|
39
|
+
fontSize: '16px',
|
|
40
|
+
lineHeight: '1.5',
|
|
41
|
+
maxWidth: '400px',
|
|
42
|
+
border: '2px solid rgba(76, 175, 80, 0.6)',
|
|
43
|
+
boxShadow: '0 8px 32px rgba(0, 0, 0, 0.8)',
|
|
44
|
+
zIndex: '1001'
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Set the HTML content
|
|
49
|
+
this.uiElement.setHTML(`
|
|
50
|
+
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;">
|
|
51
|
+
<div style="font-weight: bold; color: #4CAF50; font-size: 18px;">
|
|
52
|
+
🎮 Vehicle Game Controls
|
|
53
|
+
</div>
|
|
54
|
+
<button id="closeHints" style="
|
|
55
|
+
background: #f44336;
|
|
56
|
+
color: white;
|
|
57
|
+
border: none;
|
|
58
|
+
border-radius: 50%;
|
|
59
|
+
width: 30px;
|
|
60
|
+
height: 30px;
|
|
61
|
+
cursor: pointer;
|
|
62
|
+
font-size: 16px;
|
|
63
|
+
font-weight: bold;
|
|
64
|
+
">×</button>
|
|
65
|
+
</div>
|
|
66
|
+
<div style="margin-bottom: 12px;">
|
|
67
|
+
<span style="color: #FFA726; font-weight: bold;">Movement:</span>
|
|
68
|
+
<br>• WASD or Arrow Keys - Move/Drive
|
|
69
|
+
<br>• Mouse - Camera control
|
|
70
|
+
</div>
|
|
71
|
+
<div style="margin-bottom: 12px;">
|
|
72
|
+
<span style="color: #FFA726; font-weight: bold;">Vehicle Interaction:</span>
|
|
73
|
+
<br>• E - Enter/Exit vehicle (when nearby)
|
|
74
|
+
<br>• F - Flip vehicle (when inside)
|
|
75
|
+
</div>
|
|
76
|
+
<div style="font-size: 14px; color: #CCCCCC; margin-top: 15px; text-align: center; font-style: italic;">
|
|
77
|
+
💡 Walk near a vehicle and press E to enter
|
|
78
|
+
</div>
|
|
79
|
+
`);
|
|
80
|
+
|
|
81
|
+
// Add close button functionality
|
|
82
|
+
const closeButton = this.uiElement.querySelector('#closeHints') as HTMLButtonElement;
|
|
83
|
+
if (closeButton) {
|
|
84
|
+
closeButton.addEventListener('click', () => {
|
|
85
|
+
this.removeHUD();
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Auto-close after 10 seconds
|
|
90
|
+
setTimeout(() => {
|
|
91
|
+
this.removeHUD();
|
|
92
|
+
}, 10000);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
private removeHUD(): void {
|
|
96
|
+
if (this.uiElement) {
|
|
97
|
+
this.uiElement.remove();
|
|
98
|
+
this.uiElement = null;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|