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
Airbnbwith some customization, see.eslintrc. - test (mocha and chai --in-progress)
- dev server with live-reload and auto port finder
- simple
SHOW_ALLstyle stretch mode - Auto spritesheet with spritesmith
- Image optimization on build
- streamlined assets loading
- modular development setup
- Facebook instant setup
- Prepare:
npm installoryarn install - Development:
npm startoryarn start - Build:
npm run build:weboryarn 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.jsfor 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
Globalin 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.jsto modify and control project setup. - any custom object, class, function included in
src/utils/index.jsis 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.
aliasare available inwebpack.common.jsandjsconfig.jsonfile. please refer to this files for the available list or adding new ones. - Create additional build files by copying
webpack.prod.plugin.jsfor plugins andwebpack.prod.webfor game. - You can remove
package-lock.jsonfrom.gitignoreas 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 helpTo create scene
node cli scene <scene-name>To create Object
node cli obj <object-type> <object-name>To update scenes index
node cli update