|
| 1 | +# Excalibur Studio and Playground |
| 2 | + |
| 3 | +This is the current implementation of the Excalibur Playground for sharing small game examples via links! |
| 4 | + |
| 5 | +## Project Goals |
| 6 | + |
| 7 | +* Eventually we want this to become the Excalibur Studio (a full fledged editor like Godot!) as well as the Playground |
| 8 | +* Drag and drop Actors/Entities |
| 9 | +* More Terse Built-in Examples |
| 10 | + |
| 11 | + |
| 12 | +## Developing Locally |
| 13 | + |
| 14 | +### Initial setup |
| 15 | + |
| 16 | +* From the root of the project, run `npm install` |
| 17 | +* Navigate to the `playground` directory, run `npm install` |
| 18 | +* Still within the `playground` directory, generate the Excalibur engine types: |
| 19 | + |
| 20 | +```sh |
| 21 | +npm run build:types |
| 22 | +``` |
| 23 | + |
| 24 | +### Day to day development |
| 25 | + |
| 26 | +* Navigate to the `playground` directory |
| 27 | +* Run `npm start` |
| 28 | + |
| 29 | +### Building locally |
| 30 | + |
| 31 | +The Playground lives as a standalone app at https://excaliburjs.com/playground/ , while the main site, running at https://excaliburjs.com is built with Docusaurus. |
| 32 | +The routing to the Playground is handled with Cloudflare rules. |
| 33 | + |
| 34 | +Because of this, care needs to be taken with pathing to static assets within the Playground, such as images and javascript. |
| 35 | +A [relative base](https://vite.dev/guide/build#relative-base) is configured in `vite.config.ts` to handle most typical scenarios. |
| 36 | + |
| 37 | +You can test that the built Playground operates correctly in a subdirectory: |
| 38 | + |
| 39 | +```sh |
| 40 | +# build to `dist/playground`, instead of the default `playground` |
| 41 | +npm run build:dev |
| 42 | + |
| 43 | +# serve the locally built version on http://localhost:8080/playground |
| 44 | +npx http-server dist |
| 45 | +``` |
| 46 | + |
| 47 | +Open [http://localhost:8080/playground](http://localhost:8080/playground) and ensure styles, scripts, and assets load correctly. |
| 48 | + |
| 49 | +### Production |
| 50 | + |
| 51 | +In production, the `BASE_URL` is overridden to route requests properly to `https://excaliburjs.com/playground`. |
| 52 | + |
| 53 | +You can also test this locally: |
| 54 | + |
| 55 | +```sh |
| 56 | +BASE_URL=/playground npm start |
| 57 | +``` |
| 58 | + |
| 59 | + |
| 60 | +## Contribution Wishlist |
| 61 | + |
| 62 | +* Support multiple versions of Excalibur (maybe even in progress branches?) |
| 63 | +* Auto save to the URL on keyup |
| 64 | +* Multiple file tree |
| 65 | +* Implement Asset Allow List (think similar to ShaderToy) |
| 66 | +* Save to local storage (and maybe to disk in the future) |
| 67 | +* Migrate html/js to [Lit HTML](https://lit.dev/) components, Shoelace is https://shoelace.style/ |
| 68 | + - Example: [Excalibur Dev Tools Browser Extension Repo](https://github.com/excaliburjs/excalibur-extension.git) |
| 69 | +* Add more debug tools to interface |
| 70 | + - Bonus points: Refactor the dev tools browser extension to be embeddable into HTML |
| 71 | + |
0 commit comments