inventonater / roguehack

A Brunch skeleton for making games with Phaser 3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Brunch with Phaser 3

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.)

Get started

  • Install (if you don't have them):
  • Run:
    • brunch new <project> -s phaser or see Clone, below.
    • npm run start or brunch watch --server watches the project with continuous rebuild.
    • npm run build or brunch build --production builds a minified project for production.
  • Make:
    • Write your code in app.
    • Put game assets in assets.

Clone

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.

Save

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

Phaser is managed through npm.

npm ls --production

Update with:

npm update

Other builds

See the npm.static entry in brunch-config.

<<<<<<< HEAD Add packages

=======

Phaser 2 (Phaser CE)

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.

Add NPM packages

coffee

npm install -S <package-name>

and in your code:

require('package-name');

Add other libraries

Add the unminified script to vendor.

Plugins

# 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

Settings

About

A Brunch skeleton for making games with Phaser 3


Languages

Language:CoffeeScript 98.0%Language:HTML 1.2%Language:Shell 0.8%