Phaser.io Boilerplate in Gulp ES6 (babel)
- ES6
- Craft.js - helper for create and extend phaser objects functions in a chainable way
- Utils.js - common gaming functions
git clone [email protected]:webcaetano/phaser-boilerplate.git
cd phaser-boilerplate
npm install && bower install
gulp
gulp build
gulp deploy
- Change
gulp/build.js
adress repo[email protected]:webcaetano/phaser-boilerplate.git
for yours
Deploy to surge
gulp surge
- Change
gulp/build.js
adress repodomain: 'phaser-boilerplate.surge.sh'
for yours
gulp patch
// 1.0.0 -> 1.0.1
gulp minor
// 1.0.1 -> 1.1.0
gulp major
// 1.1.0 -> 2.0.0
var group = craft.$g(); // create a group // .$g() is alias for .$group()
var sprite = craft.$sprite('phaser') // create the sprite with key 'phaser'
.$set({
x:100,
y:100,
name:'foo'
}) // set atributes based on a object
.$mid() // same as sprite.anchor.setTo(0.5)
.$into(group) // insert into group
.$tint('#FF0000'); // tint accept '#' or ''
var ball = craft.$circle({
fill:'#FF00FF',
size:40
}) // same as game.add.graphics(0,0).beginFill(0xFF00FF).drawCircle(0,0,40)
.$set({
x:200,
y:200,
}) // set position
.$into(group) // insert into group
Result : http://phaser-boilerplate.surge.sh