space-game/bjsEditorPlugin/README.md
Michael Mainguy 25286c56b0
All checks were successful
Build / build (push) Successful in 1m42s
test gitea action
2026-03-03 08:00:41 -06:00

52 lines
1.4 KiB
Markdown

# Space Game BabylonJS Editor Plugin
Export BabylonJS Editor scenes to Space Game LevelConfig format.
## Installation
1. Build the plugin:
```bash
cd bjsEditorPlugin
npm install
npm run build
```
2. Install in BabylonJS Editor:
- Open BabylonJS Editor
- Edit → Preferences → Plugins
- Click "Add" and select this folder
- Apply and restart Editor
## Usage
1. Create a workspace in BabylonJS Editor
2. Copy the script components from `editorScripts/` to your workspace's `src/scenes/` folder
3. Place meshes in your scene and attach the appropriate scripts:
- `AsteroidComponent` - for asteroids
- `ShipComponent` - for player spawn point
- `SunComponent` - for the sun
- `PlanetComponent` - for planets
- `TargetComponent` - for orbit/movement targets
4. Configure properties in the Inspector panel
5. Space Game → Export Level Config...
## Script Components
The `editorScripts/` folder contains TypeScript components to use in your Editor workspace.
These expose game-specific properties (velocities, targets, etc.) in the Inspector.
## Plugin Menu
- **Export Level Config...** - Downloads level.json file
- **Export to Clipboard** - Copies JSON to clipboard
## Development
```bash
npm run watch # Watch mode for development
npm run build # Production build
```
Debug in Editor: CTRL+ALT+i to open DevTools, F5 to reload plugin.
Test gitea action