Project development setup for Phaser 3.
- Asset management
- Auto spritesheet
- Code hinting
- Custom Class (global scope)
- custom phaser import
- Image optimization on build
- Auto zip on build
- Easily change setup configure with
config.dev.js
- eslint
Airbnb
with some customization, see.eslintrc
. - test (mocha and chai --in-progress)
- dev server with live-reload and auto port finder
- simple
SHOW_ALL
style stretch mode - Auto spritesheet with spritesmith
- Image optimization on build
- streamlined assets loading
- modular development setup
- Facebook instant setup
- Prepare:
npm install
oryarn install
- Development:
npm start
oryarn start
- Build:
npm run build:web
oryarn run build:web
- Update Phaser:
npm run update:phaser
- Master (Main)
- FB (facebook instant) (Deprecated)
- 'assets/' => for external assets and spritesheet source (see
config.dev.js
for more information) - configs/
- 'config.dev.js' => for development setup options
- plugins/ => Place all the plugin files or build your own here.
- 'src/' => here is your working folder for actual game creation
- 'assets/' => put all the assets in this folder to load in
assets.json
- 'objects/' => think of it as your prefab assets
- 'scene/' => all the game scene
- 'utils/' => helper functions
- customs => all your custom classes or function
- 'assets.json' => configure this to load all the assets
- 'config.js' => configure phaser
- 'global' => available as
Global
in all files - 'main.js' => phaser initialization
- 'assets/' => put all the assets in this folder to load in
- 'index.html' => no need to touch it! but this is your main html
** fb instant (outdated)
- config.json => for fb instant development
- fbapp-config.json => for fb messenger settings
- use
config.dev.js
to modify and control project setup. - any custom object, class, function included in
src/utils/index.js
is accessible in global(window) scope asCustoms
- first change package.json, title and version to reflect your project.
- choose which phaser module to load in
src/main.js
. - set format on save in your editor(i.e. vscode) to auto format based on prettier.
- No need to use full path when accessing files.
alias
are available inwebpack.common.js
andjsconfig.json
file. please refer to this files for the available list or adding new ones. - Create additional build files by copying
webpack.prod.plugin.js
for plugins andwebpack.prod.web
for game. - You can remove
package-lock.json
from.gitignore
as recommended by NPM in your game projects.
there are number of option available in ./cli.js you can extend it's functionality as you want.
For help
node cli help
To create scene
node cli scene <scene-name>
To create Object
node cli obj <object-type> <object-name>
To update scenes index
node cli update