Jump to content

A Yeoman Generator for Phaser in CoffeeScript: generator-phaser-coffee-gulp


dschwertfeger
 Share

Recommended Posts

So, I wanted to write a game with Phaser. I came across some boilerplate projects and Yeoman generators but somehow I always missed something. I'll admit that I had pretty particular demands, though. This is when I spent a day making my own Yeoman generator which I'd like to share with you. Maybe someone else was not completely satisfied with available generators or boilerplate projects either and will find this useful.

 

This is a Yeoman generator for writing HTML5 games with the Phaser game framework in CoffeeScript inspired by generator-phaser-official by codevinsky. It inlcudes a fantastic Gulp + Browserify build system based on the gulp-starter project by @greypants.

 

You can install the generator through npm:

$ npm install -g generator-phaser-coffee-gulp

If you don't have Yeoman and Gulp installed, yet, now is the time:

$ npm install -g yo gulp

With all the necessary tools installed you can go ahead and create a new directory for your game project:

$ mkdir my-awesome-phaser-game && cd $_

Within your project folder you can finally invoke the Yeoman generator:

$ yo phaser-coffee-gulp

The generator will ask you a few questions about the name of the game, the phaser version to use and the game display dimensions. Once you answered those, it will bootstrap your game project and generate all the required files. When the generator is done, you can run the local development server with Gulp:

$ gulp

On MacOS, this will automagically open the URL of your game in Chrome if Chrome is installed. The development server is not only accessible on your localhost but even on other devices in your network. The livereload feature will push code changes to all your devices and reload all connected browsers. This means that you can develop and test your game on multiple devices at the same time.

 

Enjoy!

 

 

 

Link to comment
Share on other sites

  • 4 weeks later...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...