mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-05-04 18:43:48 -04:00
Update README.md for make serve
and playground
This commit is contained in:
parent
34384f1563
commit
c37675fcd7
1 changed files with 11 additions and 0 deletions
11
README.md
11
README.md
|
@ -11,6 +11,7 @@ npm install https://github.com/LLK/scratch-vm.git
|
|||
```
|
||||
|
||||
## Setup
|
||||
For an extended setup example, check out the /playground directory, which includes a fully running VM instance.
|
||||
```js
|
||||
var VirtualMachine = require('scratch-vm');
|
||||
var vm = new VirtualMachine();
|
||||
|
@ -23,6 +24,16 @@ flyoutWorkspace.addChangeListener(vm.flyoutBlockListener);
|
|||
// Run threads
|
||||
vm.runtime.start();
|
||||
```
|
||||
## Development Server and Playground
|
||||
For convenience, we've included a development server with the VM. This is useful because the VM can take advantage of executing in a WebWorker, which is not permitted in a local file. To start the server, run:
|
||||
|
||||
```bash
|
||||
make serve
|
||||
```
|
||||
and go to [http://localhost:8080/](http://localhost:8080/) - you will be redirected to the playground, which demonstrates various tools and internal state.
|
||||
|
||||

|
||||
|
||||
|
||||
## Standalone Build
|
||||
```bash
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue