项目作者: webcaetano

项目描述 :
Phaser Boilerplate
高级语言: JavaScript
项目地址: git://github.com/webcaetano/phaser-boilerplate.git
创建时间: 2016-01-02T04:29:53Z
项目社区:https://github.com/webcaetano/phaser-boilerplate

开源协议:MIT License

下载


Phaser logo


Phaser.io Boilerplate in Gulp ES6 (babel)

Features

  • ES6
  • Craft.js - helper for create and extend phaser objects functions in a chainable way
  • Utils.js - common gaming functions

Installation

  1. git clone git@github.com:webcaetano/phaser-boilerplate.git
  2. cd phaser-boilerplate
  3. npm install && bower install

Usage

Start Developing server

  1. gulp

Create a distribution version

  1. gulp build

Deploy to gh-pages

  1. gulp deploy
  • Change gulp/build.js adress repo git@github.com:webcaetano/phaser-boilerplate.git for yours

Deploy to surge

  1. gulp surge
  • Change gulp/build.js adress repo domain: 'phaser-boilerplate.surge.sh' for yours

Release a patch version (it auto change package.json and bower.json)

  1. gulp patch
  2. // 1.0.0 -> 1.0.1

Release a minor version

  1. gulp minor
  2. // 1.0.1 -> 1.1.0

Release a major version

  1. gulp major
  2. // 1.1.0 -> 2.0.0

Example of craft.js

  1. var group = craft.$g(); // create a group // .$g() is alias for .$group()
  2. var sprite = craft.$sprite('phaser') // create the sprite with key 'phaser'
  3. .$set({
  4. x:100,
  5. y:100,
  6. name:'foo'
  7. }) // set atributes based on a object
  8. .$mid() // same as sprite.anchor.setTo(0.5)
  9. .$into(group) // insert into group
  10. .$tint('#FF0000'); // tint accept '#' or ''
  11. var ball = craft.$circle({
  12. fill:'#FF00FF',
  13. size:40
  14. }) // same as game.add.graphics(0,0).beginFill(0xFF00FF).drawCircle(0,0,40)
  15. .$set({
  16. x:200,
  17. y:200,
  18. }) // set position
  19. .$into(group) // insert into group

Result : http://phaser-boilerplate.surge.sh

See Also