HIGHLY EXPERIMENTAL! A Slush generator for Phaser web game projects, packed with lots of good features.
Every project created with this generator includes the following tool-set:
-
Gulp, a popular task manager and build streaming, to handle development and distribution tasks.
-
Browserify support for easier management of components and dependency tracking.
-
BrowserSync development server, for cross-device testing.
-
EditorConfig support, for consistent editor configuration between collaborators โ check if EditorConfig is available for your code editor.
-
ESLint for code style and quality check.
-
Babel to translate from ES6 to ES5 syntax. See which language features are currently supported.
-
Handlebars templates, LESS style sheets, source maps and more!
The generated sample project is based on my phaser-plus-template
and,
using this generator, you always get a working project similar to that. In
fact, that project began before slush-phaser-plus
, and it is regularly
updated with improvements and bug fixes. If you have questions regarding the
sample project or want to contribute with suggestions or bug fixes, feel free
to ask there.
Firstly, you need a development environment compatible with Node.js
properly
installed and configured in your system to use with this generator. After that,
use npm
to install slush-phaser-plus
(and slush
, if you didn't already),
issuing the following commands on a terminal emulator:
npm install --global slush # To install `slush`.
npm install --global slush-phaser-plus # To install this generator.
Also, it's a good idea to have these installed too, as you may find them useful later:
npm install --global gulp # A task manager and streaming build system.
Start by creating a new directory to host your new project contents and go
inside it, then run slush-phaser-plus
, issuing the following commands, like
in the example below:
mkdir my-project # Note: Replace 'my-project' with whatever you like.
cd my-project
slush phaser-plus
A brief questionnaire, asking you some details about your soon-to-be new game
project, should appear. Answer every question to proceed with the project
creation. slush-phaser-plus
will take care of installing all project
dependencies for you automatically.
slush-phaser-plus
comes with some preset sub-generators to aid you in some
common game development tasks with Phaser. To use any of these, just run
slush-phaser-plus
as you would, appending the name of your desired
sub-generator.
$ slush phaser-plus:<sub-generator>
The following sub-generators are available, performing the tasks as described:
state
: GeneratesPhaser.State
classes.object
: Helps creating game objects from a set of base classes.plugin
: A boilerplate for your own Phaser plug-ins.
Source code distributed under the terms of the MIT License.
Slush is a tool that uses Gulp for project scaffolding.
Slush does not contain anything "out of the box", except the ability to locate
installed slush generators and to run them with liftoff
.
To find out more about Slush, check out the documentation.