Phaser MVC Snippets

Controller
Description:game controller
Example:

Make Event Dispatcher
Description:create an event dispatcher
Example: eventDispatcher = new Phaser.Signal();

Dispatch Event
Description:dispatches an event
Example:eventDispatcher.dispatch("displayScores",myObj)

Event Listener
Description:sets the font size for a textfield
Example:eventDispatcher.add(function, scope);

model
Description:a simple model
Example:var GameModel=function() { //place vars here this.currentView=null; }

Data Loader
Description:Loads data from a url
Example:

Json Decode result
Description:decode json on dataLoader callback
Example:gotData: function(data, scope) { console.log(data); data = decodeURIComponent(data); data = JSON.parse(data); }