xronn Posted November 7, 2015 Share Posted November 7, 2015 Hi I'm using states but I need to pass in another parameter to the default new phaser.game arguments, let me show you what I mean; var game = new Phaser.Game(800, 600, Phaser.AUTO, 'phaser-example', { preload: preload, create: eurecaClientSetup, update: update, render: render });You see that example uses the "EurecaClientSetup" in the create how can I pass that argument when the code is formatted using states? For example I would need - gameName.Game.prototype = { create: function EurecaClientSetup() { }} Link to comment Share on other sites More sharing options...
jmp909 Posted November 8, 2015 Share Posted November 8, 2015 That last bit of code doesn't make (syntactical) sensecreate: is just the name of a function , so either.., create: createin your constructor, thencreate: function() { eurecaClientSetup()Or (less preferably).., create: eurecaClientSetup,TheneurecaClientSetup: function() { Link to comment Share on other sites More sharing options...
drhayes Posted November 9, 2015 Share Posted November 9, 2015 I think you mean this?gameName.Game.prototype.create = EurecaClientSetup;And, just to be nitpicky know-it-all, this syntax:var o = { create: function catpants() { }}DOES make syntactic sense, but it doesn't assign the function "catpants" defined elsewhere to the property "create" of the object "o". It just names the function assigned to "o.create" as "catpants" which will make your stacktraces much nicer. Link to comment Share on other sites More sharing options...
Recommended Posts