generator-phaser

A yeoman generator for phaser games

Github stars Tracking Chart

generator-phaser

A Yeoman generator to create HTML5 games with Phaser. This generator allows for the creation of Phaser games with best practices. The main generator (yo phaser) outputs a basic Phaser game. You can also generate new prefabs (yo phaser:prefab) or states (yo phaser:state) to add to your project.

You can view your game in the browser by running npm start from the project's root directory and the web page will refresh as you save your files.

When you are ready to publish, build your game with npm run build and view the output in the build/ folder. The build process minifies and compresses individual files into one file for faster network downloading, the source code is transpiled to ES5 compatible JavaScript using Babel.

INSTRUCTIONS

  • Install Node.js

  • Install the required npm modules by issuing these commands:

    npm install -g yo generator-phaser

  • Create a new directory for your game:

    • Unix/OSX : mkdir ~/Desktop/mygame && cd $_
    • Windows : mkdir %USERPROFILE%\Desktop\mygame && cd %USERPROFILE%\Desktop\mygame
  • Invoke the generator:

    yo phaser

  • Invoke the state generator (Note: this updates & overwrites main.js):

    yo phaser:state

  • Invoke the prefab generator:

    yo phaser:prefab

  • Invoke the shader generator:

    yo phaser:shader

  • Run a local development server (livereload enabled) with this command:

    npm start

  • Package your game (i.e. minify css, html and js) with:

    npm run build

Notes

The game's main.js file will be updated with new states when you run the state generator.
It adds in .js files found in the src/states/ directory.

CREDITS

Overview

Name With Ownerjulien/generator-phaser
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 4)
Platform
License:MIT License
Release Count0
Created At2013-11-01 17:11:33
Pushed At2022-05-05 19:24:19
Last Commit At2022-05-05 21:24:05
Stargazers Count259
Watchers Count18
Fork Count32
Commits Count227
Has Issues Enabled
Issues Count27
Issue Open Count0
Pull Requests Count40
Pull Requests Open Count0
Pull Requests Close Count3
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private
To the top