A Yeoman generator for Phaser web games, featuring a live development environment with Babel, BrowserSync, Browserify and much more.
Projects created with this generator come with:
-
Gulp task manager, to handle development and distribution tasks, with alternative npm scripts provided.
-
BrowserSync for cross-device testing.
-
Browserify for easier management of components and dependencies.
-
Babel to compile ECMAScript 2015 scripts (or future specs) into scripts compatible with today's browsers. Check which language features are currently supported.
-
ESLint for code quality check.
-
EditorConfig support, for consistent editor configuration between collaborators โ check if EditorConfig support is available for your code editor.
-
Customizable scripts for automated Audio Sprites generation (Requires FFMpeg).
The sample project is based on phaser-plus-template
. Both generator
and sample project are regularly updated with improvements and bug fixes.
First, you need a properly installed and configured Node.js environment, with npm available.
To install generator-phaser-plus
(and Yeoman, if you didn't already), enter
the following commands on a terminal:
npm install --global yo # To install Yeoman.
npm install --global generator-phaser-plus # To install this generator.
Optionally, install Gulp to handle the tasks of your created projects.
npm install --global gulp # Install Gulp task manager.
Start by creating a new directory to host your new project and, inside it, run
generator-phaser-plus
, issuing the following commands, like in the example
below:
mkdir my-project && cd $_
yo phaser-plus
A brief questionnaire asking details about your new project should appear. Answer the questions to proceed with the project creation. The generator will take care of installing all project dependencies for you automatically.
After that, you can begin testing your new project right away issuing the following command:
npm start # Or simply `gulp`.
Some preset sub-generators are provided, aiding in some common development tasks.
yo phaser-plus:<sub-generator>
The following sub-generators are available, performing tasks as described:
object
: Helps creating game objects from a set of base classes.plugin
: A boilerplate for your own Phaser plug-ins.state
: GeneratesPhaser.State
classes.
Source code distributed under the terms of the MIT License.