Jump to content

another phaser workflow


Luiz Bills
 Share

Recommended Posts

https://github.com/luizbills/phaser-project-base (work in progress)

 

Features
  • When 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

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;});
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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