A Brunch skeleton for making games with Phaser 3. (Why Brunch?)
You can use CoffeeScript, ES6, TypeScript, or plain JavaScript.
brunch new <project> -s phaser
(For Phaser 2 [CE], please see brunch-phaser2.)
- Install (if you don't have them):
- Run:
brunch new <project> -s phaser
or see Clone, below.npm run start
orbrunch watch --server
watches the project with continuous rebuild.npm run build
orbrunch build --production
builds a minified project for production.
- Make:
If you'd like to start with a sample written in CoffeeScript, ES6, or TypeScript, create your new project by cloning this repository instead:
# Choose one:
git clone https://github.com/samme/brunch-phaser.git --branch coffee
git clone https://github.com/samme/brunch-phaser.git --branch es6
I'll update the typescript branch when the Phaser 3 type definitions are published.
You can make your own local skeleton:
# Choose a BRANCH (or use master)
git clone https://github.com/samme/brunch-phaser.git brunch-phaser --branch BRANCH
cd brunch-phaser
# If you used a non-master branch, merge it into master:
git merge BRANCH
# If you make changes, commit them to master:
git commit # etc.
# Now you can use your own skeleton:
brunch new <project> -s ./path/to/brunch-phaser
Phaser is managed through npm.
npm ls --production
Update with:
npm update
See the npm.static
entry in brunch-config.
=======
Instead of brunch new
, run:
git clone https://github.com/samme/brunch-phaser.git project --branch phaser2
For custom builds, see npm.static
in brunch-config.
coffee
npm install -S <package-name>
and in your code:
require('package-name');
Add the unminified script to vendor.
# List
npm list --dev --depth=0
# Add (http://brunch.io/plugins)
npm install -D plugin-name
# Remove, e.g.,
npm uninstall -D babel-brunch brunch-typescript coffee-script-brunch