Luiz Bills Posted April 25, 2014 Share Posted April 25, 2014 https://github.com/luizbills/phaser-project-base (work in progress) FeaturesWhen a javascript file is created inside src/sprite folder it's filled with a template for Phaser Sprites source. The same occurs on src/state folder, but is used a template for Phaser States (see _grunt/handlebars/templates). feel free to contribute Link to comment Share on other sites More sharing options...
David Posted April 25, 2014 Share Posted April 25, 2014 Nice. I'm actually in the midst of extracting a template from my current project. I like your auto-fill idea. Here's my current copy n' paste template I use in my "entities" folder:define(function(require) { "use strict"; var _ = require('lodash'), Phaser = require('phaser'); function Foo(props, game) { Phaser.Sprite.call(this, game, props.x, props.y, 'foo'); this.anchor.setTo(0.5, 0.5); } Foo.prototype = Object.create(Phaser.Sprite.prototype); _.extend(Foo.prototype, { constructor: Foo, // Just the customary constructor reassignment for those who expect it to be there update: function(game) { }, // prototype props and methods }); // Static props and methods Foo.preload = function(game) { }; return Foo;}); Luiz Bills 1 Link to comment Share on other sites More sharing options...
Recommended Posts