- a to move left
- d to move right
- w to jump
- Hold s to clear map
- k to place block (to right if on ground, below if in air)
- l to mine block (first which exists in this order: right, below, left, above)
- s to enable mine mode
- i to enable inventory mode
- j to enable build mode
- i to place/break top
- l to place/break right
- j to place/break left
- k to place/break bottom
- s to exit mode
- j to go left
- l to go right
- s to exit mode
Install nodejs and use npm to run scripts, like so:
npm run script-name
The following scripts are available
compile
- Compiles typescript to javascriptrollup
- Bundles javascript into one fileserve
- Serves bundled javascript over httpopen
- Opens created javascript in the sprig editor. The editor will automatically reload and run your changeswatch
- Watches and rebuilds javascript on changesdev
- Runs the server and opens the editor, while also watching for changes
In most cases, you will just need to run
npm run dev
You can use this commit as a generic template to use in your own sprig project. It adds the following features to sprig:
- TypeScript support (via tsc)
- Multi-file support (via rollup)
- Live reload (via serve, open, nodemon and sprig's watch param)